Skip to content

Instantly share code, notes, and snippets.

@vinbarnes
Created January 7, 2017 16:01
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 vinbarnes/216a29631c26fae381c057f9b2ca3231 to your computer and use it in GitHub Desktop.
Save vinbarnes/216a29631c26fae381c057f9b2ca3231 to your computer and use it in GitHub Desktop.
#!/bin/bash
# to run:
# $ nohup mem_collector.sh &
while :
do
pids=( $(ps auxwww |egrep 'ruby|bundle' | awk '{print $2}') )
echo $(date) >> ruby_usage.log
ps -o pid,pcpu,pmem,rss,args ${pids[@]/#/-p } >> ruby_usage.log
sleep 300
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment