Skip to content

Instantly share code, notes, and snippets.

@johnl
Created September 1, 2016 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnl/a98b73847ed29b766562eaafc8aa8ae2 to your computer and use it in GitHub Desktop.
Save johnl/a98b73847ed29b766562eaafc8aa8ae2 to your computer and use it in GitHub Desktop.
cat /proc/stat | grep "cpu " | perl -e 'use List::Util qw(sum); @cols = split /\s+/, <>; shift @cols; $total = sum(@cols); $steal = ($cols[7] / $total) * 100; printf("%0.5f%\n", $steal)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment