Package org.eclipse.jetty.util.thread
Class MonitoredQueuedThreadPool
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.util.thread.QueuedThreadPool
org.eclipse.jetty.util.thread.MonitoredQueuedThreadPool
- All Implemented Interfaces:
Executor
,ThreadFactory
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
,ThreadPool
,ThreadPool.SizedThreadPool
,TryExecutor
,VirtualThreads.Configurable
A QueuedThreadPool
subclass that monitors its own activity by recording queue and task statistics.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.ThreadPool
ThreadPool.SizedThreadPool
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.TryExecutor
TryExecutor.NoTryExecutor
-
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPING
Fields inherited from interface org.eclipse.jetty.util.thread.TryExecutor
NO_TRY
-
Constructor Summary
ConstructorDescriptionMonitoredQueuedThreadPool
(int maxThreads) MonitoredQueuedThreadPool
(int maxThreads, int minThreads, int idleTimeOut, BlockingQueue<Runnable> queue) -
Method Summary
Methods inherited from class org.eclipse.jetty.util.thread.QueuedThreadPool
doStart, doStop, dump, dumpThread, evict, getAvailableReservedThreads, getBusyThreads, getIdleThreads, getIdleTimeout, getLeasedThreads, getLowThreadsThreshold, getMaxAvailableThreads, getMaxEvictCount, getMaxLeasedThreads, getMaxReservedThreads, getMaxThreads, getMinThreads, getName, getQueue, getQueueSize, getReadyThreads, getReservedThreads, getStopTimeout, getThreadPoolBudget, getThreads, getThreadsPriority, getUtilizationRate, getUtilizedThreads, getVirtualThreadsExecutor, interruptThread, isDaemon, isDetailedDump, isLowOnThreads, join, newThread, removeThread, runJob, setDaemon, setDetailedDump, setIdleTimeout, setLowThreadsThreshold, setMaxEvictCount, setMaxThreads, setMinThreads, setName, setReservedThreads, setStopTimeout, setThreadPoolBudget, setThreadsPriority, setVirtualThreadsExecutor, startThread, toString, tryExecute
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
Methods inherited from interface org.eclipse.jetty.util.VirtualThreads.Configurable
isUseVirtualThreads, setUseVirtualThreads
-
Constructor Details
-
MonitoredQueuedThreadPool
public MonitoredQueuedThreadPool() -
MonitoredQueuedThreadPool
public MonitoredQueuedThreadPool(int maxThreads) -
MonitoredQueuedThreadPool
public MonitoredQueuedThreadPool(int maxThreads, int minThreads, int idleTimeOut, BlockingQueue<Runnable> queue)
-
-
Method Details
-
execute
- Specified by:
execute
in interfaceExecutor
- Specified by:
execute
in interfaceTryExecutor
- Overrides:
execute
in classQueuedThreadPool
-
reset
Resets the statistics. -
getTasks
- Returns:
- the number of tasks executed
-
getMaxBusyThreads
- Returns:
- the maximum number of busy threads
-
getMaxQueueSize
- Returns:
- the maximum task queue size
-
getAverageQueueLatency
@ManagedAttribute("the average time a task remains in the queue, in nanoseconds") public long getAverageQueueLatency()- Returns:
- the average time a task remains in the queue, in nanoseconds
-
getMaxQueueLatency
@ManagedAttribute("the maximum time a task remains in the queue, in nanoseconds") public long getMaxQueueLatency()- Returns:
- the maximum time a task remains in the queue, in nanoseconds
-
getAverageTaskLatency
@ManagedAttribute("the average task execution time, in nanoseconds") public long getAverageTaskLatency()- Returns:
- the average task execution time, in nanoseconds
-
getMaxTaskLatency
@ManagedAttribute("the maximum task execution time, in nanoseconds") public long getMaxTaskLatency()- Returns:
- the maximum task execution time, in nanoseconds
-