Interface AutoTimer
- All Known Implementing Classes:
PropertiesAutoTimer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy that can be used to apply
Timers automatically instead of using
@Timed.- Since:
- 2.2.0
- Author:
- Tadaya Tsuyukubo, Stephane Nicoll, Phillip Webb
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(io.micrometer.core.instrument.Timer.Builder builder) Called to apply any auto-timer settings to the givenTimer.Builder.static voidapply(AutoTimer autoTimer, String metricName, Set<io.micrometer.core.annotation.Timed> annotations, Consumer<io.micrometer.core.instrument.Timer.Builder> action) default io.micrometer.core.instrument.Timer.BuilderFactory method to create a newTimer.Builderwith auto-timer settingsapplied.default io.micrometer.core.instrument.Timer.BuilderFactory method to create a newTimer.Builderwith auto-timer settingsapplied.default booleanReturn if the auto-timer is enabled and metrics should be recorded.
-
Field Details
-
Method Details
-
isEnabled
default boolean isEnabled()Return if the auto-timer is enabled and metrics should be recorded.- Returns:
- if the auto-timer is enabled
-
builder
Factory method to create a newTimer.Builderwith auto-timer settingsapplied.- Parameters:
name- the name of the timer- Returns:
- a new builder instance with auto-settings applied
-
builder
default io.micrometer.core.instrument.Timer.Builder builder(Supplier<io.micrometer.core.instrument.Timer.Builder> supplier) Factory method to create a newTimer.Builderwith auto-timer settingsapplied.- Parameters:
supplier- the builder supplier- Returns:
- a new builder instance with auto-settings applied
-
apply
void apply(io.micrometer.core.instrument.Timer.Builder builder) Called to apply any auto-timer settings to the givenTimer.Builder.- Parameters:
builder- the builder to apply settings to
-
apply
-