Created
September 16, 2014 16:04
-
-
Save zimmerle/1a6c5ab851c496fc13fe to your computer and use it in GitHub Desktop.
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 | |
HOST="127.0.0.1" | |
PORT=80 | |
declare -a file_size=(1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765); | |
declare -a threads=('10' '20' '30' '50' '80' '100'); | |
for s in "${file_size[@]}" | |
do | |
for t in "${threads[@]}" | |
do | |
if [ "$1" == "test" ]; then | |
if [ $headers ]; then | |
./wrk -c $t -t $t -s scripts/detailed-summary.lua http://$HOST:$PORT/test/${s}k.html | |
else | |
./wrk -c $t -t $t -s scripts/detailed-summary.lua http://$HOST:$PORT/test/${s}k.html -- headers | |
headers=1 | |
fi | |
elif [ "$1" == "table" ]; then | |
if [ $headers ]; then | |
echo "$t,$t,${s}" | |
else | |
echo "Threads, Connections, Content Size (kB)" | |
echo "$t,$t,${s}" | |
headers=1 | |
fi | |
fi | |
done | |
if [ "$1" == "generate" ]; then | |
base64 /dev/random | head -c `echo ${s}*1024 | bc` > ${s}k.html | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment