-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e78d4d
commit 37a75cd
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
head -1 /proc/stat > file.txt | ||
sleep 1s | ||
for value in {2..60} | ||
do | ||
head -1 /proc/stat >> file.txt | ||
sleep 1s | ||
done | ||
|
||
awk '{sum2+=$2; sum3+=$3; sum4+=$4; sum5+=$5; sum6+=$6; sum7+=$7; sum8+=$8; sum9+=$9;} END {print sum2/60,sum3/60,sum4/60,sum5/60,sum6/60,sum7/60,sum8/60,sum9/60}' file.txt | awk '{print ((($1+$2+$3+$4+$5+$6+$7+$8)-($4+$5))/($1+$2+$3+$4+$5+$6+$7+$8))*100}' | ||
|
||
|