public class CompositeFunctionTimer<T> extends AbstractMeter implements FunctionTimer, CompositeMeter
Meter.Id, Meter.Type
Constructor and Description |
---|
CompositeFunctionTimer(Meter.Id id,
T obj,
java.util.function.ToLongFunction<T> countFunction,
java.util.function.ToDoubleFunction<T> totalTimeFunction,
java.util.concurrent.TimeUnit totalTimeFunctionUnits) |
Modifier and Type | Method and Description |
---|---|
void |
add(MeterRegistry registry) |
java.util.concurrent.TimeUnit |
baseTimeUnit() |
long |
count()
The total number of occurrences of the timed event.
|
void |
remove(MeterRegistry registry) |
double |
totalTime(java.util.concurrent.TimeUnit unit)
The total time of all occurrences of the timed event.
|
getId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
measure
public void add(MeterRegistry registry)
add
in interface CompositeMeter
public void remove(MeterRegistry registry)
remove
in interface CompositeMeter
public long count()
FunctionTimer
count
in interface FunctionTimer
public double totalTime(java.util.concurrent.TimeUnit unit)
FunctionTimer
totalTime
in interface FunctionTimer
public java.util.concurrent.TimeUnit baseTimeUnit()
baseTimeUnit
in interface FunctionTimer