-
-
Notifications
You must be signed in to change notification settings - Fork 956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http/2 timings #1958
Comments
My understanding is that, with I guess So I guess that to support the missing timings in http/2, the timer would have to be initialized before, to include the calling of the request function. But you probably have a way better understanding of it all than me anyway 😅 |
Good catch! One solution would be to set |
You mean to set these timestamps to be the same as |
Yep.
It isn't worth it since the sockets will be reused. |
Ah, you mean because of the http2-agent, the sockets (http2 sessions) will be reused between requests, so the timings would make sense only for the first request and the establishing of the session, not for the subsequent requests, right? But isn't it the same with http/1? The sockets are reused, and yet, the timings are populated as expected. At least for the first request, didn't check subsequent requests. |
Right.
It is, however you do not have sessions in HTTP/1. You can't tell the timings using a session. We would have to use a WeakMap in |
Hum, I had the understanding that there is a 1:1 mapping between HTTP2 Session and its underlying sockets (loosely caught from this part of the node documentation). But given TLS session can be resumed, I guess there might be several sockets associated with one session (but not two at the same time), right? Regarding the initial issue, if we can't have the timings from an HTTP/2 request, then I guess it would make more sense to me to leave them as Now, I would still like to get the timings from the http2 session, even if only for the first socket. But maybe the implementation of this feature would rather belong in |
This is correct.
A single TLS session can be used multiple times at once.
That would work as well.
That's rather not currently possible. const request = await http2.auto('https://example.com');
console.log(Boolean(request.socket)); // true we would do: const request = http2.auto('https://example.com');
console.log(Boolean(request.socket)); // false Making this feature |
Describe the bug
When issuing a request to an http/2 server, the response miss the
lookup
,connect
andsecureConnect
timings, which in turn prevents the computing of therequest
timing.I couldn't find any reference in the existing issues. If there is one I missed, feel free to link it and close this issue.
Code to reproduce
Here is a PR with a failing unit test reproducing the issue: #1957
Checklist
The text was updated successfully, but these errors were encountered: