Created
May 8, 2017 17:19
-
-
Save dannycroft/d1ee14d4ca345a52a67243a97127e7ea to your computer and use it in GitHub Desktop.
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 | |
| # ./ttfb https://www.google.com ~/your-log-file.txt | |
| function ttfb() { | |
| curl -o /dev/null \ | |
| -H 'Cache-Control: no-cache' \ | |
| -s \ | |
| -w "%{time_connect} %{time_starttransfer} %{time_total}" \ | |
| $1 | |
| } | |
| echo $(date "+%Y-%m-%d %H:%M:%S") $1 $(ttfb $1) | tr '\n' ' ' | sed 's/$//g' >> $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment