I've created a Tornado service using HTTPServer, where each request triggers an HTTPClient call to another more time-consuming service. When running the service as a single process and making concurrent requests, later requests wait for earlier ones to complete before they are processed.
I've reviewed the RequestHandler source code and noticed that the request_time function only measures the duration from the start of processing (initialization) to the end of the request, which doesn't include time spent waiting in the queue.
I would like to obtain the actual time each request spends in the queue before it starts being processed, as well as the total time (queue time + processing time) it takes to complete each request. This information would allow for more accurate request analysis.
Is there currently a way to obtain the queue time or the time when each request first arrives at the server?
Description:
I've created a Tornado service using
HTTPServer
, where each request triggers anHTTPClient
call to another more time-consuming service. When running the service as a single process and making concurrent requests, later requests wait for earlier ones to complete before they are processed.I've reviewed the
RequestHandler
source code and noticed that therequest_time
function only measures the duration from the start of processing (initialization) to the end of the request, which doesn't include time spent waiting in the queue.I would like to obtain the actual time each request spends in the queue before it starts being processed, as well as the total time (queue time + processing time) it takes to complete each request. This information would allow for more accurate request analysis.
Is there currently a way to obtain the queue time or the time when each request first arrives at the server?