public class ThreadPoolMetrics
extends java.lang.Object
ThreadPoolExecutor
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTIVE_TASKS |
com.codahale.metrics.Gauge<java.lang.Integer> |
activeTasks
Number of active tasks.
|
static java.lang.String |
COMPLETED_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).
|
static java.lang.String |
CURRENTLY_BLOCKED_TASKS |
static java.lang.String |
MAX_POOL_SIZE |
static java.lang.String |
MAX_TASKS_QUEUED |
com.codahale.metrics.Gauge<java.lang.Integer> |
maxPoolSize
Maximum number of threads before it will start queuing tasks
|
com.codahale.metrics.Gauge<java.lang.Integer> |
maxTasksQueued
Maximum number of tasks queued before a task get blocked
|
java.lang.String |
path |
static java.lang.String |
PENDING_TASKS |
com.codahale.metrics.Gauge<java.lang.Integer> |
pendingTasks
Number of tasks waiting to be executed.
|
java.lang.String |
poolName |
static java.lang.String |
TOTAL_BLOCKED_TASKS |
com.codahale.metrics.Counter |
totalBlocked
Number of tasks that had blocked before being accepted (or rejected).
|
Constructor and Description |
---|
ThreadPoolMetrics(LocalAwareExecutorService executor,
java.lang.String path,
java.lang.String poolName)
Create metrics for given ThreadPoolExecutor.
|
Modifier and Type | Method and Description |
---|---|
ThreadPoolMetrics |
register() |
void |
release() |
public static final java.lang.String ACTIVE_TASKS
public static final java.lang.String PENDING_TASKS
public static final java.lang.String COMPLETED_TASKS
public static final java.lang.String CURRENTLY_BLOCKED_TASKS
public static final java.lang.String TOTAL_BLOCKED_TASKS
public static final java.lang.String MAX_POOL_SIZE
public static final java.lang.String MAX_TASKS_QUEUED
public final com.codahale.metrics.Gauge<java.lang.Integer> activeTasks
public final com.codahale.metrics.Gauge<java.lang.Integer> pendingTasks
public final com.codahale.metrics.Gauge<java.lang.Long> completedTasks
public final com.codahale.metrics.Counter currentBlocked
public final com.codahale.metrics.Counter totalBlocked
public final com.codahale.metrics.Gauge<java.lang.Integer> maxPoolSize
public final com.codahale.metrics.Gauge<java.lang.Integer> maxTasksQueued
public final java.lang.String path
public final java.lang.String poolName
public ThreadPoolMetrics(LocalAwareExecutorService executor, java.lang.String path, java.lang.String poolName)
executor
- Thread poolpath
- Type of thread poolpoolName
- Name of thread pool to identify metricspublic ThreadPoolMetrics register()
public void release()
Copyright © 2009-2021 The Apache Software Foundation