Package org.apache.cassandra.metrics
Class ThreadPoolMetrics
- java.lang.Object
-
- org.apache.cassandra.metrics.ThreadPoolMetrics
-
public class ThreadPoolMetrics extends java.lang.ObjectMetrics forThreadPoolExecutor.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACTIVE_TASKScom.codahale.metrics.Gauge<java.lang.Integer>activeTasksNumber of active tasks.static java.lang.StringCOMPLETED_TASKScom.codahale.metrics.Gauge<java.lang.Long>completedTasksNumber of completed tasks.com.codahale.metrics.CountercurrentBlockedNumber 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.StringCURRENTLY_BLOCKED_TASKSstatic java.lang.StringMAX_POOL_SIZEstatic java.lang.StringMAX_TASKS_QUEUEDcom.codahale.metrics.Gauge<java.lang.Integer>maxPoolSizeMaximum number of threads before it will start queuing taskscom.codahale.metrics.Gauge<java.lang.Integer>maxTasksQueuedMaximum number of tasks queued before a task get blockedstatic java.lang.StringOLDEST_TASK_QUEUE_TIMEcom.codahale.metrics.Gauge<java.lang.Long>oldestTaskQueueTimeFor how long the oldest task in the queue was queuedjava.lang.Stringpathstatic java.lang.StringPENDING_TASKScom.codahale.metrics.Gauge<java.lang.Integer>pendingTasksNumber of tasks waiting to be executed.java.lang.StringpoolNamestatic java.lang.StringTOTAL_BLOCKED_TASKScom.codahale.metrics.CountertotalBlockedNumber 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 ThreadPoolMetricsregister()voidrelease()
-
-
-
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()
-
-