Is it possible to detect when an HTTP/1.1 request is being sent on an existing connection versus opening a new connection? #3139
-
Is it possible to detect when an HTTP/1.1 request is being sent on an existing connection versus opening a new connection? I'm interested in monitoring some latency numbers for an HTTP client that I have, and I want to compare the latencies for new connections versus existing connections. |
Beta Was this translation helpful? Give feedback.
Answered by
seanmonstar
Feb 2, 2023
Replies: 1 comment 2 replies
-
Assuming you are referring to v0.14.x, and the pooling
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
declanvk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assuming you are referring to v0.14.x, and the pooling
hyper::Client
, then: perhaps a couple things that likely will be different in 1.0.tracing
, you could look at the events hyper outputs. I believe it has different messages for re-using a connection versus establishing a new one. Those messages are not part of a stable API, though. As in, they could conceivably be changed in new versions to make the wording clearer, or something.HttpConnector
(or a TLS connector that wraps it), you could probably check the HttpInfo on theResponse
and peek at the local addr to see if the port is new. But then again, once a socket is closed and the kernel's CLOSE_WAIT time has…