Hey Mark, Thank you for your response. I've actually developed it on my own Spring Boot Application to scrape these metrics, but it involves subclassing TaskQueue (in order to overwrite the offer() method and track the start/end time), and utilising this subclassed queue when constructing my ExecutorService - am not sure if this might be too specialized to be pushed out to the community.
Was wondering if you have any thoughts on how this feature could be implemented? We could go through the pseudocode based on what I've developed too if it helps. Cheers, Andy On Thu, Nov 28, 2024 at 7:57 PM Mark Thomas <ma...@apache.org> wrote: > On 28/11/2024 09:26, Owner wrote: > > Hi Tomcat Devs, > > > > Hope you guys are having a great day. I'm a new developer to this area so > > do let me know if I have any misconceptions or errors in my thinking. > > > > I am currently using Tomcat as an embedded web server within a Spring > Boot > > Application, and I utilise Micrometer to expose Tomcat metrics, such as > > tomcat_servlet_request_seconds. > > > > I was thinking if it'd be useful to include a metric that tracks the > > latency experienced in terms of time spent in the Tomcat queue. I > > understand that each request is added to a TaskQueue (default > > implementation) by the poller thread, and the internal executor service > > created will assign a thread to each task. However, the current metrics > > only track the time after polling from the queue, and passed down through > > filters etc to the dispatcher servlet. (tomcat_servlet_request_seconds). > > > > In reality, I understand the total delay experienced by the client should > > include the time spent in the queue as well, since there could be a case > > where there are no available threads to service incoming requests. > > > > Would this metric serve a good use case? Or are there already similar > > metrics out there? I'm currently on Tomcat 9.0.63 if that helps. > > Sounds useful to me. I'd certainly look at any proposed patch. Whether > it gets merged will depend on various factors (complexity, performance, > etc). > > Mark > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > >