-
Notifications
You must be signed in to change notification settings - Fork 6
/
aggregate-results
executable file
·48 lines (37 loc) · 1.03 KB
/
aggregate-results
1
#!/bin/bashset -uusage(){cat << EOFusage: $0 optionsThis script looks for result directories (results-0, result-1, result-2, etc) created by run-sysbench and aggregates their output into a CSV which is sent to stdout.OPTIONS: -r Directory containing results [./results]EOF}resultsdir=./resultswhile getopts r: namedo case $name in r) resultsdir="$OPTARG";; ?) usage exit;; esacdoneprintf "result,threads,transactions,trns p/s,deadlocks,dls p/s,read/write requests,r/w reqs p/s,min,avg,max,99 percentile \n"for result in $( ls -rt $resultsdir | grep result\- | tr "\n" " " ); do cat $resultsdir/$result/sysbench.* | \ egrep " cat|threads:|transactions:|deadlocks|read/write|min:|avg:|max:|percentile:" | \ gsed '1 s/Number of threads: //' | \ tr -d "\n" | \ gsed -e 's/Number of threads: /\n/g' \ -e 's/[A-Za-z\/]\{1,\}://g' \ -e 's/read\/write//g' \ -e 's/approx\. 99//g' \ -e 's/per sec.)//g' \ -e 's/ms//g' \ -e 's/(//g' \ -e 's/ */,/g' | \ gawk -v d=$result '{$0=d","$0}1' done