Last active
August 29, 2015 14:24
-
-
Save phiros/1b3521a833394a984d97 to your computer and use it in GitHub Desktop.
Simple benchmark script using sysstat programs (monitors memory, io and cpu core usage)
This file contains 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 | |
mkdir -p ~/log | |
LOGINTERVAL=$1 | |
PROGRAM=$2 | |
mpstat -P ALL $LOGINTERVAL > ~/log/mpstat.log 2>/dev/null & | |
MPSTAT_PID=$! | |
iostat sda $LOGINTERVAL > ~/log/iostat.log 2>/dev/null & | |
IOSTAT_PID=$! | |
sar -r $LOGINTERVAL > ~/log/memory.log 2>/dev/null & | |
SAR_PID=$! | |
sleep 60 | |
eval $PROGRAM | |
sleep 60 | |
kill $MPSTAT_PID | |
kill $IOSTAT_PID | |
kill $SAR_PID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment