Class GlobalMetricRegistry
java.lang.Object
org.axonframework.extension.metrics.dropwizard.GlobalMetricRegistry
Registry for application metrics with convenient ways to register Axon components.
- Since:
- 3.0.0
- Author:
- Rene de Waele
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a newGlobalMetricRegistrydelegating to a newMetricRegistrywith default settings.GlobalMetricRegistry(com.codahale.metrics.MetricRegistry metricRegistry) Initializes aGlobalMetricRegistrydelegating to the givenmetricRegistry. -
Method Summary
Modifier and TypeMethodDescriptioncom.codahale.metrics.MetricRegistryReturns the globalMetricRegistryto which components are registered.MessageMonitor<? super CommandMessage> registerCommandBus(String commandBusName) Registers new metrics to the registry to monitor aCommandBus.MessageMonitor<? extends Message> registerComponent(Class<?> componentType, String componentName) Registers new metrics to theMetricRegistryto monitor a component of givencomponentType.MessageMonitor<? super EventMessage> registerEventBus(String eventBusName) Registers new metrics to the registry to monitor anEventBus.MessageMonitor<? super EventMessage> registerEventProcessor(String eventProcessorName) Registers new metrics to the registry to monitor anEventProcessor.MessageMonitor<? super QueryMessage> registerQueryBus(String queryBusName) Registers new metrics to the registry to monitor aQueryBus.
-
Constructor Details
-
GlobalMetricRegistry
public GlobalMetricRegistry()Initializes a newGlobalMetricRegistrydelegating to a newMetricRegistrywith default settings. -
GlobalMetricRegistry
public GlobalMetricRegistry(com.codahale.metrics.MetricRegistry metricRegistry) Initializes aGlobalMetricRegistrydelegating to the givenmetricRegistry.- Parameters:
metricRegistry- theMetricRegistrywhich will record the metrics
-
-
Method Details
-
registerComponent
public MessageMonitor<? extends Message> registerComponent(Class<?> componentType, String componentName) Registers new metrics to theMetricRegistryto monitor a component of givencomponentType. The monitor will be registered with the registry under the givencomponentName. The returnedMessageMonitorcan be installed on the component to initiate the monitoring.- Parameters:
componentType- the type of component to registercomponentName- the name under which the component should be registered to the registry- Returns:
- a
MessageMonitorto monitor the behavior of the givencomponentType
-
registerEventProcessor
Registers new metrics to the registry to monitor anEventProcessor. The monitor will be registered with the registry under the giveneventProcessorName. The returnedMessageMonitorcan be installed on theEventProcessorto initiate the monitoring.- Parameters:
eventProcessorName- the name under which theEventProcessorshould be registered to the registry- Returns:
- a
MessageMonitorto monitor the behavior of anEventProcessor
-
registerCommandBus
Registers new metrics to the registry to monitor aCommandBus. The monitor will be registered with the registry under the givencommandBusName. The returnedMessageMonitorcan be installed on theCommandBusto initiate the monitoring.- Parameters:
commandBusName- the name under which the commandBus should be registered to the registry- Returns:
- a
MessageMonitorto monitor the behavior of a CommandBus
-
registerEventBus
Registers new metrics to the registry to monitor anEventBus. The monitor will be registered with the registry under the giveneventBusName. The returnedMessageMonitorcan be installed on theEventBusto initiate the monitoring.- Parameters:
eventBusName- the name under which theEventBusshould be registered to the registry- Returns:
- a
MessageMonitorto monitor the behavior of anEventBus
-
registerQueryBus
Registers new metrics to the registry to monitor aQueryBus. The monitor will be registered with the registry under the givenqueryBusName. The returnedMessageMonitorcan be installed on theQueryBusto initiate the monitoring.- Parameters:
queryBusName- the name under which theQueryBusshould be registered to the registry- Returns:
- a
MessageMonitorto monitor the behavior of aQueryBus
-
getRegistry
public com.codahale.metrics.MetricRegistry getRegistry()Returns the globalMetricRegistryto which components are registered.- Returns:
- the global registry
-