7 replies
Try Running top
[root@darkstar /root]# top
this will give you not only the information you are looking for but also give the information on all processes currently running on your machine.
by ks_moorthy
I know about top utiltiy. I am in need to write some script or c program rahter than using top .And moreover i know these things are available in /proc/stat.
My question is from this data how to calculate % ces .
by dallen
If you have the Gnome enviorment you may also try running:
gtop&
this will launch a GUI console, as a backround process.
by ks_moorthy
gtop and top (previous reply )are same
except some nice GUI
There is not a simple what to do it. The raw cpu times per state you can get by reading the 'cpu' line from /proc/stat. There are 4 numbers which represent user, nice, system, and idle.
To get CPU usage your have to read /proc/stat twice over a period of time. Calculate the delta for each CPU state. To get percentages for each state, divide each state delta by the sum of all 4 delta deltas. To get CPU busy percentage divide the sum of user, nice, and system by the sum of all 4 deltas.
This method is how the top command calculates it's CPU percentages.
by ks_moorthy
by ks_moorthy
This discussion is closed to new replies.
Trending Linux posts
Sort by Trending