Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder3.xlned.com!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'bash': 0.09; 'currently,': 0.09; 'exec': 0.09; 'facts': 0.09; 'quarter': 0.09; 'received:209.85.219': 0.09; 'skip:/ 10': 0.09; 'subject:process': 0.09; 'wrapper': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '"i': 0.16; 'exactly,': 0.16; 'kern': 0.16; 'placeholder': 0.16; 'processes.': 0.16; 'there?': 0.16; 'to:addr:robert.kern': 0.16; 'to:name:robert kern': 0.16; 'underlying': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'thoughts': 0.19; '>>>': 0.22; 'email addr:gmail.com>': 0.22; 'shell': 0.22; 'cc:addr:python.org': 0.22; 'interpret': 0.24; '---': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'first,': 0.26; 'header:In-Reply-To:1': 0.27; 'wondering': 0.29; 'robert': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'that.': 0.31; 'info.': 0.31; 'this.': 0.32; 'run': 0.32; 'open': 0.33; 'url:python': 0.33; 'running': 0.33; 'skip:# 10': 0.33; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'possible': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'example,': 0.37; 'so,': 0.37; 'received:209': 0.37; 'skip:& 10': 0.38; 'pm,': 0.38; 'url:mail': 0.40; 'how': 0.40; 'dave': 0.60; 'such': 0.63; 'our': 0.64; 'account': 0.65; '30,': 0.65; 'to:addr:gmail.com': 0.65; 'world': 0.66; 'believe': 0.68; 'eco': 0.84; 'measure.': 0.84; 'rita': 0.84; 'snapshot': 0.84; 'terrible': 0.84; '\xa0but': 0.84; 'angel': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=MFI/2b2K78lNGwUeAKPFDNg3YuE1oFOU1+zmKZjslbQ=; b=qMCbKuaDQ5kyi+0vpBXO7spkzZ5erFXIT+TzLIJHkXUP9eKxpWn1TqGCNAqTQbd9r7 YyZplguaxoET4dCLLkwFpJp9swyfugRDNkadMVWrI5RWAQiGhg7LGp6GynKUi0XjU87I y/Svv9O5Tc5sLDhisgQawv+byUyqcFBpom5eVkqSVLrkpmGoBVTposJ3+YOzhv/dW0aL hsIZQ2q+9UziLMmsOnNEnsuWIa/EMWusWZX/PntOVWSJGS94FPAAKRvDVvLu14uGPWEe 5e9K76qnIFcYPpcYr0LkK+cVbB+Zmc6HBRbn0OMicgqpowZIroh1afHb87b4UcKvBvXD xlwA== MIME-Version: 1.0 X-Received: by 10.60.142.103 with SMTP id rv7mr18028767oeb.34.1367345480623; Tue, 30 Apr 2013 11:11:20 -0700 (PDT) In-Reply-To: References: <517FF394.9040701@davea.name> Date: Tue, 30 Apr 2013 14:11:20 -0400 Subject: Re: python process accounting From: Rita To: Robert Kern Content-Type: multipart/alternative; boundary=047d7b2e0887a86ae604db97ed3e Cc: python-list@python.org 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: 127 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1367345488 news.xs4all.nl 15892 [2001:888:2000:d::a6]:43681 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44561 --047d7b2e0887a86ae604db97ed3e Content-Type: text/plain; charset=ISO-8859-1 Exactly, its a place holder measure. Currently, I have a shell program like this. #!/usr/bin/env bash exec "$@" Any thoughts how I can put python in there? On Tue, Apr 30, 2013 at 1:54 PM, Robert Kern wrote: > 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 > > -- > http://mail.python.org/**mailman/listinfo/python-list > -- --- Get your facts first, then you can distort them as you please.-- --047d7b2e0887a86ae604db97ed3e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Exactly, its a place holder measure.=A0

Currently, I have a shell program like this.

#!/u= sr/bin/env bash
exec "$@"

Any = thoughts how I can put python in there?





On Tue, Apr 30, 2013 at 1:54 PM, Robe= rt Kern <robert.kern@gmail.com> wrote:
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/<pid> 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 an= d do a
periodic snapshot for whats in /proc/<pid>/stats.

I only understood a quarter of that. =A0But if you want to sleep, why not j= ust
call =A0time.sleep ?

I think that was just a placeholder example, not the program he actually wa= nts to measure.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless = enigma
=A0that is made terrible by our own mad attempt to interpret it as though i= t had
=A0an underlying truth."
=A0 -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list



-- --- Get your facts first, then you can distort them as you please.<= /span>--
--047d7b2e0887a86ae604db97ed3e--