Guest User

Untitled

a guest
Feb 25th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [[ $# -lt 1 ]];
  4. then echo "You need to pass a url!"
  5. echo "Usage:"
  6. echo "$0 {url}"
  7. exit
  8. fi
  9.  
  10. URL=$1
  11.  
  12. for i in {1..1000}
  13. do
  14. #curl -s -o /dev/null -w "%{time_total}\n" $URL
  15. curl -s -o /dev/null -w "%{time_total}\n" -H "Pragma: no-cache" $URL
  16. 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