This is a discussion on How do I get percentage CPU usage of processes for a specified time interval? within the AIX Operating System forums, part of the Unix Operating Systems category; --> How do I get percentage CPU usage of processes for a specified time interval? I'm wish to write a ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| How do I get percentage CPU usage of processes for a specified time interval? I'm wish to write a script, part of which displays the top 10 processes by percentage processor usage over a 30 second interval. I know "topas" can show this, but I need to be able to process the information in a script. The output from "ps" doesn't seem to give the neccessary resolution... Can anybody give me some pointers as to how this can be done? Many Thanks, =Adrian= |
| |||
| Adrian Davis wrote: > How do I get percentage CPU usage of processes for a specified time > interval? > > I'm wish to write a script, part of which displays the top 10 > processes by percentage processor usage over a 30 second interval. I > know "topas" can show this, but I need to be able to process the > information in a script. The output from "ps" doesn't seem to give the > neccessary resolution... You need to look into using nmon, as it can produce output that can be analyzed in that fashion (e.g. nmon Analyzer). |
| ||||
| On Feb 16, 3:35 am, "Adrian Davis" <adr...@satisoft.com> wrote: > How do I get percentage CPU usage of processes for a specified time > interval? > > I'm wish to write a script, part of which displays the top 10 > processes by percentage processor usage over a 30 second interval. I > know "topas" can show this, but I need to be able to process the > information in a script. The output from "ps" doesn't seem to give the > neccessary resolution... > > Can anybody give me some pointers as to how this can be done? > > Many Thanks, > =Adrian= You can run "tprof -x sleep 30" and then use awk/grep to filter infor from the generated sleep.prof file. HTH |