Class EventProcessorLatencyMonitor.Builder

java.lang.Object
org.axonframework.extension.metrics.micrometer.EventProcessorLatencyMonitor.Builder
Enclosing class:
EventProcessorLatencyMonitor

public static class EventProcessorLatencyMonitor.Builder extends Object
Builder class to instantiate a EventProcessorLatencyMonitor.

The tagsBuilder is defaulted to a Function returning Tags.empty() and the Clock to a a Clock.SYSTEM. The meterNamePrefix and MeterRegistry are hard requirements and as such should be provided.

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • meterNamePrefix

      public EventProcessorLatencyMonitor.Builder meterNamePrefix(String meterNamePrefix)
      Sets the name used to prefix the names of the Gauge instances created by this MessageMonitor.
      Parameters:
      meterNamePrefix - a String used to prefix the names of the Gauge instances created by this MessageMonitor
      Returns:
      the current Builder instance, for fluent interfacing
    • meterRegistry

      public EventProcessorLatencyMonitor.Builder meterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
      Specifies the MeterRegistry used to registered the Gauge instances to.
      Parameters:
      meterRegistry - the MeterRegistry used to registered the Gauge instances to
      Returns:
      the current Builder instance, for fluent interfacing
    • clock

      public EventProcessorLatencyMonitor.Builder clock(io.micrometer.core.instrument.Clock clock)
      Sets the Clock used to define the processing duration of a given message being pushed through this MessageMonitor. Defaults to the Clock.SYSTEM.
      Parameters:
      clock - the Clock used to define the processing duration of a given message
      Returns:
      the current Builder instance, for fluent interfacing
    • tagsBuilder

      public EventProcessorLatencyMonitor.Builder tagsBuilder(Function<Message,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
      Configures the Function used to deduce what the Tags should be for a message being monitored. Defaults to a Function returning Tags.empty().
      Parameters:
      tagsBuilder - a Function used to deduce what the Tags should be for a message being monitored
      Returns:
      the current Builder instance, for fluent interfacing
    • build

      Initializes a MessageTimerMonitor as specified through this Builder.
      Returns:
      a MessageTimerMonitor as specified through this Builder
    • validate

      protected void validate()
      Validate whether the fields contained in this Builder as set accordingly.
      Throws:
      AxonConfigurationException - if one field is asserted to be incorrect according to the Builder's specifications