public class ThreadPoolMetrics
extends java.lang.Object
ThreadPoolExecutor
.Modifier and Type | Field and Description |
---|---|
com.codahale.metrics.Gauge<java.lang.Integer> |
activeTasks
Number of active tasks.
|
com.codahale.metrics.Gauge<java.lang.Long> |
completedTasks
Number of completed tasks.
|
com.codahale.metrics.Counter |
currentBlocked
Number of tasks currently blocked, waiting to be accepted by
the executor (because all threads are busy and the backing queue is full).
|
com.codahale.metrics.Gauge<java.lang.Integer> |
maxPoolSize
Maximum number of threads before it will start queuing tasks
|
com.codahale.metrics.Gauge<java.lang.Long> |
pendingTasks
Number of tasks waiting to be executed.
|
com.codahale.metrics.Counter |
totalBlocked
Number of tasks that had blocked before being accepted (or rejected).
|
Constructor and Description |
---|
ThreadPoolMetrics(java.util.concurrent.ThreadPoolExecutor executor,
java.lang.String path,
java.lang.String poolName)
Create metrics for given ThreadPoolExecutor.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
getJmxMetric(javax.management.MBeanServerConnection mbeanServerConn,
java.lang.String jmxPath,
java.lang.String poolName,
java.lang.String metricName) |
static com.google.common.collect.Multimap<java.lang.String,java.lang.String> |
getJmxThreadPools(javax.management.MBeanServerConnection mbeanServerConn) |
void |
release() |
public final com.codahale.metrics.Gauge<java.lang.Integer> activeTasks
public final com.codahale.metrics.Counter totalBlocked
public final com.codahale.metrics.Counter currentBlocked
public final com.codahale.metrics.Gauge<java.lang.Long> completedTasks
public final com.codahale.metrics.Gauge<java.lang.Long> pendingTasks
public final com.codahale.metrics.Gauge<java.lang.Integer> maxPoolSize
public ThreadPoolMetrics(java.util.concurrent.ThreadPoolExecutor executor, java.lang.String path, java.lang.String poolName)
executor
- Thread poolpath
- Type of thread poolpoolName
- Name of thread pool to identify metricspublic void release()
public static java.lang.Object getJmxMetric(javax.management.MBeanServerConnection mbeanServerConn, java.lang.String jmxPath, java.lang.String poolName, java.lang.String metricName)
public static com.google.common.collect.Multimap<java.lang.String,java.lang.String> getJmxThreadPools(javax.management.MBeanServerConnection mbeanServerConn)
Copyright © 2017 The Apache Software Foundation