Skip to content

Instantly share code, notes, and snippets.

@mgor

mgor/bash

Created May 8, 2017
Embed
What would you like to do?
cURL measurements as json
↳ cat curl-format.txt
{\n
"time_namelookup": %{time_namelookup},\n
"time_connect": %{time_connect},\n
"time_appconnect": %{time_appconnect},\n
"time_pretransfer": %{time_pretransfer},\n
"time_redirect": %{time_redirect},\n
"time_starttransfer": %{time_starttransfer},\n
"time_total": %{time_total}\n
}\n
↳ LC_NUMERIC="en_US-UTF-8" curl -w "@curl-format.txt" -o /dev/null -s "https://www.github.com"
{
"time_namelookup": 0.060,
"time_connect": 0.178,
"time_appconnect": 0.639,
"time_pretransfer": 0.639,
"time_redirect": 0.000,
"time_starttransfer": 0.756,
"time_total": 0.756
}
@mgor

This comment has been minimized.

Copy link
Owner Author

@mgor mgor commented May 8, 2017

Oneliner:

LC_NUMERIC="en_US-UTF-8" curl -w '{"time_appconnect": %{time_namelookup}, "time_connect": %{time_connect}, "time_appconnect": %{time_appconnect}, "time_pretransfer": %{time_pretransfer}, "time_redirect": %{time_redirect}, "time_starttransfer": %{time_starttransfer}, "time_total": %{time_total}}' -o /dev/null -s "https://www.github.com" | python -m json.tool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.