Last active
March 28, 2019 10:09
-
-
Save asahasrabuddhe/90382443b911439c968e150b69401394 to your computer and use it in GitHub Desktop.
Run Sysbench Benchmark
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/sh | |
csv_file=`echo sysbench-output.log | sed s/\.log\.txt//` | |
csv_file=$csv_file.csv | |
echo $csv_file | |
echo "" >> ${csv_file} | |
echo "Threads, Total events, Time, Events per second" >> ${csv_file} | |
echo "" >> $csv_file | |
syslog_file_name=op.log | |
for ((i = 1; i <= $(nproc); i = i * 2)); do | |
sysbench --test=cpu --cpu-max-prime=20000 --num-threads=$i run > op.log | |
res_threads=(`cat $syslog_file_name | grep "Number of threads:" | sed "s/Number of threads: //"`) | |
res_total_events=(`cat $syslog_file_name | grep "total number of events:" | sed "s/total number of events: //"`) | |
res_total_time=(`cat $syslog_file_name | grep "total time:" | sed "s/total time: //"`) | |
res_events_per_second=(`cat $syslog_file_name | grep "events per second:" | sed "s/events per second: //"`) | |
echo "${res_threads},${res_total_events},${res_total_time},${res_events_per_second}" >> $csv_file | |
rm $syslog_file_name | |
done | |
echo "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment