Created
March 28, 2017 13:38
-
-
Save atiti/2185884d71ddba8a050a30074676de2f to your computer and use it in GitHub Desktop.
Measure CPU and Mem usage of a process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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