Wednesday, August 17, 2005

CPU statistics

ans m41 wrote:
> it gives only a current snapshot

without arguments, it actually gives an average of stats
since last reboot.

> it isn't possible to view previously collected data
> with mpstat, isn't it ?

mpstat doesn't collect samples, but you can easily script it, eg:

mpstat 30 120 > /var/tmp/mpstat.out

will collect for one hour with a 30 sec interval.

You can also directly peek the kernel counters like this:

kstat -T d -p cpu:*:sys:cpu_ticks_idle cpu:*:sys:cpu_ticks_kernel cpu:*:sys:cpu_ticks_user 30


Post a Comment

<< Home