So I have this dropwizard application with all of the standard config yaml stuff like:
server:
maxQueuedRequests: 256
maxThreads: 256
I'd like to instrument this thread info. I.e. I'd like to know how many requests are queued and how many threads are dedicated to serving requests. Are these metrics automatically pushed or do I need to addd some custom metrics? If I need to add some custom metrics, how do I get access to the thread pool and the request queue?
BTW, I'm using DW 1.3.18.
Thanks!
I figured out a good approach. The thread pool is available in org.eclipse.jetty.server.Server and you can get that from io.dropwizard.setup.Environment in Kotlin like so:
Note that the ThreadPool in Jetty isn't necessarily a QueuedThread pool, but in DropWizard it is-hence the cast. I hope that helps anyone else with this quandary.