public static class Timer.Sample
extends java.lang.Object
stop(Timer)
. Note how the Timer
isn't provided until the
sample is stopped, allowing you to determine the timer's tags at the last minute.Modifier and Type | Method and Description |
---|---|
long |
stop(MeterRegistry registry,
Timer.Builder timerBuilder)
Records the duration of the operation.
|
long |
stop(Timer timer)
Records the duration of the operation.
|
Timer.Sample |
tags(java.lang.Iterable<Tag> tags) |
Timer.Sample |
tags(java.lang.String... tags) |
public long stop(Timer timer)
timer
- The timer to record the sample to.@Incubating(since="1.4.0") public long stop(MeterRegistry registry, Timer.Builder timerBuilder)
registry
- The registry to which the timer will be registered.timerBuilder
- The timer to record the sample to.@Incubating(since="1.4.0") public Timer.Sample tags(java.lang.String... tags)
tags
- Must be an even number of arguments representing key/value pairs of tags.@Incubating(since="1.4.0") public Timer.Sample tags(java.lang.Iterable<Tag> tags)
tags
- Tags to add to the eventual timer.