scripts: Add cpuload script
This commit is contained in:
parent
3c25409dfa
commit
91c3d95f04
10
scripts/cpuload.sh
Executable file
10
scripts/cpuload.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
source common.sh
|
||||||
|
|
||||||
|
echo -e "xx" > $hcs
|
||||||
|
|
||||||
|
while [ 1 ]; do
|
||||||
|
cpu=`cat <(grep 'cpu ' /proc/stat) <(sleep 0.1 && grep 'cpu ' /proc/stat) | awk -v RS="" '{print ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}' | sed "s/\..*//g"`
|
||||||
|
prg=$(((($cpu*1000) / 100) * 60 / 1000))
|
||||||
|
printf "x%02d %02d\n" $prg $prg > $hcs
|
||||||
|
#sleep 0.1
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user