-
Notifications
You must be signed in to change notification settings - Fork 9.1k
displayRequestDuration not working as expected #7243
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
Comments
I can confirm this too. |
I can also confirm ms values here can easily be double or triple the actual request time. I've been comparing the Chrome Dev Tools Network tab ms #s, and using postman. Often get swaggerUI reporting massively inflated ms #'s. N.B. I do generally see much closer reported duration when I set With .net and swashbuckle: |
This issue has to do with the optimization of the app. We look at the network, the machine that it's being run on and also the browser. I am currently using Linux Mint, my browser is Firefox version 137.0 and my internet connection speed is at 51%. After setting displayRequestDuration to true and run the app, I got response time of less than 1000ms for different requests which is much better. |
Hi everybody,
When turned on, the indicator does compute the total time needed to build a request from OpenAPI spec, issue the actual HTTP request and serialize the response. Which means that the time needed to issue an actual request and receive a response is just part of that number. If actual HTTP request/response time is needed then the closes approximation to that would be to use request and response interceptors to measure it (but that would also include the response serialization which might be significant number depending of payload size). So to remedy this, we would need to do a change probably here to get a pure network request/response time and attach it to a response object. PR for swagger-client is welcome. When we have the swagger-client change we can use the |
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Swagger-UI configuration options:
Query string options
Describe the bug you're encountering
after adding
displayRequestduration
to swagger query parameters:displayRequestDuration=true
as per above, I can see request duration, however time shown is far from what other means of measurements calculated.The request duration is not correctly calculated.
To reproduce...
Steps to reproduce the behavior:
displayRequestDuration=true
already appended in query parameters.Try it out
on/books/list/all
endpoint.Expected behavior
I expect time to be at least similar (not 4 or 5 times higher) to the time shown by Postman or CURL.
Screenshots
Swagger



Postman
In-application metrics
Additional context or thoughts
Maybe the time that I see is, somehow, correct? If so, please let me know how should I interpret it.
The text was updated successfully, but these errors were encountered: