Last active
April 27, 2016 06:32
-
-
Save gotev/2db148a8b224d488cf4300a242bb3a78 to your computer and use it in GitHub Desktop.
Measure website performance
This file contains 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 | |
if [ "x$1" == "x" ] | |
then | |
echo "Usage: ./website-performance.sh <website_to_check>" | |
exit 1 | |
fi | |
TEMPFILE=$(mktemp) | |
cat <<EOF > $TEMPFILE | |
time_namelookup: %{time_namelookup}\n | |
time_connect: %{time_connect}\n | |
time_appconnect: %{time_appconnect}\n | |
time_pretransfer: %{time_pretransfer}\n | |
time_redirect: %{time_redirect}\n | |
time_starttransfer: %{time_starttransfer}\n | |
----------\n | |
time_total: %{time_total}\n | |
EOF | |
curl -w "@$TEMPFILE" -o /dev/null -s "$1" | |
rm -rf $TEMPFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Website performance
Measures the performance of a particular web site or web page. Runs on UNIX systems and requires only curl. Just copy and paste it and make it runnable. The idea was taken from this StackOverflow question
Example output:
To install it on your box, just copy and paste this on your terminal and enter the password when prompted: