Getting connection speed metrics from curl



Published: 2017-07-19 11:45:21 +0000
Categories: BASH,

Language

BASH

Description

The command gets curl to request a page and then write out a CSV delimited line giving details of the time it took to complete various stages of the request, including how many redirects were followed etc.

Snippet

curl -o /dev/null -w "%{http_code},\"$URL\",\"%{url_effective}\",%{time_total},%{time_namelookup},%{time_connect},%{time_redirect},%{time_starttransfer},%{size_download},%{size_request}\n" $URL

Usage Example

URL="https://www.google.com"
curl -o /dev/null -w "%{http_code},\"$URL\",\"%{url_effective}\",%{time_total},%{time_namelookup},%{time_connect},%{time_redirect},%{time_starttransfer},%{size_download},%{size_request}\n" $URL

Video Example

Keywords

curl, speed, page, request, ttfb, metrics,

Latest Posts


Copyright © 2022 Ben Tasker | Sitemap | Privacy Policy
Available at snippets.bentasker.co.uk, http://phecoopwm6x7azx26ctuqcp6673bbqkrqfeoiz2wwk36sady5tqbdpqd.onion and http://snippets.bentasker.i2p
hit counter