baweaver / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Process.get_cpu_times() - provide information about children's user times #268

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently Process.get_cpu_times() returns information about user and system CPU 
times.
On the other hand, Python's os.times() also returns info about:

- children’s user time
- children’s system time
- elapsed real time since a fixed point in the past

I'm not sure what the last one means, but children times are a useful 
information to provide.
I'm opening this as a reminder to look into what platforms this is possible.
If my memory serves me right I should have seen this at least on BSD and Linux.

Original issue reported on code.google.com by g.rodola on 31 May 2012 at 1:51

GoogleCodeExporter commented 8 years ago
It turns out we can determine this on Linux, BSD and Solaris.
Similarly to os.times, on OSX and Windows we can return 0 and document it.
Since this might introduce backward compatibilty issues as it changes the size 
of the returned namedtuple I think it's better to post-pone this for 1.0.0 
version in which I plan to break some other stuff.

Attached is a patch for BSD.

Original comment by g.rodola on 2 Jun 2012 at 7:31

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed in version 0.6.0, released just now.

Original comment by g.rodola on 13 Aug 2012 at 4:25