What's a good way to measure different phases of HTTP request timings in Rust?

For example: https://blog.risingstack.com/measuring-http-timings-node-js/

I am interested in measuring:

  • DNS resolution (if any)
  • Connection establishment
  • TLS stuff (if any)
  • Time to first byte


I am hoping to find something that works with existing well-tested HTTP crates (reqwest/hyper etc) rather than rolling one out myself.

Thanks in advance!

I don't think the standard http libraries provide this directly, but you could probably download their source and add various things to measure them without too much work.

As for time to first byte, you might be able to use something like this.