public class MultiCounterRunnableOperation extends MultiCounterMonitorableOperation implements Runnable
Runnable that maintains custom counters for elapsed time
evaluation.
The counters are stored in default time unit (nanoseconds).
Note: Not thread-safe. It is recommended to create separate instances for each thread. If multiple threads access the same instance of this class, the metrics may be inconsistent.
NO_SPECIFIC_TYPE, stopwatch| Constructor and Description |
|---|
MultiCounterRunnableOperation(Runnable targetRunnable)
Builds this monitorable operation with a given
Runnable. |
MultiCounterRunnableOperation(Runnable targetRunnable,
Counter.Type... types)
Builds this monitorable operation with a given
Runnable and specific counter type(s). |
| Modifier and Type | Method and Description |
|---|---|
void |
run()
See
Runnable.run(). |
getCounter, getCounters, printStatistics, printStatisticspublic MultiCounterRunnableOperation(Runnable targetRunnable)
Runnable.targetRunnable - the Runnable to be executed and profiledpublic MultiCounterRunnableOperation(Runnable targetRunnable, Counter.Type... types)
Runnable and specific counter type(s).targetRunnable - the Runnable to be executed and profiledtypes - the counter types to be maintained with the operationpublic void run()
Runnable.run().Copyright © 2019. All rights reserved.