Package io.micrometer.core.instrument
Class Timer.Sample
- java.lang.Object
-
- io.micrometer.core.instrument.Timer.Sample
-
- Enclosing interface:
- Timer
public static class Timer.Sample extends java.lang.ObjectMaintains state on the clock's start position for a latency sample. Complete the timing by callingstop(Timer). Note how theTimerisn't provided until the sample is stopped, allowing you to determine the timer's tags at the last minute.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longstop(Timer timer)Records the duration of the operation
-
-
-
Method Detail
-
stop
public long stop(Timer timer)
Records the duration of the operation- Parameters:
timer- The timer to record the sample to.- Returns:
- The total duration of the sample in nanoseconds
-
-