Replies: 1 comment 6 replies
-
If you're trying to determine the time it takes to process a request before it is given over to the handler: |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was looking at the available hooks that fastify provides but it is not clear to me what hook should be used to measure the request network latency, i.e. when request is received and the request body is fully streamed already.
As per my current understanding the onRequest (or alternatively the preParsing) hook should be the ones to use for this. As based on preParsing docs you can modify the request payload stream in that hook which means it should be already streamed, or at least that's what I would expect.
For example looking at these logs
The time between onRequest and preValidation (about 3.5 seconds) is only related to Parsing (request lifecycle) and not network latency or the body being streamed.
Beta Was this translation helpful? Give feedback.
All reactions