Skip to content

Instantly share code, notes, and snippets.

@octagonal
Created June 1, 2014 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save octagonal/b45d4d2d9f226f7be3e4 to your computer and use it in GitHub Desktop.
Save octagonal/b45d4d2d9f226f7be3e4 to your computer and use it in GitHub Desktop.
Simple webserver speed measuring
#!/usr/bin/bash
# $1 => filename to write to
# $2 => URL to fetch
# $3 => Amount of time in-between measurements
while true; do
echo -n $(date +%H:%M:%S) | tee -a $1; echo -n ";" | tee -a $1;
echo -n $(curl -o /dev/null -s -w "%{time_total}" $2 |sed "s/\./,/") | tee -a $1; echo "" | tee -a $1;
sleep $3;
done
# This will give you a simple way to look at the connection speed of a specific URL over time
# It writes valid csv files so you can get graphs out of the file using Excel or whatever (area charts seem to work best)
# No, this is not scientifically accurate
# No, this is not a substitute for actual measurement software
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment