public abstract class MultiCounterMonitorableOperation extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static Counter.Type[] |
NO_SPECIFIC_TYPE |
protected Stopwatch |
stopwatch |
| Constructor and Description |
|---|
MultiCounterMonitorableOperation(Counter.Type... types)
Builds this operation with the specified types, which will be maintained using default
time unit.
|
| Modifier and Type | Method and Description |
|---|---|
Counter |
getCounter(Counter.Type type) |
Collection<Counter> |
getCounters() |
void |
printStatistics(PrintStream printStream)
Prints operation statistics in the specified print stream.
|
void |
printStatistics(PrintStream printStream,
TimeUnit timeUnit)
Prints operation statistics in the specified print stream, with a custom time unit.
|
protected static final Counter.Type[] NO_SPECIFIC_TYPE
protected final Stopwatch stopwatch
public MultiCounterMonitorableOperation(Counter.Type... types)
types - the counter types to createdpublic Collection<Counter> getCounters()
public Counter getCounter(Counter.Type type)
type - the counter type to be fetchedpublic void printStatistics(PrintStream printStream)
printStream - the print stream to which statistics will be sentpublic void printStatistics(PrintStream printStream, TimeUnit timeUnit)
printStream - the print stream to which statistics will be senttimeUnit - the time unit for the elapsed times to be displayedCopyright © 2019. All rights reserved.