-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Injecting response times into view templates #9
Comments
So you cannot access the response time until you've actually responded. I can add an API so you can access the "total elapsed time since the request arrived" which will be sort of like a response time. Would that work? |
I'm not sure I would know until I saw it in action. Maybe I should leverage https://developer.mozilla.org/en-US/docs/Navigation_timing on the client instead, but I don't know if that's battling the same race condition. |
We could have this module attach a function to the It may also be useful to know that since this module normally does response time, and response time is not actually available to your code until you actually... respond, then there is a work-around with the existing code: build all your response headers and explicitly |
Yeah, we can try |
Hi @berkantipek yes, that won't work, which is why this issue is open. The function is called after your view has already been rendered (because rendering the view takes time, which contributes to the response time... you don't know the response time until after you have performed all actions involved in responding, including rendering your view). |
Reminder: https://stackoverflow.com/questions/30019235/how-to-access-all-response-times-on-every-route-in-express-4/30029024#30029024
Thanks @dougwilson.
The text was updated successfully, but these errors were encountered: