Class CumulativeFunctionTimer<T>
java.lang.Object
io.micrometer.core.instrument.AbstractMeter
io.micrometer.core.instrument.cumulative.CumulativeFunctionTimer<T>
- All Implemented Interfaces:
FunctionTimer
,Meter
A timer that tracks monotonically increasing functions for count and totalTime.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micrometer.core.instrument.FunctionTimer
FunctionTimer.Builder<T>
Nested classes/interfaces inherited from interface io.micrometer.core.instrument.Meter
Meter.Builder, Meter.Id, Meter.MeterProvider<T extends Meter>, Meter.Type
-
Constructor Summary
ConstructorDescriptionCumulativeFunctionTimer
(Meter.Id id, T obj, ToLongFunction<T> countFunction, ToDoubleFunction<T> totalTimeFunction, TimeUnit totalTimeFunctionUnit, TimeUnit baseTimeUnit) -
Method Summary
Methods inherited from class io.micrometer.core.instrument.AbstractMeter
equals, getId, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micrometer.core.instrument.FunctionTimer
mean, measure
-
Constructor Details
-
CumulativeFunctionTimer
public CumulativeFunctionTimer(Meter.Id id, T obj, ToLongFunction<T> countFunction, ToDoubleFunction<T> totalTimeFunction, TimeUnit totalTimeFunctionUnit, TimeUnit baseTimeUnit)
-
-
Method Details
-
count
public double count()The total number of occurrences of the timed event.- Specified by:
count
in interfaceFunctionTimer
- Returns:
- The total number of occurrences of the timed event.
-
totalTime
The total time of all occurrences of the timed event.- Specified by:
totalTime
in interfaceFunctionTimer
- Parameters:
unit
- The base unit of time to scale the total to.- Returns:
- The total time of all occurrences of the timed event.
-
baseTimeUnit
- Specified by:
baseTimeUnit
in interfaceFunctionTimer
- Returns:
- The base time unit of the timer to which all published metrics will be scaled
-
type
-