Last active
July 1, 2024 07:28
-
-
Save Genzer/e9531b02265e44dc6f6e8a3916232057 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
set -e -u -o pipefail | |
# Send, in sequential order, 10 requests and prints only the HTTP Status Code and the total time of the request | |
# with a Connnection Time Out in 5 seconds. | |
URL="$1" | |
{ | |
for _ in {1..10}; | |
do | |
curl \ | |
-s \ | |
--url "${URL}" \ | |
--connect-timeout 5 \ | |
-L \ | |
-w '%{http_code} - %{time_total}\n' \ | |
-o /dev/null | |
done | |
} | |
# | tee | uniq -c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment