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


Groups > comp.lang.python > #44554 > unrolled thread

Re: python process accounting

Started byDave Angel <davea@davea.name>
First post2013-04-30 12:38 -0400
Last post2013-04-30 12:38 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#44554 — Re: python process accounting

FromDave Angel <davea@davea.name>
Date2013-04-30 12:38 -0400
SubjectRe: python process accounting
Message-ID<mailman.1187.1367339944.3114.python-list@python.org>
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 os
while True:
     os.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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web