-
-
Save bosky101/10227730 to your computer and use it in GitHub Desktop.
benchmark a bunch of urls with POST and plot them in the same graph as points
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 | |
echo -e "\nbenchmark.sh <title> -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..." | |
echo -e "\nEx: benchmark.sh example -n100 -c10 http://www.google.com/ http://www.bing.com/ will create benchmar-example-n100-c10.png\n" | |
## Gnuplot settings | |
echo "set terminal png | |
set output 'benchmark-${1}${2}${3}.png' | |
set title 'Benchmark: ${1} with ab ${2} ${3}' | |
set size 1,1 | |
set grid y | |
set xlabel 'requests' | |
set ylabel 'response time (ms)' " > /tmp/plotme | |
## Loop over parameters | |
c=1 | |
for var in "$@" | |
do | |
## skipping first parameters (concurrency and requests) | |
if [ $c -gt 3 ] | |
then | |
## apache-bench | |
ab $2 $3 -p post.json -g "gnuplot_${c}.out" "${var}" | |
## if for concat stuff | |
if [ $c -gt 4 ] | |
then | |
echo -e ", 'gnuplot_${c}.out' using 9 smooth sbezier with points title '${var}' \\" >> /tmp/plotme | |
else | |
echo -e "plot 'gnuplot_${c}.out' using 9 smooth sbezier with points title '${var}' \\" >> /tmp/plotme | |
fi | |
fi | |
let c++ | |
done | |
## plotting | |
gnuplot /tmp/plotme | |
echo -e "\n Success! Result image is: benchmark-${1}${2}${3}.png" |
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
event={ | |
"xx" : "xxxxxx", | |
"yy" : "xxxxxx", | |
"z" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | |
"a" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | |
"bb" : "xxx", | |
"c" : "xxx", | |
"d" : "xxxxx" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment