Skip to content

Instantly share code, notes, and snippets.

@elmariofredo
Last active October 4, 2017 12:34
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 elmariofredo/01f0f9818925a42ccfc03ff8adc5d6d0 to your computer and use it in GitHub Desktop.
Save elmariofredo/01f0f9818925a42ccfc03ff8adc5d6d0 to your computer and use it in GitHub Desktop.
Simple http throughput test using curl
#!/bin/bash
URL=$1
NAME=${URL:7}
echo "Press [CTRL+C] to stop..."
while :
do
echo $(date +%s) $(curl --max-time 10 -w "%{time_connect} %{time_starttransfer} %{time_total} %{http_code}" -o NUL -s "${URL}") | tee -a ${NAME}.log.txt
sleep 3
done
#!/bin/sh
gnuplot -e "set terminal svg;set xdata time;set timefmt '%s';set format x '%m/%d/%Y %H:%M:%S';set xtics rotate by 90 offset 0,-6;set bmargin 10;set output 'plot.svg';plot 'github.com.log.txt' using 1:4 with lines"
#!/bin/sh
screen -S github -d -m ./measure.sh http://github.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment