How to monitor top applications using CPU (and IO if possible) in a graph

cpudisk-usagepidtop

I need to find what and when these applications used so much CPU (and IO if possible too). This should be in a graphic timeline like we see in GNOME System Monitor CPU History. I also want to compare that graphic with the Psensor temperature monitor too.

I found answers for single process where you already know the PID, but I am looking for that information whenever the applications are top-using CPU or IO, which can be any pid any time, on the last 1 hour.

I wonder if there is some application that can do it.

Best Answer

I thought it might be fun to take a stab at this one with python and matplotlib. It's a bit big for posting here but here is a link to it on my site. This is a real ugly way to get it done but hopefully it will give you some ideas. I just parsed the output of ps and pulled the cpu temp stuff from the output of sysctl since I'm on an OpenBSD box but it works well enough.. I suppose you could get pretty fancy with the data acquisition part and come up with a ton of different things. If you'd like I can put it up on github or something.

-jamil

Related Question