Class MessageTimerMonitor.Builder
java.lang.Object
org.axonframework.extension.metrics.dropwizard.MessageTimerMonitor.Builder
- Enclosing class:
MessageTimerMonitor
Builder class to instantiate a
MessageTimerMonitor.
The Clock is defaulted to a Clock.defaultClock() and the reservoirFactory defaults to
creating a ExponentiallyDecayingReservoir.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aMessageTimerMonitoras specified through this Builder.clock(com.codahale.metrics.Clock clock) Sets theClockused to define the processing duration of a given message being pushed through thisMessageMonitor.reservoirFactory(Supplier<com.codahale.metrics.Reservoir> reservoirFactory) Sets factory method creating aReservoirto be used by theTimerinstances created by thisMessageMonitor.protected voidvalidate()Validate whether the fields contained in this Builder as set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
clock
Sets theClockused to define the processing duration of a given message being pushed through thisMessageMonitor. Defaults to theClock.defaultClock().- Parameters:
clock- theClockused to define the processing duration of a given message- Returns:
- the current Builder instance, for fluent interfacing
-
reservoirFactory
public MessageTimerMonitor.Builder reservoirFactory(Supplier<com.codahale.metrics.Reservoir> reservoirFactory) Sets factory method creating aReservoirto be used by theTimerinstances created by thisMessageMonitor. Defaults to aSupplierofExponentiallyDecayingReservoir.- Parameters:
reservoirFactory- a factory method creating aReservoirto be used by theTimerinstances created by thisMessageMonitor- 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
-