Skip to content

Instantly share code, notes, and snippets.

@atiti
Created March 28, 2017 13:38
Show Gist options
  • Save atiti/2185884d71ddba8a050a30074676de2f to your computer and use it in GitHub Desktop.
Save atiti/2185884d71ddba8a050a30074676de2f to your computer and use it in GitHub Desktop.
Measure CPU and Mem usage of a process
#!/bin/bash
PID=$1
while [ 1 ]; do
ps -q $PID -eo %cpu,%mem |tail -n1 >> process.log
sleep 0.1;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment