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
A QueuedThreadPool subclass that monitors its own activity by recording queue and task statistics.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.ListenerNested classes/interfaces inherited from interface ThreadPool
ThreadPool.SizedThreadPoolNested classes/interfaces inherited from interface TryExecutor
TryExecutor.NoTryExecutor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SampleStatisticprivate final CounterStatisticprivate final SampleStatisticprivate final CounterStatisticFields inherited from interface TryExecutor
NO_TRY -
Constructor Summary
ConstructorsConstructorDescriptionMonitoredQueuedThreadPool(int maxThreads) MonitoredQueuedThreadPool(int maxThreads, int minThreads, int idleTimeOut, BlockingQueue<Runnable> queue) -
Method Summary
Methods inherited from class QueuedThreadPool
doStart, doStop, dump, dumpThread, getAvailableReservedThreads, getBusyThreads, getIdleThreads, getIdleTimeout, getLeasedThreads, getLowThreadsThreshold, getMaxAvailableThreads, getMaxLeasedThreads, getMaxReservedThreads, getMaxThreads, getMinThreads, getName, getQueue, getQueueSize, getReadyThreads, getReservedThreads, getThreadPoolBudget, getThreads, getThreadsPriority, getUtilizationRate, getUtilizedThreads, interruptThread, isDaemon, isDetailedDump, isLowOnThreads, join, newThread, removeThread, runJob, setDaemon, setDetailedDump, setIdleTimeout, setLowThreadsThreshold, setMaxThreads, setMinThreads, setName, setQueue, setReservedThreads, setThreadPoolBudget, setThreadsPriority, startThread, toString, tryExecuteMethods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansMethods inherited from class AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Dumpable.DumpableContainer
isDumpable
-
Field Details
-
queueStats
-
queueLatencyStats
-
taskLatencyStats
-
threadStats
-
-
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:
executein interfaceExecutor- Specified by:
executein interfaceTryExecutor- Overrides:
executein 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
-