I want to graph (graphical output would be great, i.e. a .png file) the following situation: I have users A, B, and C. I limit their resources so that when all users run a CPU intensive task at the same time, those processes will use 25%, 25%, and 50% of CPU. I know I can get the real-time stats using top
but have no idea what to do with them. I've searched through the huge top
man page but haven't found much on the subject of outputting data that can be graphed. Ideally, the graph would show a span of maybe 30 seconds. Any ideas how to achieve this?
The
tload
command represents the pictorial representation of the average system load through ASCII graph. This command can be used to provide the graph on a terminal. The syntax for the command is:If terminal is not provided as the argument to this command, then by default it outputs the graph on the current terminal. So the simplest forms of this command are:
Batch mode could be useful:
For example:
Ganglia Gmetric can be used to plot a graph for this.
cpu_per_user_gmetric.sh
crontab -l
and here's the result:
Perhaps you could use
collectd
and adapt one of the available plugins? Yes, none of the listed will do exactly what you want, but on the other hand they are pretty simple to modify and I think you could start with for exampleprocesses
plugin and start working from there.Try
sar
andsadf
to gather and prepare the data for easy graphing. http://sebastien.godard.pagesperso-orange.fr/documentation.html