public final class ThreadPoolMonitor
extends java.lang.Object
The following is the list of metrics reported followed by which ThreadPoolExecutor
method populates it.
+-----------------------------------------------------------------------------+ | Metric Name | Data Source | +------------------------------+----------------------------------------------+ |threadpool.taskCount |ThreadPoolExecutor.getTaskCount()
| +------------------------------+----------------------------------------------+ |threadpool.completedTaskCount |ThreadPoolExecutor.getCompletedTaskCount()
| +------------------------------+----------------------------------------------+ |threadpool.currentThreadsBusy |ThreadPoolExecutor.getActiveCount()
| +------------------------------+----------------------------------------------+ |threadpool.maxThreads |ThreadPoolExecutor.getMaximumPoolSize()
| +------------------------------+----------------------------------------------+ |threadpool.poolSize |ThreadPoolExecutor.getPoolSize()
| +------------------------------+----------------------------------------------+ |threadpool.corePoolSize |ThreadPoolExecutor.getCorePoolSize()
| +------------------------------+----------------------------------------------+ |threadpool.queueSize |ThreadPoolExecutor.getQueue()
.size() | +-----------------------------------------------------------------------------+
Modifier and Type | Method and Description |
---|---|
static void |
attach(Registry registry,
java.util.concurrent.ThreadPoolExecutor threadPool,
java.lang.String threadPoolName)
Register the provided thread pool, optionally tagged with a name.
|
public static void attach(Registry registry, java.util.concurrent.ThreadPoolExecutor threadPool, java.lang.String threadPoolName)
registry
- the registry to usethreadPool
- the thread pool on which to attach monitoringthreadPoolName
- a name with which to tag the metrics (default name used if null
or empty)