public interface MetricStrategy
Metrics.
Only metric timers and histograms created through Metrics.timer(String),
Metrics.startTimer(String), Metrics.histogram(String), Timers.timerWithMetric(java.lang.String, java.lang.String) and
Timers.startWithMetric(java.lang.String) will interact with
configured MetricStrategy instances.
| Modifier and Type | Method and Description |
|---|---|
default void |
onRequestEnd()
Method that is called to signal that the request has completed.
|
void |
setConfiguration(MetricsConfiguration configuration)
Method that is called when the strategy is
registered. |
Ticker |
startTimer(String metricName)
Called to mark the end of a block of code for which metrics should be calculated.
|
void |
updateHistogram(String metricName,
long value)
Called when a histogram is
updated. |
void |
updateTimer(String metricName,
long time,
TimeUnit timeUnit)
Called when a metric is
updated. |
default void onRequestEnd()
void setConfiguration(@Nonnull MetricsConfiguration configuration)
registered.configuration - the configuration@Nonnull Ticker startTimer(@Nonnull String metricName)
metricName - the name of metricticker that can be used to mark the end of the code block for
which metrics should be calculated. Must be non-null, but can be Ticker.NO_OP if the strategy
opts out of tracking.void updateHistogram(@Nonnull String metricName, long value)
updated.metricName - the histogram namevalue - the value to recordCopyright © 2019 Atlassian. All rights reserved.