ANN: psutil 0.5.0 released

33 views
Skip to first unread message

Giampaolo Rodola'

unread,
Jun 27, 2012, 3:34:32 PM6/27/12
to psu...@googlegroups.com
Hi folks,
I'm pleased to announce the 0.5.0 release of psutil:

=== Major new features ===

- system users
- (Linux, Windows) process CPU affinity (get and set)
- (POSIX) process number of opened file descriptors.
- (Windows) process number of opened handles.
- psutil.disk_partitions() now provides also mount options
- new Process.as_dict() method.
- Process.get_children(recursive=True): return all process descendants.
- 2to3 is not longer required to run at installation time in order to support Python 3
- ppid, name, exe, cmdline and create_time properties of Process class are now cached after being accessed.
- psutil.process_iter() now caches Process instances between calls.

For a complete list of features and bug fixes see:


=== New features by example ===

>>> import psutil, os
>>>
>>> psutil.get_users()
[user(name='giampaolo', terminal='pts/2', host='localhost', started=1340737536.0),
 user(name='giampaolo', terminal='pts/3', host='localhost', started=1340737792.0)]
>>>
>>> psutil.disk_partitions()
[partition(device='/dev/sda1', mountpoint='/', fstype='ext4', opts='rw,nosuid'),
 partition(device='/dev/sda2', mountpoint='/home', fstype='ext, opts='rw')]
>>>
>>> p = psutil.Process(os.getpid())
>>> p.get_num_fds()
4
>>>
>>> p.get_num_handles()  # windows only
254
>>>
>>> p.get_memory_maps()
[mmap(path='/lib/x86_64-linux-gnu/libutil-2.15.so', rss=16384, anonymous=8192, swap=0),
 mmap(path='/lib/x86_64-linux-gnu/libc-2.15.so', rss=6384, anonymous=15, swap=0),
 mmap(path='/lib/x86_64-linux-gnu/libcrypto.so.1.0.0', rss=34124, anonymous=1245, swap=0),
 mmap(path='[heap]', rss=54653, anonymous=8192, swap=0),
 mmap(path='[stack]', rss=1542, anonymous=166, swap=0),
 ...]
>>>
>>> p.as_dict()
{'status': 0, 'pid': 29510, 'connections': [], 'cmdline': ['python'], ...}
>>>
>>> p.get_cpu_affinity()
[0, 1, 2, 3]
>>> p.set_cpu_affinity([0])
>>>
>>> p.get_children(recursive=True)
[<Process...>, <Process...>, ...]
>>>


=== Compatitility notes ===

0.5.0 version does not introduce any backward incompatibility. Nevertheless
it introduces some deprecations warnings:

- Process.nice property is deprecated in favor of new get_nice() and set_nice() methods.
- psutil.get_process_list() is deprecated.
- ppid, name, exe, cmdline and create_time properties of Process class are now cached after being accessed, meaning NoSuchProcess will no longer be raised in case the process is gone in the meantime.
- psutil.STATUS_* constants can now be compared by using their string representation.


=== Links ===



Please try out this new release and let me know if you experience any problem by filing issues on the bug tracker.
Thanks in advance.


--- Giampaolo Rodola'

Sandro Tosi

unread,
Jun 28, 2012, 1:47:51 PM6/28/12
to psu...@googlegroups.com
Hi Giampaolo,

On Wed, Jun 27, 2012 at 9:34 PM, Giampaolo Rodola' <g.ro...@gmail.com> wrote:
> Hi folks,
> I'm pleased to announce the 0.5.0 release of psutil:
> http://code.google.com/p/psutil/
...
> Please try out this new release and let me know if you experience any
> problem by filing issues on the bug tracker.
> Thanks in advance.

I see the docs/ dir was removed from the released tarball - was that on purpose?

Cheers,
--
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

Giampaolo Rodolà

unread,
Jun 28, 2012, 1:50:46 PM6/28/12
to psu...@googlegroups.com
Yes:
http://code.google.com/p/psutil/source/detail?r=1367
Did you find it useful?


2012/6/28 Sandro Tosi <sandr...@gmail.com>:
> --
> You received this message because you are subscribed to the "Python process utilities (psutil)" project group:
> http://code.google.com/p/psutil
> To post to this group, send email to psu...@googlegroups.com
> To unsubscribe from this group, send email to psutil-un...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/psutil

Sandro Tosi

unread,
Jun 28, 2012, 1:57:20 PM6/28/12
to psu...@googlegroups.com
On Thu, Jun 28, 2012 at 7:50 PM, Giampaolo Rodolà <g.ro...@gmail.com> wrote:
> Yes:
> http://code.google.com/p/psutil/source/detail?r=1367
> Did you find it useful?

I was installing it in the Debian package, but just because it was
there :) There's a reference to the Google Code website, so I think I
can live with that. Thanks for the prompt reply.
Reply all
Reply to author
Forward
0 new messages