diff options
| author | mo khan <mo@mokhan.ca> | 2015-12-25 21:00:18 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-12-25 21:00:18 -0700 |
| commit | 0cfe0f32b4b88d791510fed296e378b935266ffb (patch) | |
| tree | 02aaf225c4fa9ebfaeb55ddfcbf71313422bd627 /bin | |
| parent | 241cae9aefeda0008180756aa13b4704f6806ff5 (diff) | |
add apache bench script for prod.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/perf | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/perf b/bin/perf new file mode 100755 index 0000000..e55355d --- /dev/null +++ b/bin/perf @@ -0,0 +1,28 @@ +#!/bin/bash + +ENDPOINT="https://www.stronglifters.com/" +REQUEST_COUNT="1000" +THREAD_COUNT="10" +FILENAME="$REQUEST_COUNT.$THREAD_COUNT.$(date +%s)" + +mkdir -p tmp/data +ab -n $REQUEST_COUNT \ + -c $THREAD_COUNT \ + -g "tmp/data/$FILENAME.dat" \ + -s 600 \ + $ENDPOINT + +mkdir -p tmp/graphs +gnuplot << EOF + # output as png image + set terminal png + set output "tmp/graphs/$FILENAME.png" + set title "$REQUEST_COUNT requests on $THREAD_COUNT thread(s)" + set size 1,0.7 + set grid y + set xlabel "Request" + set ylabel "Total time (ms)" + plot "tmp/data/$FILENAME.dat" using 9 smooth frequency with lines title "frequency" +EOF + +echo "\nResults are in tmp/graphs/$FILENAME.png\n" |
