Created
November 2, 2010 18:03
-
-
Save RichardBronosky/660024 to your computer and use it in GitHub Desktop.
Test load times for the raw HTML of your web app.
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
# define the URL below | |
url='' | |
# define the headers to use for logged in user below | |
# copy these verbatim out of your browser debug tools Request Headers section | |
read -d '' headers <<'EOF' | |
Accept:application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | |
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 | |
Accept-Encoding:gzip,deflate,sdch | |
Accept-Language:en-US,en;q=0.8 | |
Cookie:__session=34b0ab3c52f6d40dbd31b59b32c780b7 | |
User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.11 (KHTML, like Gecko) Chrome/9.0.570.0 Safari/534.11 | |
EOF | |
# build proper curl header arguments | |
while read header; do | |
headers_array[${#headers_array[*]}]="--header" | |
headers_array[${#headers_array[*]}]="$header" | |
done <<< "$headers" | |
# Ctrl-C should exit the script, not simply break the for/while loop | |
trap "exit" INT | |
echo "Ctrl-c to quit" | |
while true; do | |
echo Logged Out: | |
{ time { trap "exit" INT; curl -s $url > /dev/null; } } 2>&1 | awk '/real/ {print $2}' | |
echo Logged Out /w cache buster: | |
{ time { trap "exit" INT; curl -s $url?$RANDOM > /dev/null; } } 2>&1 | awk '/real/ {print $2}' | |
echo Logged In: | |
{ time { trap "exit" INT; curl -s "${headers_array[@]}" $url | grep -q 'Member Center.*Sign Out' || echo 'signin spoof failure'; } } 2>&1 | awk '/real/ {print $2}' | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment