Matplotlib - plot process activity as it happens

Top, htop, and KDE system-monitor do a pretty good job. But if you’d like to experiment with plots and info that are beyond those tools, then the python library python-matplotlib is pretty useful, and available from the official openSUSE repos.

For example, here is a rolling overview of all processes/threads running on my desktop. During the current interval displayed in the plot, the red processes have consumed CPU, the green ones have performed IO, the orange ones both CPU+IO, the yellow ones have exited, and the big ones have larger or changing resident set sizes. Note the hover-over popup for process details.

http://users.actrix.co.nz/michael/grid1a.jpeg

This is an attempt at at-a-glance overviews which pinpoints resource hogs and other problems in a way that makes them stick out visually.

I’ve put code for a few plots as well as code for extracting proc-fs to CSV on a blog I’ve just started. All the code will run from the command line and includes -h help options, so even if you don’t know python, you will be able to have a play.

All I get running this script is:

Segmentation fault

openSUSE 11.3 i586, matplotlib from /Education repo.

vodoo wrote:

>
> All I get running this script is:
>
>
> Code:
> --------------------
> Segmentation fault
> --------------------
>
>
> openSUSE 11.3 i586, matplotlib from /Education repo.
>
I checked on 11.4 64 bit it works with the matplotlib from education. Can
you check on your 11.3 with matplotlib from the science repo if that works.
I can check later on my 11.3 if the one from education gives also problems
for me and which one works.


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram

martin_helm wrote:

> vodoo wrote:
>
>>
>> All I get running this script is:
>>
>>
>> Code:
>> --------------------
>> Segmentation fault
>> --------------------
>>
>>
>> openSUSE 11.3 i586, matplotlib from /Education repo.
>>
> I checked on 11.4 64 bit it works with the matplotlib from education. Can
> you check on your 11.3 with matplotlib from the science repo if that
> works. I can check later on my 11.3 if the one from education gives also
> problems for me and which one works.
>
@vodoo
I checked on 11.3 (but 64 bit, no 32 bit system available to check it) with
matplotlib from education and it works, I would check that the python libs
matplotlib depends on are from the education repository as well (I think
about numpy here). You may have some inconsistencies here.
Is there really no more output than segmentation fault?


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram

I’m on 11.4 and I’m using python-matplotlib from vendor openSUSE.

I guess that I am one step further now. The software.opensuse.org server had quite a hickup yesterday and my installation was not complete. I re-installed today and now the segfault has gone away. Running the script now results in:

Traceback (most recent call last):
  File "/home/vodoo/bin/bubbleplot", line 16, in <module>
    import linuxprocfs as procfs
ImportError: No module named linuxprocfs

vodoo wrote:

>
> I guess that I am one step further now. The software.opensuse.org server
> had quite a hickup yesterday and my installation was not complete. I
> re-installed today and now the segfault has gone away. Running the
> script now results in:
>
>
> Code:
> --------------------
> Traceback (most recent call last):
> File “/home/vodoo/bin/bubbleplot”, line 16, in <module>
> import linuxprocfs as procfs
> ImportError: No module named linuxprocfs
> --------------------
>
>
Did you download the code from http://codeincluded.blogspot.com/ for
linuxprocfs.py?
(post from Friday, June 10, 2011 on the blog)


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram

I was mostly aiming at a python/code conversant audience, but in the notes section of my blog posting I did state:

Even if you don’t know any python, you can still have a play by running these scripts from the command line. Just save them into a folder giving them the appropriate file-names and also save the linuxprocfs.py from my previous post. Make sure you’ve installed python-matplotlib for you distribution of Linux (it’s a standard offering for openSUSE, so it’s in the repo).

You should have saved the linuxprocfs.py file in the same folder as bubbleplot with precisely that name including case.

Thank you all. I must admit that I was a bit confused. My fault. Careful reading of the blog would have solved the problem. What remains to be said is: I really like this innovative view on my system resources. Thanks for sharing.

@mchnz
I also would like to thank you for your effort, this python scripts are
really nice for visualization, I like them.


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram