~kris/dots

srice

ref: 9f828eb14bdd54d2c4fd8a3b2c90253021df3152 srice/.local/bin/httptime -rwxr-xr-x 439 bytes
9f828eb1 — Kris Yotam mksh: backslash-escape commands in history hook to bypass module aliases (wc=tokei, tr=transmission-remote, cat=bat) 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# httptime -- show HTTP response timing breakdown
set -eu

if [ -z "${1:-}" ]; then
    echo "Usage: httptime <url>" >&2
    exit 1
fi

curl -o /dev/null -s -w "
  DNS:        %{time_namelookup}s
  Connect:    %{time_connect}s
  TLS:        %{time_appconnect}s
  TTFB:       %{time_starttransfer}s
  Total:      %{time_total}s
  Size:       %{size_download} bytes
  Status:     %{http_code}
  Redirects:  %{num_redirects}
" "$1"