Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'exec': 0.09; 'quarter': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'skip:/ 10': 0.09; 'subject:process': 0.09; 'wrapper': 0.09; 'python': 0.11; 'kern': 0.16; 'placeholder': 0.16; 'processes.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'underlying': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'interpret': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'wondering': 0.29; 'robert': 0.30; 'that.': 0.31; 'info.': 0.31; 'run': 0.32; 'open': 0.33; 'running': 0.33; 'but': 0.35; 'possible': 0.36; 'hi,': 0.36; 'example,': 0.37; 'so,': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'dave': 0.60; 'such': 0.63; 'our': 0.64; 'account': 0.65; 'world': 0.66; 'believe': 0.68; 'eco': 0.84; 'measure.': 0.84; 'rita': 0.84; 'snapshot': 0.84; 'terrible': 0.84; 'angel': 0.91; 'received:86': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robert Kern Subject: Re: python process accounting Date: Tue, 30 Apr 2013 18:54:42 +0100 References: <517FF394.9040701@davea.name> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: cpc2-cmbg17-2-0-cust347.5-4.cable.virginmedia.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: <517FF394.9040701@davea.name> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1367344504 news.xs4all.nl 15940 [2001:888:2000:d::a6]:36126 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44558 On 2013-04-30 17:38, Dave Angel wrote: > On 04/30/2013 12:25 PM, Rita wrote: >> Hi, >> >> I was wondering if it possible to write a python wrapper which will account >> my processes. I would like to account for all the children processes (fork) >> by looking at their /proc/ info. Such as memory, io, open files, >> stats. >> >> So, instead of me running "/bin/sleep 10", i would like to run it as >> "pywrap.py /bin/sleep 10" and it will do an exec /bin/sleep 10 and do a >> periodic snapshot for whats in /proc//stats. > > I only understood a quarter of that. But if you want to sleep, why not just > call time.sleep ? I think that was just a placeholder example, not the program he actually wants to measure. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco