Class CumulativeFunctionTimer<T>
- java.lang.Object
-
- io.micrometer.core.instrument.cumulative.CumulativeFunctionTimer<T>
-
- All Implemented Interfaces:
FunctionTimer,Meter
public class CumulativeFunctionTimer<T> extends java.lang.Object implements FunctionTimer
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.Id, Meter.Type
-
-
Constructor Summary
Constructors Constructor Description CumulativeFunctionTimer(Meter.Id id, T obj, java.util.function.ToLongFunction<T> countFunction, java.util.function.ToDoubleFunction<T> totalTimeFunction, java.util.concurrent.TimeUnit totalTimeFunctionUnit, java.util.concurrent.TimeUnit baseTimeUnit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.TimeUnitbaseTimeUnit()doublecount()The total number of occurrences of the timed event.Meter.IdgetId()doubletotalTime(java.util.concurrent.TimeUnit unit)The total time of all occurrences of the timed event.Meter.Typetype()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micrometer.core.instrument.FunctionTimer
mean, measure
-
-
-
-
Method Detail
-
count
public double count()
The total number of occurrences of the timed event.- Specified by:
countin interfaceFunctionTimer- Returns:
- The total number of occurrences of the timed event.
-
totalTime
public double totalTime(java.util.concurrent.TimeUnit unit)
The total time of all occurrences of the timed event.- Specified by:
totalTimein interfaceFunctionTimer- Parameters:
unit- The base unit of time to scale the total to.- Returns:
- The total time of all occurrences of the timed event.
-
getId
public Meter.Id getId()
-
baseTimeUnit
public java.util.concurrent.TimeUnit baseTimeUnit()
- Specified by:
baseTimeUnitin interfaceFunctionTimer- Returns:
- The base time unit of the timer to which all published metrics will be scaled
-
type
public Meter.Type type()
-
-