# Httpstat — Visualize curl Response Timing Statistics > Httpstat is a command-line tool that visualizes curl HTTP response timing, showing DNS lookup, TCP connection, TLS handshake, server processing, and transfer time in a clear breakdown. ## Install Save in your project root: # Httpstat — Visualize curl Response Timing Statistics ## Quick Use ```bash # Install via pip pip install httpstat # Or via Homebrew brew install httpstat # Analyze a URL httpstat https://example.com # Pass curl options after the URL httpstat https://api.example.com -X POST -d '{"key":"value"}' # Show response headers httpstat https://example.com -v ``` ## Introduction Httpstat wraps curl to display HTTP response timing in a visually intuitive format. Instead of parsing raw curl timing output, httpstat renders a color-coded waterfall showing each phase of the request — DNS lookup, TCP connection, TLS handshake, server processing, and content transfer — making it easy to identify latency bottlenecks. ## What Httpstat Does - Breaks down HTTP request timing into named phases with millisecond precision - Displays a color-coded visual chart of each connection phase in the terminal - Passes through all curl arguments so you can test any HTTP scenario (POST, headers, auth) - Shows response headers and status codes alongside timing data - Works with HTTPS to show TLS handshake time separately from TCP connection time ## Architecture Overview Httpstat is a single Python script (or Go binary in the Go port) that invokes curl with the `-w` (write-out) option to capture timing variables. It parses curl's timing output (time_namelookup, time_connect, time_appconnect, time_pretransfer, time_starttransfer, time_total) and renders them as a formatted waterfall diagram with ANSI colors in the terminal. ## Self-Hosting & Configuration - Zero configuration needed — it is a standalone script/binary with no dependencies beyond curl - Set `HTTPSTAT_SHOW_BODY=true` environment variable to display the response body - Set `HTTPSTAT_SHOW_SPEED=true` to include download/upload speed in the output - Use `HTTPSTAT_SAVE_BODY=true` to save response body to a temporary file for inspection - Custom curl binary path can be set via `HTTPSTAT_CURL_BIN` environment variable ## Key Features - Single-glance diagnosis of where HTTP latency originates (DNS, network, or server) - No configuration or setup beyond installation — works immediately with any URL - Full curl compatibility means any request type, header, or authentication method works - Available in multiple implementations: Python (original), Go, and Bash versions - Clean terminal output suitable for including in bug reports or documentation ## Comparison with Similar Tools - **curl -w** — provides raw timing numbers without visualization; httpstat adds the human-readable waterfall - **HTTPie** — focused on pretty request/response formatting without timing breakdown - **hey/bombardier** — load testing tools that measure aggregate latency; httpstat analyzes single requests in detail - **Chrome DevTools** — browser-based network timing; httpstat provides the same for CLI-based API testing ## FAQ **Q: Does httpstat make its own HTTP requests?** A: No. It wraps curl, so you get identical behavior to curl including all the same options and TLS handling. **Q: Can I use httpstat for POST requests or custom headers?** A: Yes. All arguments after the URL are passed directly to curl, so `-X POST`, `-H`, `-d`, etc. all work. **Q: Why does DNS show 0ms sometimes?** A: DNS resolution is cached by the OS. If you recently accessed the domain, the cached result is used instantly. **Q: Is there a Go version with no Python dependency?** A: Yes. The `go-httpstat` and `httpstat-go` projects provide compiled binaries that work without Python. ## Sources - https://github.com/reorx/httpstat - https://github.com/davecheney/httpstat --- Source: https://tokrepo.com/en/workflows/asset-28ae7267 Author: AI Open Source