Skip to content

Instantly share code, notes, and snippets.

@fredngo
Created April 26, 2013 15:54
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 fredngo/5468325 to your computer and use it in GitHub Desktop.
Save fredngo/5468325 to your computer and use it in GitHub Desktop.
Bash script that outputs the number of threads used by all processes belonging to the 'vagrant' user.
while true
do
# Command line inspired from http://askubuntu.com/a/88983
ps -u vagrant -o thcount | tail -n +2 | awk '{ num_threads += $1 } END { print num_threads }'
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment