org.apache.cassandra.metrics

## Class ThreadPoolMetrics

- java.lang.Object
- - org.apache.cassandra.metrics.ThreadPoolMetrics

    public class ThreadPoolMetrics
    extends java.lang.Object

Metrics for `ThreadPoolExecutor`.

### Field Summary

Fields
`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 Summary

Constructors
Constructor and Description
`ThreadPoolMetrics(java.util.concurrent.ThreadPoolExecutor executor, java.lang.String path, java.lang.String poolName)` Create metrics for given ThreadPoolExecutor.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`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()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### activeTasks

    public final com.codahale.metrics.Gauge<java.lang.Integer> activeTasks

Number of active tasks.

#### totalBlocked

    public final com.codahale.metrics.Counter totalBlocked

Number of tasks that had blocked before being accepted (or rejected).

#### currentBlocked

    public final 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).

#### completedTasks

    public final com.codahale.metrics.Gauge<java.lang.Long> completedTasks

Number of completed tasks.

#### pendingTasks

    public final com.codahale.metrics.Gauge<java.lang.Long> pendingTasks

Number of tasks waiting to be executed.

#### maxPoolSize

    public final com.codahale.metrics.Gauge<java.lang.Integer> maxPoolSize

Maximum number of threads before it will start queuing tasks

### Constructor Detail

#### ThreadPoolMetrics

    public ThreadPoolMetrics(java.util.concurrent.ThreadPoolExecutor executor,
                             java.lang.String path,
                             java.lang.String poolName)

Create metrics for given ThreadPoolExecutor.

Parameters:
  `executor` - Thread pool
  `path` - Type of thread pool
  `poolName` - Name of thread pool to identify metrics

### Method Detail

#### release

    public void release()

#### getJmxMetric

    public static java.lang.Object getJmxMetric(javax.management.MBeanServerConnection mbeanServerConn,
                                                java.lang.String jmxPath,
                                                java.lang.String poolName,
                                                java.lang.String metricName)

#### getJmxThreadPools

    public static com.google.common.collect.Multimap<java.lang.String,java.lang.String> getJmxThreadPools(javax.management.MBeanServerConnection mbeanServerConn)