Package io.micrometer.core.instrument
Interface FunctionTimer
- All Superinterfaces:
Meter
- All Known Implementing Classes:
CumulativeFunctionTimer
,DropwizardFunctionTimer
,NoopFunctionTimer
,StepFunctionTimer
A timer that tracks two monotonically increasing functions: one representing the count
of events and one representing the total time spent in every event.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Fluent builder for function timer.Nested classes/interfaces inherited from interface io.micrometer.core.instrument.Meter
Meter.Id, Meter.MeterProvider<T extends Meter>, Meter.Type
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> FunctionTimer.Builder
<T> builder
(String name, T obj, ToLongFunction<T> countFunction, ToDoubleFunction<T> totalTimeFunction, TimeUnit totalTimeFunctionUnit) double
count()
default double
default Iterable
<Measurement> measure()
Get a set of measurements.double
The total time of all occurrences of the timed event.
-
Method Details
-
builder
static <T> FunctionTimer.Builder<T> builder(String name, T obj, ToLongFunction<T> countFunction, ToDoubleFunction<T> totalTimeFunction, TimeUnit totalTimeFunctionUnit) -
count
double count()- Returns:
- The total number of occurrences of the timed event.
-
totalTime
The total time of all occurrences of the timed event.- Parameters:
unit
- The base unit of time to scale the total to.- Returns:
- The total time of all occurrences of the timed event.
-
mean
- Parameters:
unit
- The base unit of time to scale the mean to.- Returns:
- The distribution average for all recorded events.
-
baseTimeUnit
TimeUnit baseTimeUnit()- Returns:
- The base time unit of the timer to which all published metrics will be scaled
-
measure
Description copied from interface:Meter
Get a set of measurements. Should always return the same number of measurements and in the same order, regardless of the level of activity or the lack thereof.
-