You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to use middleware to measure the request time of openapi-fetch client requests - what's a good way to achieve this? The objects available in openapi-fetch middleware don't appear to include request time.
One approach I've considered is attaching the request start time to the Request object when onRequest is triggered, and then calculating the request time in the onResponse hook e.g.
Activity
duncanbeevers commentedon Jan 23, 2025
You can track flight times outside of the middleware.
I haven't tried this at run-time, but I think a simple Map may do the trick, without affecting any of the middleware signatures.