Skip to content

Instantly share code, notes, and snippets.

@johnelliott
Last active September 19, 2023 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save johnelliott/00107aa2eb8cf804e1cb to your computer and use it in GitHub Desktop.
Save johnelliott/00107aa2eb8cf804e1cb to your computer and use it in GitHub Desktop.
http speed test with curl

cUrl speed test

Use

load up some urls into urls.txt

http://google.com/api/endpoint/1
http://google.com/api/other-endpoint/2

Run shell command:

	<urls.txt cat|xargs -n 1 ./curl-speed-test.sh

Send to pbcopy or file

\n
%{url_effective}\n
time_total: %{time_total}\n
----------------------------\n
time_pretransfer: %{time_pretransfer}\n
time_starttransfer: %{time_starttransfer}\n
size_header: %{size_header} bytes\n
size_download: %{size_download} bytes\n
\n
# from https://josephscott.org/archives/2011/10/timing-details-with-curl/
# and http://overloaded.io/timing-http-requests-curl
curl -w "@curl-format.txt" -s -o /dev/null $1
https://wikipedia.org/
https://www.w3.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment