/server-timing-sparklines

Scripts to visualize server-timing headers

Primary LanguageShell

Server Sparklines

Visualize ttfb + server-timing headers as sparklines

Depends

  • Curl
  • Python 3
  • Termgraph

Install

git clone git@github.com:springmeyer/server-timing-sparklines.git
cd server-timing-sparklines
pip install -r requirements.txt
./viz -h

Usage

The viz command accepts a single argument of a URL to download

The viz command outputs:

  • The curl client timing for DNS lookup, TLS handshake, and Time To First Byte.
  • The Server-Timing headers provided by the backend
  • The overall time it took to initiate the request and download the response

Optionally pass viz --loop [url] to repeat the request in a loop indefinetly (ctrl-c to exit). This can be valuable to watch how the timing results change as you might put load on the backend load testing.

Example:

$ ./viz https://www.bbc.co.uk/iplayer

client:dns-lookup   : ▇▇▇▇▇▇▇▇▇ 515.02
client:tls-handshake: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1249.60
client:ttfb         : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1786.07
data                : ▇ 99.34
markup              : ▇ 78.96
total               : ▇▇▇ 186.41
overall             : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 2611.00

See also