Last active
October 27, 2016 12:09
-
-
Save Perlence/671e0f561d96c422701daef23c835cb8 to your computer and use it in GitHub Desktop.
Log memory usage and average load each 5 seconds
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
free -s 5 | stdbuf -o0 awk '/^Mem/ {mem = $3}; /buffers\/cache/ {buffers = $3}; /^Swap/ {swap = $3; print mem ";" buffers ";" swap}' > free.log & | |
fish -c 'while true; cat /proc/loadavg; sleep 5s; end' | stdbuf -o0 awk '{print $1}' > loadavg.log & | |
program | |
kill %1 %2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment