@Internal @ParametersAreNonnullByDefault public class Timers extends Object
Timer instances
try (Ticker ignored = Timers.start("my-timer")) {
// monitored code block here
}
| Modifier and Type | Method and Description |
|---|---|
static Timer |
concat(Timer... timers)
Combine multiple
Timer objects into one, so they can be started and stopped together. |
static ProfilerConfiguration |
getConfiguration()
Get the current
ProfilerConfiguration. |
static void |
onRequestEnd()
Call this method to signal that the request has completed to trigger all configured
profiler strategies and metric strategies to clean up any
request or thread scoped resources associated with profiling state, including closing
any tickers that have not yet been closed. |
static Ticker |
start(String name)
Starts a timer with the given name.
|
static Ticker |
startWithMetric(String timerName)
Starts a timer with the given name and metrics.
|
static Ticker |
startWithMetric(String timerName,
MetricTag.RequiredMetricTag... metricTags)
Deprecated.
since 4.3.0, for removal in 5.0.0, use
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead. |
static Ticker |
startWithMetric(String timerName,
String metricName)
Deprecated.
since 4.3.0, for removal in 5.0.0, use
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead. |
static Ticker |
startWithMetric(String timerName,
String metricName,
MetricTag.RequiredMetricTag... metricTags)
Deprecated.
since 4.3.0, for removal in 5.0.0, use
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead. |
static Timer |
timer(String name)
Creates a
Timer with the given name. |
static Timer |
timerWithMetric(String name)
Creates a
Timer with the given name, and metrics. |
static Timer |
timerWithMetric(String name,
Collection<MetricTag.RequiredMetricTag> tags)
Deprecated.
since 4.3.0, for removal in 5.0.0, use
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead. |
static Timer |
timerWithMetric(String traceName,
Metrics.Builder metricBuilder)
Creates a
Timer with the given trace name, and metrics based on the builder. |
static Timer |
timerWithMetric(String name,
MetricTag.RequiredMetricTag... tags)
Deprecated.
since 4.3.0, for removal in 5.0.0, use
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead. |
static Timer |
timerWithMetric(String traceName,
MetricTimer metricTimer)
Creates a
Timer with the given trace name, and mixes in a MetricTimer. |
static Timer |
timerWithMetric(String traceName,
String metricName)
Deprecated.
since 4.3.0, for removal in 5.0.0, use
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead. |
static Timer |
timerWithMetric(String traceName,
String metricName,
Collection<MetricTag.RequiredMetricTag> tags)
Deprecated.
since 4.3.0, for removal in 5.0.0, use
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead. |
static Timer |
timerWithMetric(String traceName,
String metricName,
MetricTag.RequiredMetricTag... tags)
Deprecated.
since 4.3.0, for removal in 5.0.0, use
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead. |
@Nonnull public static Timer concat(Timer... timers)
Timer objects into one, so they can be started and stopped together.timers - to combineTimer@Nonnull public static ProfilerConfiguration getConfiguration()
ProfilerConfiguration.public static void onRequestEnd()
profiler strategies and metric strategies to clean up any
request or thread scoped resources associated with profiling state, including closing
any tickers that have not yet been closed.@Nonnull public static Ticker start(String name)
Ticker to stop the created and started timer.@Nonnull public static Ticker startWithMetric(String timerName)
Ticker to stop the created and started timer.@Deprecated @Nonnull public static Ticker startWithMetric(String timerName, String metricName)
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead.Ticker to stop the created and started timer.@Deprecated @Nonnull public static Ticker startWithMetric(String timerName, MetricTag.RequiredMetricTag... metricTags)
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead.
See Metrics.Builder.tags(Iterable) for more information about tag behaviour.
Ticker to stop the created and started timer.@Deprecated @Nonnull public static Ticker startWithMetric(String timerName, String metricName, MetricTag.RequiredMetricTag... metricTags)
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead.
See Metrics.Builder.tags(Iterable) for more information about tag behaviour.
Ticker to stop the created and started timer.@Nonnull public static Timer timer(String name)
Timer with the given name.Timer.@Deprecated @Nonnull public static Timer timerWithMetric(String traceName, String metricName)
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead.Timer with the given trace name, and metrics with given metric name.Timer.@Deprecated @Nonnull public static Timer timerWithMetric(String traceName, String metricName, MetricTag.RequiredMetricTag... tags)
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead.Timer with the given trace name, and tagged metrics with the given metric name.
See Metrics.Builder.tags(Iterable) for more information about tag behaviour.
Timer.@Deprecated @Nonnull public static Timer timerWithMetric(String traceName, String metricName, Collection<MetricTag.RequiredMetricTag> tags)
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead.Timer with the given trace name, and tagged metrics with the given metric name.
See Metrics.Builder.tags(Iterable) for more information about tag behaviour.
Timer.@Nonnull public static Timer timerWithMetric(String traceName, Metrics.Builder metricBuilder)
Timer with the given trace name, and metrics based on the builder.
See Metrics.Builder.tags(Iterable) for more information about tag behaviour.
Timer.@Nonnull public static Timer timerWithMetric(String traceName, MetricTimer metricTimer)
Timer with the given trace name, and mixes in a MetricTimer.Timer.@Nonnull public static Timer timerWithMetric(String name)
Timer with the given name, and metrics.Ticker to stop the created timer.@Deprecated @Nonnull public static Timer timerWithMetric(String name, Collection<MetricTag.RequiredMetricTag> tags)
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead.Timer with the given name, and tagged metrics.
See Metrics.Builder.tags(Iterable) for more information about tag behaviour.
Timer.@Deprecated @Nonnull public static Timer timerWithMetric(String name, MetricTag.RequiredMetricTag... tags)
timerWithMetric(String, Metrics.Builder) with
the Metrics.metric(String) builder instead.Timer with the given name, and tagged metrics.
See Metrics.Builder.tags(Iterable) for more information about tag behaviour.
Timer.Copyright © 2023 Atlassian. All rights reserved.