Top Description Fields Constructors Methods
org.eclipse.jetty.util.thread

public Class MonitoredQueuedThreadPool

extends QueuedThreadPool
Class Inheritance
Annotations
@ManagedObject
Imports
java.util.concurrent.BlockingQueue, org.eclipse.jetty.util.BlockingArrayQueue, .NanoTime, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, .ManagedOperation, org.eclipse.jetty.util.statistic.CounterStatistic, .SampleStatistic

A QueuedThreadPool subclass that monitors its own activity by recording queue and task statistics.

Field Summary

Modifier and TypeField and Description
private final SampleStatistic
private final CounterStatistic
private final SampleStatistic
private final CounterStatistic

Constructor Summary

AccessConstructor and Description
public
public
MonitoredQueuedThreadPool(int maxThreads)

public
MonitoredQueuedThreadPool(int maxThreads, int minThreads, int idleTimeOut, BlockingQueue<Runnable> queue)

Method Summary

Modifier and TypeMethod and Description
public void
execute(final Runnable
the runnable task
job
)

Overrides org.eclipse.jetty.util.thread.QueuedThreadPool.execute.

Overrides default org.eclipse.jetty.util.thread.TryExecutor.execute.

Implements java.util.concurrent.Executor.execute.

Executes the given command at some time in the future.
public long

Returns:

the average time a task remains in the queue, in nanoseconds
getAverageQueueLatency
()

public long

Returns:

the average task execution time, in nanoseconds
getAverageTaskLatency
()

public int

Returns:

the maximum number of busy threads
getMaxBusyThreads
()

public long

Returns:

the maximum time a task remains in the queue, in nanoseconds
getMaxQueueLatency
()

public int

Returns:

the maximum task queue size
getMaxQueueSize
()

public long

Returns:

the maximum task execution time, in nanoseconds
getMaxTaskLatency
()

public long

Returns:

the number of tasks executed
getTasks
()

public void
reset()

Resets the statistics.

Inherited from org.eclipse.jetty.util.thread.QueuedThreadPool:
doStartdoStopdumpdumpThreadevictgetAvailableReservedThreadsgetBusyThreadsgetIdleThreadsgetIdleTimeoutgetLeasedThreadsgetLowThreadsThresholdgetMaxAvailableThreadsgetMaxEvictCountgetMaxLeasedThreadsgetMaxReservedThreadsgetMaxThreadsgetMinThreadsgetNamegetQueuegetQueueSizegetReadyThreadsgetReservedThreadsgetStopTimeoutgetThreadPoolBudgetgetThreadsgetThreadsPrioritygetUtilizationRategetUtilizedThreadsgetVirtualThreadsExecutorinterruptThreadisDaemonisDetailedDumpisLowOnThreadsjoinnewThreadonJobFailureremoveThreadrunJobsetDaemonsetDetailedDumpsetIdleTimeoutsetLowThreadsThresholdsetMaxEvictCountsetMaxThreadssetMinThreadssetNamesetReservedThreadssetStopTimeoutsetThreadPoolBudgetsetThreadsPrioritysetVirtualThreadsExecutorstartThreadtoStringtryExecute

Field Detail

queueLatencyStatsback to summary
private final SampleStatistic queueLatencyStats
queueStatsback to summary
private final CounterStatistic queueStats
taskLatencyStatsback to summary
private final SampleStatistic taskLatencyStats
threadStatsback to summary
private final CounterStatistic threadStats

Constructor Detail

MonitoredQueuedThreadPoolback to summary
public MonitoredQueuedThreadPool()
MonitoredQueuedThreadPoolback to summary
public MonitoredQueuedThreadPool(int maxThreads)
MonitoredQueuedThreadPoolback to summary
public MonitoredQueuedThreadPool(int maxThreads, int minThreads, int idleTimeOut, BlockingQueue<Runnable> queue)

Method Detail

executeback to summary
public void execute(final Runnable job)

Overrides org.eclipse.jetty.util.thread.QueuedThreadPool.execute.

Overrides default org.eclipse.jetty.util.thread.TryExecutor.execute.

Implements java.util.concurrent.Executor.execute.

Doc from java.util.concurrent.Executor.execute.

Executes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the Executor implementation.

Parameters
job:Runnable

the runnable task

Annotations
@Override
getAverageQueueLatencyback to summary
public long getAverageQueueLatency()
Returns:long

the average time a task remains in the queue, in nanoseconds

Annotations
@ManagedAttribute:the average time a task remains in the queue, in nanoseconds
getAverageTaskLatencyback to summary
public long getAverageTaskLatency()
Returns:long

the average task execution time, in nanoseconds

Annotations
@ManagedAttribute:the average task execution time, in nanoseconds
getMaxBusyThreadsback to summary
public int getMaxBusyThreads()
Returns:int

the maximum number of busy threads

Annotations
@ManagedAttribute:the maximum number of busy threads
getMaxQueueLatencyback to summary
public long getMaxQueueLatency()
Returns:long

the maximum time a task remains in the queue, in nanoseconds

Annotations
@ManagedAttribute:the maximum time a task remains in the queue, in nanoseconds
getMaxQueueSizeback to summary
public int getMaxQueueSize()
Returns:int

the maximum task queue size

Annotations
@ManagedAttribute:the maximum task queue size
getMaxTaskLatencyback to summary
public long getMaxTaskLatency()
Returns:long

the maximum task execution time, in nanoseconds

Annotations
@ManagedAttribute:the maximum task execution time, in nanoseconds
getTasksback to summary
public long getTasks()
Returns:long

the number of tasks executed

Annotations
@ManagedAttribute:the number of tasks executed
resetback to summary
public void reset()

Resets the statistics.

Annotations
@ManagedOperation:resets the statistics
impact:ACTION