public class GlobalMetricRegistry extends Object
Constructor and Description |
---|
GlobalMetricRegistry()
Initializes a new
GlobalMetricRegistry delegating to a new MeterRegistry with default settings. |
GlobalMetricRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
Initializes a
GlobalMetricRegistry delegating to the given meterRegistry . |
Modifier and Type | Method and Description |
---|---|
io.micrometer.core.instrument.MeterRegistry |
getRegistry()
Returns the global
MeterRegistry to which components are registered. |
MessageMonitor<? super CommandMessage<?>> |
registerCommandBus(String name)
Registers new metrics to the registry to monitor a
CommandBus . |
MessageMonitor<? extends Message<?>> |
registerComponent(Class<?> componentType,
String componentName)
Registers new metrics to the registry to monitor a component of given
type . |
MessageMonitor<? super EventMessage<?>> |
registerEventBus(String name)
Registers new metrics to the registry to monitor an
EventBus . |
MessageMonitor<? super EventMessage<?>> |
registerEventProcessor(String name)
Registers new metrics to the registry to monitor an
EventProcessor . |
MessageMonitor<? super QueryMessage<?,?>> |
registerQueryBus(String name)
Registers new metrics to the registry to monitor a
QueryBus . |
Configurer |
registerWithConfigurer(Configurer configurer)
Registers the metric registry with the given
configurer via
Configurer.configureMessageMonitor(Function) . |
public GlobalMetricRegistry()
GlobalMetricRegistry
delegating to a new MeterRegistry
with default settings.public GlobalMetricRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
GlobalMetricRegistry
delegating to the given meterRegistry
.meterRegistry
- the metric registry which will record the metricspublic Configurer registerWithConfigurer(Configurer configurer)
configurer
via
Configurer.configureMessageMonitor(Function)
.
Components registered by the configurer will be added by invocation of registerComponent(Class, String)
.configurer
- the application's configurerpublic MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName)
type
. The monitor will be
registered with the registry under the given name
. The returned MessageMonitor
can be installed
on the component to initiate the monitoring.componentType
- the type of component to registercomponentName
- the name under which the component should be registered to the registryIllegalArgumentException
- if the component type is not recognizedpublic MessageMonitor<? super EventMessage<?>> registerEventProcessor(String name)
EventProcessor
. The monitor will be registered with
the registry under the given eventProcessorName
. The returned MessageMonitor
can be installed
on the event processor to initiate the monitoring.name
- the name under which the EventProcessor should be registered to the registrypublic MessageMonitor<? super EventMessage<?>> registerEventBus(String name)
EventBus
. The monitor will be registered with the
registry under the given name
. The returned MessageMonitor
can be installed
on the event bus to initiate the monitoring.name
- the name under which the eventBus should be registered to the registrypublic MessageMonitor<? super CommandMessage<?>> registerCommandBus(String name)
CommandBus
. The monitor will be registered with the
registry under the given name
. The returned MessageMonitor
can be installed
on the command bus to initiate the monitoring.name
- the name under which the commandBus should be registered to the registrypublic MessageMonitor<? super QueryMessage<?,?>> registerQueryBus(String name)
QueryBus
. The monitor will be registered with the
registry under the given name
. The returned MessageMonitor
can be installed
on the command bus to initiate the monitoring.name
- the name under which the commandBus should be registered to the registrypublic io.micrometer.core.instrument.MeterRegistry getRegistry()
MeterRegistry
to which components are registered.Copyright © 2010–2019. All rights reserved.