Class MetricsConfigurationEnhancer

java.lang.Object
org.axonframework.extension.metrics.dropwizard.MetricsConfigurationEnhancer
All Implemented Interfaces:
ConfigurationEnhancer

public class MetricsConfigurationEnhancer extends Object implements ConfigurationEnhancer
Implementation of the ConfigurationEnhancer that uses the MetricRegistry to decorate several components with MessageMonitors with unique MetricRegistries by registering MessageMonitorFactories with the MessageMonitorRegistry.

Components that are decorated are:

  • Any CommandBus implementation present in the ComponentRegistry receives a
    invalid @link
    {@link MessageCountingMonitor), {@link MessageTimerMonitor
    }, and CapacityMonitor.
  • Any EventSink implementation present in the ComponentRegistry receives a invalid input: '{@code MessageCountingMonitor) and {@code MessageTimerMonitor}.</li> <li>Any {@link EventProcessor} implementation present in the {@link ComponentRegistry} receives a {@code MessageCountingMonitor), {@code MessageTimerMonitor}, {@code CapacityMonitor}, and {@link EventProcessorLatencyMonitor}.</li> <li>Any {@link QueryBus} implementation present in the {@link ComponentRegistry} receives a {@code MessageCountingMonitor), {@code MessageTimerMonitor}, and {@code CapacityMonitor}.</li> </ul> @author Rene de Waele @author Steven van Beelen @since 3.2.0'
  • Field Details

    • ENHANCER_ORDER

      public static final int ENHANCER_ORDER
      The order of this enhancer, set to -1024.
      See Also:
  • Constructor Details

    • MetricsConfigurationEnhancer

      public MetricsConfigurationEnhancer()
      Initializes a new MetricsConfigurationEnhancer constructing MessageMonitors that are registered with a new MetricRegistry with default settings.
    • MetricsConfigurationEnhancer

      public MetricsConfigurationEnhancer(io.dropwizard.metrics5.MetricRegistry registry)
      Initializes a new MetricsConfigurationEnhancer constructing MessageMonitors that are registered with the given registry.
      Parameters:
      registry - the MetricRegistry which will record the metrics
  • Method Details

    • enhance

      public void enhance(ComponentRegistry registry)
      Description copied from interface: ConfigurationEnhancer
      Enhances the given registry with, for example, additional components and decorators.
      Specified by:
      enhance in interface ConfigurationEnhancer
      Parameters:
      registry - The registry instance to enhance.
    • order

      public int order()
      Description copied from interface: ConfigurationEnhancer
      Returns the relative order this enhancer should be invoked in, compared to other instances.

      Use lower (negative) values for enhancers providing sensible defaults, and higher values for enhancers that should be able to override values potentially previously set. Defaults to 0 when not set.

      Specified by:
      order in interface ConfigurationEnhancer
      Returns:
      The order in which this enhancer should be invoked.