Data-Science-Wiki
Data-Science-Wiki copied to clipboard
difference between Formula and Code
https://github.com/Leo-G/DevopsWiki/wiki/How-Linux-CPU-Usage-Time-and-Percentage-is-calculated
Formula
Total CPU Idle time since boot = idle + iowait
Total CPU usage time since boot = Total CPU time since boot - Total CPU Idle time since boot
IDLE=${CPU[3]} # Just the idle CPU time.
let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"
Where is the IO_WAIT not in Total_CPU_Idel_Time? What is the meaning "+5" ?