Package com.atlassian.util.profiling
Interface MetricTimer
Object that is used to collect time metrics about the execution a block of code.
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);
- Since:
- 3.0
-
Method Summary
-
Method Details
-
start
Starts atickerfor a monitored code block- Returns:
- the ticker
-
update
Updates the metric with an additional value- Parameters:
time- the time to recordtimeUnit- the time unit oftime
-
update
Updates the metric with an additional value- Parameters:
time- the time to record- Since:
- 3.4
-