Last active
December 14, 2015 19:19
-
-
Save joshuakfarrar/5135525 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 | |
# How does this look? | |
# ./script.sh -u zipp -o results -f "index.php test.php crap.php" | |
while getopts u:o:f: option | |
do | |
case "${option}" | |
in | |
u) USER=${OPTARG};; | |
o) OUTDIR=${OPTARG};; | |
f) FILES=${OPTARG};; | |
esac | |
done | |
for FILE in "$FILES" | |
do | |
if [ ! -f $OUTDIR/$FILE.perf.html]; | |
touch $OUTDIR/$FILE.perf.html | |
if [$? == 1]; then | |
echo 'Cannot create a file at the set pach. Check file permissions or setsudo bit ' | |
exit | |
fi | |
fi | |
for i in 1 2 4 8 16 20 30 40 | |
do | |
ab -A "$USER" -w -n 1000 -c $i $FILE >> $OUTDIR/$FILE.perf.html | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment