Skip to content

Instantly share code, notes, and snippets.

@AdamMagaluk
Last active August 29, 2015 13:57
Show Gist options
  • Save AdamMagaluk/9765737 to your computer and use it in GitHub Desktop.
Save AdamMagaluk/9765737 to your computer and use it in GitHub Desktop.
#!/bin/bash
#ps -p `pidof node` -opid -opcpu -orss -ovsz | tail -1 > node.log
START_DATE=`date -u +%s`
PIDS=$1
LOG_FILE=$2
while [ 1 ]
do
NOW=`date -u +%s`
LINE=`ps -p $PIDS -opid -opcpu -orss -ovsz | tail -1`
echo "$NOW $LINE" >> $LOG_FILE
sleep 1
done
@AdamMagaluk
Copy link
Author

Usage: ./memlog

@AdamMagaluk
Copy link
Author

kst2 out.dat --ylabel rss -y 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment