Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44555

Re: python process accounting

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.055
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'bash': 0.09; 'exec': 0.09; 'quarter': 0.09; 'skip:/ 10': 0.09; 'subject:process': 0.09; 'wrapper': 0.09; 'python': 0.11; 'processes.': 0.16; 'true:': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'import': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'wondering': 0.29; 'that.': 0.31; 'info.': 0.31; 'stuff': 0.32; 'run': 0.32; 'open': 0.33; 'running': 0.33; "i'd": 0.34; 'but': 0.35; 'possible': 0.36; 'hi,': 0.36; 'so,': 0.37; 'operating': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'dave': 0.60; 'such': 0.63; 'account': 0.65; 'received:74.208': 0.68; 'below.': 0.71; 'received:74.208.4.194': 0.84; 'rita': 0.84; 'snapshot': 0.84; 'angel': 0.91; 'do:': 0.91
Date Tue, 30 Apr 2013 12:49:58 -0400
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
MIME-Version 1.0
To python-list@python.org
Subject Re: python process accounting
References <CAOF-KfhSkQrRPjiyN3bkLwCguFw58Pzf-nu1ne9ZoZDQw3t6SQ@mail.gmail.com> <517FF394.9040701@davea.name>
In-Reply-To <517FF394.9040701@davea.name>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:ST9ELGXSOY51XT4dNbXaOsJf9aTqWbMmCJ5brBhfVS1 53l5ZQjAZvKUDpgfr6PUkDF8CoPaQC6yuFD2ifPHIpEhdTAkMN ivHehWu6Wy+zEc0bbJsTEICk8HpHmCTKJphrFhW1fiLyJp8his C/lnTArUNAP0d0SDzPzQ7XGX9moj7vpYu9y+GNVE3dpSUt/sBX Z+IVNKWK8XUt1wKYbJxUuUm4V0OfIcej7ctQBwPvC0TUY54cUG Ey2jBP5iDAGh+T6UBGNsi5X6b+n3ERB/FC9LfLxn9rd9gII42z +Qxm+J4qHA7AF//8Xo34GE/X746HT8PFljqgrzVStd4/D9aYQ= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1188.1367340618.3114.python-list@python.org> (permalink)
Lines 45
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367340618 news.xs4all.nl 15882 [2001:888:2000:d::a6]:49862
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44555

Show key headers only | View raw


On 04/30/2013 12:38 PM, Dave Angel wrote:

Oops, a typo.  See below.

> 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 and do a
>> periodic snapshot for whats in /proc/<pid>/stats.
>>
>>
>
> I only understood a quarter of that.  But if you want to sleep, why not
> just call  time.sleep ?
>

import time
while True:
       time.sleep(10)
       ...  do some stuff with the processes.

>
> If you want help in the other portion, you'd better explain:
>
> <<<<<<
> Running Python xx.xx in Operating System yy.
>
>  From the bash prompt, I'd like to do:
>     zzzzz, and zzzz
>
> And here's what I mean by child processes.  Children of the current bash
> shell?  Or what?
> <<<<<<


-- 
DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: python process accounting Dave Angel <davea@davea.name> - 2013-04-30 12:49 -0400

csiph-web