Interface TimerRegistry
- All Superinterfaces:
io.github.resilience4j.core.Registry<Timer,TimerConfig>
- All Known Implementing Classes:
InMemoryTimerRegistry
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.resilience4j.core.Registry
io.github.resilience4j.core.Registry.EventPublisher<E extends Object> -
Method Summary
Modifier and TypeMethodDescriptionReturns all managedTimerinstances.static TimerRegistryof(TimerConfig defaultConfig, io.micrometer.core.instrument.MeterRegistry meterRegistry) Creates a TimerRegistry.static TimerRegistryof(TimerConfig defaultConfig, Map<String, TimerConfig> configs, io.micrometer.core.instrument.MeterRegistry meterRegistry) Creates a TimerRegistry.static TimerRegistryof(TimerConfig defaultConfig, Map<String, TimerConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Timer>> registryEventConsumers, Map<String, String> tags, io.micrometer.core.instrument.MeterRegistry meterRegistry) Creates a TimerRegistry.static TimerRegistryof(Map<String, TimerConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Timer>> registryEventConsumers, Map<String, String> tags, io.micrometer.core.instrument.MeterRegistry meterRegistry) Creates a TimerRegistry.static TimerRegistryofDefaults(io.micrometer.core.instrument.MeterRegistry meterRegistry) Creates a TimerRegistry.Returns a managedTimeror creates a new one with the default Timer configuration.timer(String name, TimerConfig config) Returns a managedTimeror creates a new one with a custom Timer configuration.Returns a managedTimeror creates a new one with a custom Timer configuration.Returns a managedTimeror creates a new one.Returns a managedTimeror creates a new one.timer(String name, Supplier<TimerConfig> configSupplier) Returns a managedTimerConfigor creates a new one with a custom TimerConfig configuration.Returns a managedTimeror creates a new one with a custom Timer configuration.Returns a managedTimeror creates a new one with the default Timer configuration.Methods inherited from interface io.github.resilience4j.core.Registry
addConfiguration, find, getConfiguration, getDefaultConfig, getEventPublisher, getTags, remove, removeConfiguration, replace
-
Method Details
-
ofDefaults
Creates a TimerRegistry.- Parameters:
meterRegistry- the registry to bind Timer to- Returns:
- a TimerRegistry with a default Timer configuration.
-
of
static TimerRegistry of(TimerConfig defaultConfig, io.micrometer.core.instrument.MeterRegistry meterRegistry) Creates a TimerRegistry.- Parameters:
defaultConfig- the default config to use for new TimersmeterRegistry- the registry to bind Timer to- Returns:
- a TimerRegistry with a custom Timer configuration.
-
of
static TimerRegistry of(TimerConfig defaultConfig, Map<String, TimerConfig> configs, io.micrometer.core.instrument.MeterRegistry meterRegistry) Creates a TimerRegistry.- Parameters:
defaultConfig- the default config to use for new Timersconfigs- the additional configs to use for new TimersmeterRegistry- the registry to bind Timer to- Returns:
- a TimerRegistry with a custom Timer configuration.
-
of
static TimerRegistry of(Map<String, TimerConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Timer>> registryEventConsumers, Map<String, String> tags, io.micrometer.core.instrument.MeterRegistry meterRegistry) Creates a TimerRegistry.- Parameters:
configs- the additional configs to use for new TimersregistryEventConsumers- initialized consumers for timerstags- a map of tags for the registrymeterRegistry- the registry to bind Timer to- Returns:
- a TimerRegistry with a Map of shared Timer configurations and a list of Timer registry event consumers.
-
of
static TimerRegistry of(TimerConfig defaultConfig, Map<String, TimerConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Timer>> registryEventConsumers, Map<String, String> tags, io.micrometer.core.instrument.MeterRegistry meterRegistry) Creates a TimerRegistry.- Parameters:
defaultConfig- the default config to use for new Timersconfigs- the additional configs to use for new TimersregistryEventConsumers- initialized consumers for timerstags- a map of tags for the registrymeterRegistry- the registry to bind Timer to- Returns:
- a TimerRegistry with a Map of shared Timer configurations and a list of Timer registry event consumers.
-
getAllTimers
Returns all managedTimerinstances.- Returns:
- all managed
Timerinstances.
-
timer
Returns a managedTimeror creates a new one with the default Timer configuration.- Parameters:
name- the name of the Timer- Returns:
- The
Timer
-
timer
Returns a managedTimeror creates a new one with the default Timer configuration.The
tagspassed will be appended to the tags already configured for the registry. When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.- Parameters:
name- the name of the Timertags- tags added to the Timer- Returns:
- The
Timer
-
timer
Returns a managedTimeror creates a new one with a custom Timer configuration.- Parameters:
name- the name of the Timerconfig- a custom Timer configuration- Returns:
- The
Timer
-
timer
Returns a managedTimeror creates a new one with a custom Timer configuration.The
tagspassed will be appended to the tags already configured for the registry. When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.- Parameters:
name- the name of the Timerconfig- a custom Timer configurationtags- tags added to the Timer- Returns:
- The
Timer
-
timer
Returns a managedTimerConfigor creates a new one with a custom TimerConfig configuration.- Parameters:
name- the name of the TimerConfigconfigSupplier- a supplier of a custom TimerConfig configuration- Returns:
- The
TimerConfig
-
timer
Returns a managedTimeror creates a new one with a custom Timer configuration.The
tagspassed will be appended to the tags already configured for the registry. When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.- Parameters:
name- the name of the TimerconfigSupplier- a supplier of a custom Timer configurationtags- tags added to the Timer- Returns:
- The
Timer
-
timer
Returns a managedTimeror creates a new one. The configuration must have been added upfront viaRegistry.addConfiguration(String, Object).- Parameters:
name- the name of the TimerconfigName- the name of the shared configuration- Returns:
- The
Timer
-
timer
Returns a managedTimeror creates a new one. The configuration must have been added upfront viaRegistry.addConfiguration(String, Object).The
tagspassed will be appended to the tags already configured for the registry. When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.- Parameters:
name- the name of the TimerconfigName- the name of the shared configurationtags- tags added to the Timer- Returns:
- The
Timer
-