public class ThreadPoolExecutorBaseStatisticsTask extends Object implements Runnable
ThreadPoolExecutor
including the moving average of its queue length, queue size, average active
count, etc.Modifier and Type | Field and Description |
---|---|
protected ThreadPoolExecutor |
service
The executor service that is being monitored.
|
protected long |
startNanos
The time when we started to collect data about the
service (set
by the ctor). |
protected double |
w
The weight used to compute the moving average.
|
Constructor and Description |
---|
ThreadPoolExecutorBaseStatisticsTask(ThreadPoolExecutor service) |
ThreadPoolExecutorBaseStatisticsTask(ThreadPoolExecutor service,
double w)
Core impl.
|
Modifier and Type | Method and Description |
---|---|
CounterSet |
getCounters()
Return the moving averages and various other counters sampled and
reported by this class.
|
void |
run()
This should be invoked once per second to sample various counters in
order to turn their values into moving averages.
|
protected final ThreadPoolExecutor service
protected final long startNanos
service
(set
by the ctor).protected final double w
public ThreadPoolExecutorBaseStatisticsTask(ThreadPoolExecutor service)
service
- The service to be monitored.public ThreadPoolExecutorBaseStatisticsTask(ThreadPoolExecutor service, double w)
service
- The service to be monitored.w
- The weight to be used by the MovingAverageTask
s.public void run()
Note: don't throw anything from here or it will cause the scheduled task executing this to no longer be run!
public CounterSet getCounters()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.