Package org.apache.cassandra.metrics
Class ThreadPoolMetrics
- java.lang.Object
-
- org.apache.cassandra.metrics.ThreadPoolMetrics
-
public class ThreadPoolMetrics extends java.lang.Object
Metrics forThreadPoolExecutor
.
-
-
Field Summary
Fields Modifier and Type Field 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 taskscom.codahale.metrics.Gauge<java.lang.Integer>
maxTasksQueued
Maximum number of tasks queued before a task get blockedstatic java.lang.String
OLDEST_TASK_QUEUE_TIME
com.codahale.metrics.Gauge<java.lang.Long>
oldestTaskQueueTime
For how long the oldest task in the queue was queuedjava.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 Summary
Constructors Constructor Description ThreadPoolMetrics(ResizableThreadPool executor, java.lang.String path, java.lang.String poolName)
Create metrics for given ThreadPoolExecutor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThreadPoolMetrics
register()
void
release()
-
-
-
Field Detail
-
ACTIVE_TASKS
public static final java.lang.String ACTIVE_TASKS
- See Also:
- Constant Field Values
-
PENDING_TASKS
public static final java.lang.String PENDING_TASKS
- See Also:
- Constant Field Values
-
COMPLETED_TASKS
public static final java.lang.String COMPLETED_TASKS
- See Also:
- Constant Field Values
-
CURRENTLY_BLOCKED_TASKS
public static final java.lang.String CURRENTLY_BLOCKED_TASKS
- See Also:
- Constant Field Values
-
TOTAL_BLOCKED_TASKS
public static final java.lang.String TOTAL_BLOCKED_TASKS
- See Also:
- Constant Field Values
-
MAX_POOL_SIZE
public static final java.lang.String MAX_POOL_SIZE
- See Also:
- Constant Field Values
-
MAX_TASKS_QUEUED
public static final java.lang.String MAX_TASKS_QUEUED
- See Also:
- Constant Field Values
-
OLDEST_TASK_QUEUE_TIME
public static final java.lang.String OLDEST_TASK_QUEUE_TIME
- See Also:
- Constant Field Values
-
activeTasks
public final com.codahale.metrics.Gauge<java.lang.Integer> activeTasks
Number of active tasks.
-
pendingTasks
public final com.codahale.metrics.Gauge<java.lang.Integer> pendingTasks
Number of tasks waiting to be executed.
-
completedTasks
public final com.codahale.metrics.Gauge<java.lang.Long> completedTasks
Number of completed tasks.
-
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).
-
totalBlocked
public final com.codahale.metrics.Counter totalBlocked
Number of tasks that had blocked before being accepted (or rejected).
-
maxPoolSize
public final com.codahale.metrics.Gauge<java.lang.Integer> maxPoolSize
Maximum number of threads before it will start queuing tasks
-
oldestTaskQueueTime
public final com.codahale.metrics.Gauge<java.lang.Long> oldestTaskQueueTime
For how long the oldest task in the queue was queued
-
maxTasksQueued
public final com.codahale.metrics.Gauge<java.lang.Integer> maxTasksQueued
Maximum number of tasks queued before a task get blocked
-
path
public final java.lang.String path
-
poolName
public final java.lang.String poolName
-
-
Constructor Detail
-
ThreadPoolMetrics
public ThreadPoolMetrics(ResizableThreadPool executor, java.lang.String path, java.lang.String poolName)
Create metrics for given ThreadPoolExecutor.- Parameters:
executor
- Thread poolpath
- Type of thread poolpoolName
- Name of thread pool to identify metrics
-
-
Method Detail
-
register
public ThreadPoolMetrics register()
-
release
public void release()
-
-