Last active
March 11, 2016 12:59
-
-
Save sirkkalap/3b3523097a4e95c408e3 to your computer and use it in GitHub Desktop.
Take response times of a site at given interval
This file contains hidden or 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 | |
| # Adopted from https://josephscott.org/archives/2011/10/timing-details-with-curl/ | |
| # | |
| url=${1:?usage "[nohup] curl-times.sh <url> [ <sleep=1> ]"} | |
| sleep=${2:-1} | |
| format=" time_namelookup: %{time_namelookup} time_connect: %{time_connect}, time_appconnect: %{time_appconnect}, time_pretransfer: %{time_pretransfer}, time_redirect: %{time_redirect}, time_starttransfer: %{time_starttransfer}, time_total: %{time_total}\n" | |
| while true; do | |
| echo -n $(date +%FT%T%z) | |
| curl -w "${format}" -o /dev/null -s "$url" | |
| sleep $sleep | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment