Class GlobalMetricRegistry

java.lang.Object
org.axonframework.extension.metrics.dropwizard.GlobalMetricRegistry

public class GlobalMetricRegistry extends Object
Registry for application metrics with convenient ways to register Axon components.
Since:
3.0.0
Author:
Rene de Waele
  • Constructor Details

    • GlobalMetricRegistry

      public GlobalMetricRegistry()
      Initializes a new GlobalMetricRegistry delegating to a new MetricRegistry with default settings.
    • GlobalMetricRegistry

      public GlobalMetricRegistry(com.codahale.metrics.MetricRegistry metricRegistry)
      Initializes a GlobalMetricRegistry delegating to the given metricRegistry.
      Parameters:
      metricRegistry - the MetricRegistry which will record the metrics
  • Method Details

    • registerComponent

      public MessageMonitor<? extends Message> registerComponent(Class<?> componentType, String componentName)
      Registers new metrics to the MetricRegistry to monitor a component of given componentType. The monitor will be registered with the registry under the given componentName. The returned MessageMonitor can be installed on the component to initiate the monitoring.
      Parameters:
      componentType - the type of component to register
      componentName - the name under which the component should be registered to the registry
      Returns:
      a MessageMonitor to monitor the behavior of the given componentType
    • registerEventProcessor

      public MessageMonitor<? super EventMessage> registerEventProcessor(String eventProcessorName)
      Registers new metrics to the registry to monitor an EventProcessor. The monitor will be registered with the registry under the given eventProcessorName. The returned MessageMonitor can be installed on the EventProcessor to initiate the monitoring.
      Parameters:
      eventProcessorName - the name under which the EventProcessor should be registered to the registry
      Returns:
      a MessageMonitor to monitor the behavior of an EventProcessor
    • registerCommandBus

      public MessageMonitor<? super CommandMessage> registerCommandBus(String commandBusName)
      Registers new metrics to the registry to monitor a CommandBus. The monitor will be registered with the registry under the given commandBusName. The returned MessageMonitor can be installed on the CommandBus to initiate the monitoring.
      Parameters:
      commandBusName - the name under which the commandBus should be registered to the registry
      Returns:
      a MessageMonitor to monitor the behavior of a CommandBus
    • registerEventBus

      public MessageMonitor<? super EventMessage> registerEventBus(String eventBusName)
      Registers new metrics to the registry to monitor an EventBus. The monitor will be registered with the registry under the given eventBusName. The returned MessageMonitor can be installed on the EventBus to initiate the monitoring.
      Parameters:
      eventBusName - the name under which the EventBus should be registered to the registry
      Returns:
      a MessageMonitor to monitor the behavior of an EventBus
    • registerQueryBus

      public MessageMonitor<? super QueryMessage> registerQueryBus(String queryBusName)
      Registers new metrics to the registry to monitor a QueryBus. The monitor will be registered with the registry under the given queryBusName. The returned MessageMonitor can be installed on the QueryBus to initiate the monitoring.
      Parameters:
      queryBusName - the name under which the QueryBus should be registered to the registry
      Returns:
      a MessageMonitor to monitor the behavior of a QueryBus
    • getRegistry

      public com.codahale.metrics.MetricRegistry getRegistry()
      Returns the global MetricRegistry to which components are registered.
      Returns:
      the global registry