Class InMemoryTimerRegistry

java.lang.Object
io.github.resilience4j.core.registry.AbstractRegistry<Timer,TimerConfig>
io.github.resilience4j.micrometer.internal.InMemoryTimerRegistry
All Implemented Interfaces:
io.github.resilience4j.core.Registry<Timer,TimerConfig>, TimerRegistry

public class InMemoryTimerRegistry extends io.github.resilience4j.core.registry.AbstractRegistry<Timer,TimerConfig> implements TimerRegistry
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.github.resilience4j.core.Registry

    io.github.resilience4j.core.Registry.EventPublisher<E extends Object>
  • Field Summary

    Fields inherited from class io.github.resilience4j.core.registry.AbstractRegistry

    CONFIG_MUST_NOT_BE_NULL, configurations, CONSUMER_MUST_NOT_BE_NULL, DEFAULT_CONFIG, entryMap, registryTags, SUPPLIER_MUST_NOT_BE_NULL, TAGS_MUST_NOT_BE_NULL
  • Constructor Summary

    Constructors
    Constructor
    Description
    InMemoryTimerRegistry(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)
     
    InMemoryTimerRegistry(Map<String,TimerConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Timer>> registryEventConsumers, Map<String,String> tags, io.micrometer.core.instrument.MeterRegistry meterRegistry)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns all managed Timer instances.
    timer(String name)
    Returns a managed Timer or creates a new one with the default Timer configuration.
    timer(String name, TimerConfig config)
    Returns a managed Timer or creates a new one with a custom Timer configuration.
    timer(String name, TimerConfig timerConfig, Map<String,String> tags)
    Returns a managed Timer or creates a new one with a custom Timer configuration.
    timer(String name, String configName)
    Returns a managed Timer or creates a new one.
    timer(String name, String configName, Map<String,String> tags)
    Returns a managed Timer or creates a new one.
    timer(String name, Supplier<TimerConfig> timerConfigSupplier)
    Returns a managed TimerConfig or creates a new one with a custom TimerConfig configuration.
    timer(String name, Supplier<TimerConfig> timerConfigSupplier, Map<String,String> tags)
    Returns a managed Timer or creates a new one with a custom Timer configuration.
    timer(String name, Map<String,String> tags)
    Returns a managed Timer or creates a new one with the default Timer configuration.

    Methods inherited from class io.github.resilience4j.core.registry.AbstractRegistry

    addConfiguration, computeIfAbsent, find, getAllTags, getConfiguration, getDefaultConfig, getEventPublisher, getTags, remove, removeConfiguration, replace

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.github.resilience4j.core.Registry

    addConfiguration, find, getConfiguration, getDefaultConfig, getEventPublisher, getTags, remove, removeConfiguration, replace
  • Constructor Details

    • InMemoryTimerRegistry

      public InMemoryTimerRegistry(Map<String,TimerConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Timer>> registryEventConsumers, Map<String,String> tags, io.micrometer.core.instrument.MeterRegistry meterRegistry)
    • InMemoryTimerRegistry

      public InMemoryTimerRegistry(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)
  • Method Details

    • getAllTimers

      public Stream<Timer> getAllTimers()
      Description copied from interface: TimerRegistry
      Returns all managed Timer instances.
      Specified by:
      getAllTimers in interface TimerRegistry
      Returns:
      all managed Timer instances.
    • timer

      public Timer timer(String name)
      Description copied from interface: TimerRegistry
      Returns a managed Timer or creates a new one with the default Timer configuration.
      Specified by:
      timer in interface TimerRegistry
      Parameters:
      name - the name of the Timer
      Returns:
      The Timer
    • timer

      public Timer timer(String name, Map<String,String> tags)
      Description copied from interface: TimerRegistry
      Returns a managed Timer or creates a new one with the default Timer configuration.

      The tags passed 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.

      Specified by:
      timer in interface TimerRegistry
      Parameters:
      name - the name of the Timer
      tags - tags added to the Timer
      Returns:
      The Timer
    • timer

      public Timer timer(String name, TimerConfig config)
      Description copied from interface: TimerRegistry
      Returns a managed Timer or creates a new one with a custom Timer configuration.
      Specified by:
      timer in interface TimerRegistry
      Parameters:
      name - the name of the Timer
      config - a custom Timer configuration
      Returns:
      The Timer
    • timer

      public Timer timer(String name, TimerConfig timerConfig, Map<String,String> tags)
      Description copied from interface: TimerRegistry
      Returns a managed Timer or creates a new one with a custom Timer configuration.

      The tags passed 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.

      Specified by:
      timer in interface TimerRegistry
      Parameters:
      name - the name of the Timer
      timerConfig - a custom Timer configuration
      tags - tags added to the Timer
      Returns:
      The Timer
    • timer

      public Timer timer(String name, Supplier<TimerConfig> timerConfigSupplier)
      Description copied from interface: TimerRegistry
      Returns a managed TimerConfig or creates a new one with a custom TimerConfig configuration.
      Specified by:
      timer in interface TimerRegistry
      Parameters:
      name - the name of the TimerConfig
      timerConfigSupplier - a supplier of a custom TimerConfig configuration
      Returns:
      The TimerConfig
    • timer

      public Timer timer(String name, Supplier<TimerConfig> timerConfigSupplier, Map<String,String> tags)
      Description copied from interface: TimerRegistry
      Returns a managed Timer or creates a new one with a custom Timer configuration.

      The tags passed 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.

      Specified by:
      timer in interface TimerRegistry
      Parameters:
      name - the name of the Timer
      timerConfigSupplier - a supplier of a custom Timer configuration
      tags - tags added to the Timer
      Returns:
      The Timer
    • timer

      public Timer timer(String name, String configName)
      Description copied from interface: TimerRegistry
      Returns a managed Timer or creates a new one. The configuration must have been added upfront via Registry.addConfiguration(String, Object).
      Specified by:
      timer in interface TimerRegistry
      Parameters:
      name - the name of the Timer
      configName - the name of the shared configuration
      Returns:
      The Timer
    • timer

      public Timer timer(String name, String configName, Map<String,String> tags)
      Description copied from interface: TimerRegistry
      Returns a managed Timer or creates a new one. The configuration must have been added upfront via Registry.addConfiguration(String, Object).

      The tags passed 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.

      Specified by:
      timer in interface TimerRegistry
      Parameters:
      name - the name of the Timer
      configName - the name of the shared configuration
      tags - tags added to the Timer
      Returns:
      The Timer