Created
August 6, 2018 09:15
-
-
Save jokester/21ae4b23d6ff4f040509b7c13f774705 to your computer and use it in GitHub Desktop.
Test speed with curl
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
#!/usr/bin/env bash | |
set -u | |
if [[ 0 -eq "$#" ]]; then | |
echo "Test ttfb and stuff of GET request" | |
echo " USAGE: $0 URL+" | |
exit 1 | |
fi | |
for url in "$@"; do | |
curl -o /dev/null \ | |
-H 'Cache-Control: no-cache' \ | |
-vv -s --compressed \ | |
-w " | |
URL: %{url_effective} | |
DNS lookup: %{time_namelookup} | Connect: %{time_connect} | TTFB: %{time_starttransfer} | Total time: %{time_total} | Avg Speed: %{speed_download} B/s | |
" \ | |
"$url" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment