Class EventProcessorLatencyMonitor.Builder
java.lang.Object
org.axonframework.extension.metrics.micrometer.EventProcessorLatencyMonitor.Builder
- Enclosing class:
EventProcessorLatencyMonitor
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aMessageTimerMonitoras specified through this Builder.clock(io.micrometer.core.instrument.Clock clock) Sets theClockused to define the processing duration of a given message being pushed through thisMessageMonitor.meterNamePrefix(String meterNamePrefix) Sets the name used to prefix the names of theGaugeinstances created by thisMessageMonitor.meterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry) Specifies theMeterRegistryused to registered theGaugeinstances to.tagsBuilder(Function<Message, Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder) Configures theFunctionused to deduce what theTags should be for a message being monitored.protected voidvalidate()Validate whether the fields contained in this Builder as set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
meterNamePrefix
Sets the name used to prefix the names of theGaugeinstances created by thisMessageMonitor.- Parameters:
meterNamePrefix- aStringused to prefix the names of theGaugeinstances created by thisMessageMonitor- Returns:
- the current Builder instance, for fluent interfacing
-
meterRegistry
public EventProcessorLatencyMonitor.Builder meterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry) Specifies theMeterRegistryused to registered theGaugeinstances to.- Parameters:
meterRegistry- theMeterRegistryused to registered theGaugeinstances to- Returns:
- the current Builder instance, for fluent interfacing
-
clock
Sets theClockused to define the processing duration of a given message being pushed through thisMessageMonitor. Defaults to theClock.SYSTEM.- Parameters:
clock- theClockused 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 theFunctionused to deduce what theTags should be for a message being monitored. Defaults to aFunctionreturningTags.empty().- Parameters:
tagsBuilder- aFunctionused to deduce what theTags should be for a message being monitored- Returns:
- the current Builder instance, for fluent interfacing
-
build
Initializes aMessageTimerMonitoras specified through this Builder.- Returns:
- a
MessageTimerMonitoras 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
-