I have a pretty complex piece of software that is heavily utilizing multi-threading to compute financial tick feeds and near the end of my market session, my thread pool queue starts to bloat and increase to the point where the system is no longer stable. To resolve this I need to get more data on how long Runnable's of different class types are taking to execute, or somehow flag the ones taking longer than x seconds to execute. I'm also trying to get insight if I am over allocating cores to VM's on my servers causing the JVM taking a while to obtain a core for thread execution.
Monitoring the queue size is pretty simple, but getting these other metrics I don't see any API's in Java that make this possible, any help would be appreciated, this is my last major blocker!