Skip to content

Add request/response timing breakdown #14

@kavix

Description

@kavix

Description

kurl shows total request time, but doesn't break down DNS lookup, connection, TLS handshake, time to first byte, etc.

Proposed Implementation

kurl https://api.example.com --timing

Output:

Timing:
  DNS Lookup:     45ms
  TCP Connection: 30ms
  TLS Handshake:  120ms
  Server Processing: 200ms
  Content Transfer: 15ms
  Total:          410ms

Why this matters

Performance debugging requires knowing where time is spent. curl has this via --write-out, kurl should make it prettier.

Acceptance Criteria

  • Add --timing flag
  • Measure and display DNS, TCP, TLS, TTFB, transfer phases
  • Use Go's httptrace package for accurate measurements
  • Format output cleanly aligned
  • Add test coverage

Getting Started

Go's net/http/httptrace package provides callbacks for each phase. Wrap the transport and collect timestamps.


Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions