Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #44565 > unrolled thread
| Started by | "Giampaolo Rodola'" <g.rodola@gmail.com> |
|---|---|
| First post | 2013-04-30 19:18 +0200 |
| Last post | 2013-04-30 19:18 +0200 |
| 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.
Re: python process accounting "Giampaolo Rodola'" <g.rodola@gmail.com> - 2013-04-30 19:18 +0200
| From | "Giampaolo Rodola'" <g.rodola@gmail.com> |
|---|---|
| Date | 2013-04-30 19:18 +0200 |
| Subject | Re: python process accounting |
| Message-ID | <mailman.1196.1367346202.3114.python-list@python.org> |
2013/4/30 Rita <rmorgan466@gmail.com>: > 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. > > > > > -- > --- Get your facts first, then you can distort them as you please.-- > > -- > http://mail.python.org/mailman/listinfo/python-list > Not sure what you're talking about expect for the process management part in which case it seems you're looking for psutil: https://code.google.com/p/psutil/#Process_management In detail, if you want to work with process children: >>> import psutil, os >>> thisproc = psutil.Process(os.getpid()) >>> for child in thisproc.get_children(): ... print child.name ... print child.get_memory_info() ... print child.get_open_files() ... --- Giampaolo https://code.google.com/p/pyftpdlib/ https://code.google.com/p/psutil/ https://code.google.com/p/pysendfile/
Back to top | Article view | comp.lang.python
csiph-web