The mpstat utility reports CPU statistics. Where the first parameter specifies the interval like this (from mpstat man page):
The interval parameter specifies the amount of time in seconds between each report.
Is there a way to define an interval less than one second like e.g. in sleep
, there can be passed fractions of one second with sleep 0.2
?
No. The systat implementation of mpstat converts interval to an integer.
Utilization is a macro level summary metric, and mpstat is intended for humans to watch it. Wishing for 200 ms resolution hints that more targeted and precise tracing on Linux could be useful for you. Look at Gregg's articles on instructions per cycle and what utilization really means. See what code is on CPU with
perf top
. Measure the performance of relevant system calls with eBPF.