Skip to content

FR: Resource-Timing-style per-request timing breakdown #52

Description

@passcod

🤖 Browsers expose per-request phase timings (DNS / connect / TLS / TTFB / download) via Resource Timing. For a server-side client this is observability gold, and fáith already has the stats/conn-tracker scaffolding to hang it on.

The constraint is what reqwest exposes: total time, connection reuse, and remote address are easy; phase boundaries (DNS vs connect vs TLS) are not, without upstream hooks. Even the partial version is most of the practical value:

response.timing = {
  start,        // request accepted
  sent,         // request handed to the connection
  firstByte,    // response headers received
  end,          // body fully consumed (settled late, like trailers)
  reusedConnection: bool,
  protocol: "HTTP/2.0",
}

Middleware-level timestamps get start/firstByte; body-stream completion gets end. Worth designing the shape against the PerformanceResourceTiming names where they map, so it feels familiar.

The per-protocol path-time EWMA from #45's follow-on records origin-level aggregates of the same measurements — the two should share the instrumentation point.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions