Skip to content

Instantly share code, notes, and snippets.

@Genzer
Last active July 1, 2024 07:28
Show Gist options
  • Save Genzer/e9531b02265e44dc6f6e8a3916232057 to your computer and use it in GitHub Desktop.
Save Genzer/e9531b02265e44dc6f6e8a3916232057 to your computer and use it in GitHub Desktop.
#!/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