Skip to content

Commit 485a2bb

Browse files
fix(scripts/cpu_info): ignore I/O wait time
1 parent 91a1e09 commit 485a2bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/cpu_info.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ get_percent()
99
{
1010
case $(uname -s) in
1111
Linux)
12-
percent=$(LC_NUMERIC=en_US.UTF-8 top -bn2 -d 0.01 | grep "[C]pu(s)" | tail -1 | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}')
12+
percent=$(LC_NUMERIC=en_US.UTF-8 top -bn2 -d 0.01 | grep "[C]pu(s)" | tail -1 | sed "s/.*, *\([0-9.]*\)%* id, \([0-9.]*\)%* wa.*/\1 \2/" | awk '{print 100 - $1 - $2"%"}')
1313
normalize_percent_len $percent
1414
;;
1515

0 commit comments

Comments
 (0)