Created
July 29, 2017 02:17
-
-
Save kevindees/a24dd20d81e974e2a72cbf03c2550c80 to your computer and use it in GitHub Desktop.
Measuring the average website response time with cURL http://cacodaemon.de/index.php?id=11
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 | |
URL="$1" | |
MAX_RUNS="$2" | |
SUM_TIME="0" | |
i="0" | |
while [ $i -lt $MAX_RUNS ]; do | |
TIME=`curl $URL -o /dev/null -s -w %{time_total}` | |
TIME="${TIME/,/.}" | |
SUM_TIME=`echo "scale=5; $TIME + $SUM_TIME" | bc` | |
i=$[$i+1] | |
done | |
TIME_AVERAGE=`echo "scale=5; $SUM_TIME / $MAX_RUNS" | bc` | |
echo "Sum: $SUM_TIME" | |
echo "Avg: $TIME_AVERAGE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./web_test.sh http://localhost 300