Skip to content

Instantly share code, notes, and snippets.

@jhazelwo
Created June 2, 2017 15:33
Show Gist options
  • Save jhazelwo/e8a6d0681d399de878efc18386e23687 to your computer and use it in GitHub Desktop.
Save jhazelwo/e8a6d0681d399de878efc18386e23687 to your computer and use it in GitHub Desktop.
Visualize CPU idle time as dots on the command line.
#!/bin/sh
# idle cpu as dots
vmstat -n 1 | while read line; do
length=`echo $line|awk '{print $15}'|egrep "^[0-9]+$"`
test -n "$length" && {
echo -n $length
for e in `seq 1 $length `; do echo -n .; done;
echo '';
} || true
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment