Monitoring CPU time

Francois Tigeot ftigeot at wolfpond.org
Sun Apr 4 12:00:31 PDT 2010


On Sun, Apr 04, 2010 at 03:01:47PM +0000, Chris Turner wrote:
> Francois Tigeot wrote:
> >
> >The FreeBSD plugin uses the sysctl kern.cp_time, which is not present on
> >DragonFly. Is there any way to easily get the different percentages of 
> >nice,
> >idle, user, system, etc... time from a shell ?
> >
> there might be a better way to do this - but you can snag that 
> particular set of data from vmstat -c 1 ..

Thanks for the tip, it's almost what I want.

FreeBSD:
$ sysctl kern.cp_time
kern.cp_time: 1797279 579339 1349174 128959 811149589

DragonFly:
$ vmstat -c 1 | tail -n 1 | awk '{ print $14,$15,$16 }'
675875492 705365686 1527141678

Unfortunately, there's no data for nice or interrupt. Time to dig into top
sources...

-- 
Francois Tigeot





More information about the Users mailing list