java.util.concurrent.Executor
, Container
, Destroyable
, Dumpable
, LifeCycle
, ThreadPool
, ThreadPool.SizedThreadPool
, TryExecutor
@ManagedObject public class MonitoredQueuedThreadPool extends QueuedThreadPool
A QueuedThreadPool
subclass that monitors its own activity by recording queue and task statistics.
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
ThreadPool.SizedThreadPool
TryExecutor.NoTryExecutor
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING
NO_TRY
Constructor | Description |
---|---|
MonitoredQueuedThreadPool() |
|
MonitoredQueuedThreadPool(int maxThreads) |
Modifier and Type | Method | Description |
---|---|---|
void |
execute(java.lang.Runnable job) |
|
long |
getAverageQueueLatency() |
|
long |
getAverageTaskLatency() |
|
int |
getMaxBusyThreads() |
|
long |
getMaxQueueLatency() |
|
int |
getMaxQueueSize() |
|
long |
getMaxTaskLatency() |
|
long |
getTasks() |
|
void |
reset() |
Resets the statistics.
|
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
doStart, doStop, dump, dumpThread, getBusyThreads, getIdleThreads, getIdleTimeout, getLowThreadsThreshold, getMaxThreads, getMinThreads, getName, getQueue, getQueueSize, getReservedThreads, getThreadPoolBudget, getThreads, getThreadsPriority, interruptThread, isDaemon, isDetailedDump, isLowOnThreads, join, newThread, runJob, setDaemon, setDetailedDump, setIdleTimeout, setLowThreadsThreshold, setMaxThreads, setMinThreads, setName, setQueue, setReservedThreads, setThreadPoolBudget, setThreadsPriority, toString, tryExecute
asTryExecutor
public MonitoredQueuedThreadPool()
public MonitoredQueuedThreadPool(int maxThreads)
public void execute(java.lang.Runnable job)
execute
in interface java.util.concurrent.Executor
execute
in interface TryExecutor
execute
in class QueuedThreadPool
@ManagedOperation(value="resets the statistics", impact="ACTION") public void reset()
@ManagedAttribute("the number of tasks executed") public long getTasks()
@ManagedAttribute("the maximum number of busy threads") public int getMaxBusyThreads()
@ManagedAttribute("the maximum task queue size") public int getMaxQueueSize()
@ManagedAttribute("the average time a task remains in the queue, in nanoseconds") public long getAverageQueueLatency()
@ManagedAttribute("the maximum time a task remains in the queue, in nanoseconds") public long getMaxQueueLatency()
@ManagedAttribute("the average task execution time, in nanoseconds") public long getAverageTaskLatency()
@ManagedAttribute("the maximum task execution time, in nanoseconds") public long getMaxTaskLatency()
Copyright © 1995–2018 Webtide. All rights reserved.