cpusage 0.21
SYNOPSIS
cpusage [ -hos ] [ -a | -l limit ]
AVAILABILITY
As source for Linux and FreeBSD. Tested with Linux 2.4 & 2.6 and
FreeBSD 5. But adaption to other UNIX's should only be a problem of
getting the tics counters from the kernel.
Download from:
http://www.net.informatik.tu-muenchen.de/~schneifa/sources/
DESCRIPTION
This tool reads out the tics counter of the operating system and calcu-
lates the Percentages spend in each CPU_STATE. This is done twice per
second. The output is send to standard out. Supplementary the minimum,
maximum and average percentages are displayed. The recording for the
average measuring can be limited to start only if the idle value drops
under a certain limit (set with the -l limit option) and stops if the
idle value returns over that limit again.
The program will execute until a SIGINT is received. This can be done
by pressing Strg+C in the corresponding shell or by invoking
kill -SIGINT PID
where PID is the process ID of cpusage. If your system does not allow
to use kill in the described manner, please refer to kill(1) for
details.
OPTIONS
-a build average over the whole time, same as -l 100
-h prints the help
-l limit
set limits for average usage snapping
-o format the output machine readable (see OUTPUT FORMAT for
details)
-s run only once and exit. In addition, the summary is not calcu-
lated and printed.
OUTPUT FORMAT
The output depends on the available information delivered from the ker-
nel this can be differ between operating system and even between dif-
ferent versions of operating systems (e.g.: Linux 2.4.x and Linux
example outputs FreeBSD was chosen.
Human readable (Default)
Every line consists of the fields each with name:value pairs:
user: 3.0%, nice: 0.0%, system: 0.7%, idle: 68.7%, interrupt:
27.6%,
Machine readable (set via the -o option)
In contrast to the previous output format, only the values are shown
without the "%" sing:
0.0:0.0:0.0:70.7:29.3
SEE ALSO
top(1), uptime(1), kill(1)
AUTHOR
Fabian Schneider <fabian@net.in.tum.de>
BUGS
Please send problems, bugs, questions, desirable enhancements, source
code contributions, etc. to:
fabian@net.in.tum.de
20 March 2006 CPUSAGE(1)
Man(1) output converted with
man2html