@Internal @ParametersAreNonnullByDefault public interface MetricTimer
MetricTimer timer = Metrics.timer("my-metric");
try (Ticker ignored = timer.start()) {
// monitored code block
}
or
MetricTimer timer = Metrics.timer("my-metric");
timer.update(5, TimeUnit.MILLISECONDS);
| Modifier and Type | Method and Description |
|---|---|
Ticker |
start()
Starts a
ticker for a monitored code block |
void |
update(Duration time)
Updates the metric with an additional value
|
default void |
update(long time,
TimeUnit timeUnit)
Updates the metric with an additional value
|
default void update(long time,
TimeUnit timeUnit)
time - the time to recordtimeUnit - the time unit of timevoid update(Duration time)
time - the time to recordCopyright © 2023 Atlassian. All rights reserved.