Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [[ $# -lt 1 ]];
- then echo "You need to pass a url!"
- echo "Usage:"
- echo "$0 {url}"
- exit
- fi
- URL=$1
- for i in {1..1000}
- do
- #curl -s -o /dev/null -w "%{time_total}\n" $URL
- curl -s -o /dev/null -w "%{time_total}\n" -H "Pragma: no-cache" $URL
- done | awk '{ sum += $1; n++; print ","$1; } END { if(n > 0) print "average,=sum(B1:B"n")/count(B1:B"n")"; print "median,=median(B1:B"n")"; print "mode,=mode(B1:B"n")"; print "max,=max(B1:B"n")"; print "min,=min(B1:B"n")"; }'
Add Comment
Please, Sign In to add comment