Cpu usage as calculated here is incorrect. /proc/stat counts cpu time cumulatively from boot, so what is computed and exposed as %cpu-usage is actually something like the average cpu utilization since boot, rather than the current usage percentage.
Also, /proc/stat reports overall cpu usage times on the cpu line. It's probably (mathematically) more accurate to use that line to compute an overall cpu usage percent, rather than averaging the usage of the individual cores.
Cpu usage as calculated here is incorrect.
/proc/statcounts cpu time cumulatively from boot, so what is computed and exposed as%cpu-usageis actually something like the average cpu utilization since boot, rather than the current usage percentage.Also,
/proc/statreports overall cpu usage times on thecpuline. It's probably (mathematically) more accurate to use that line to compute an overall cpu usage percent, rather than averaging the usage of the individual cores.