public static class MessageTimerMonitor.Builder extends Object
MessageTimerMonitor
.
The Clock
is defaulted to a Clock.SYSTEM
, the tagsBuilder
to a Function
returning
Tags.empty()
and the timerCustomization
to a no-op. The meterNamePrefix
and MeterRegistry
are hard requirements and as such should be provided.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
MessageTimerMonitor |
build()
Initializes a
MessageTimerMonitor as specified through this Builder. |
MessageTimerMonitor.Builder |
clock(io.micrometer.core.instrument.Clock clock)
Sets the
Clock used to define the processing duration of a given message being pushed through this
MessageMonitor . |
MessageTimerMonitor.Builder |
meterNamePrefix(String meterNamePrefix)
Sets the name used to prefix the names of the
Timer instances created by this MessageMonitor . |
MessageTimerMonitor.Builder |
meterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
Specifies the
MeterRegistry used to registered the Timer instances to. |
MessageTimerMonitor.Builder |
tagsBuilder(Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
Configures the
Function used to deduce what the Tag s should be for a message being monitored. |
MessageTimerMonitor.Builder |
timerCustomization(UnaryOperator<io.micrometer.core.instrument.Timer.Builder> timerCustomization)
Allows for specifying a customization which will be added during the creation of the
Timer . |
protected void |
validate()
Validate whether the fields contained in this Builder as set accordingly.
|
public MessageTimerMonitor.Builder meterNamePrefix(String meterNamePrefix)
Timer
instances created by this MessageMonitor
.meterNamePrefix
- a String
used to prefix the names of the Timer
instances created by
this MessageMonitor
public MessageTimerMonitor.Builder meterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
MeterRegistry
used to registered the Timer
instances to.meterRegistry
- the MeterRegistry
used to registered the Timer
instances topublic MessageTimerMonitor.Builder clock(io.micrometer.core.instrument.Clock clock)
Clock
used to define the processing duration of a given message being pushed through this
MessageMonitor
. Defaults to the Clock.SYSTEM
.clock
- the Clock
used to define the processing duration of a given messagepublic MessageTimerMonitor.Builder tagsBuilder(Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
Function
used to deduce what the Tag
s should be for a message being monitored.
Defaults to a Function
returning Tags.empty()
.tagsBuilder
- a Function
used to deduce what the Tag
s should be for a message being
monitoredpublic MessageTimerMonitor.Builder timerCustomization(UnaryOperator<io.micrometer.core.instrument.Timer.Builder> timerCustomization)
Timer
. Defaults
to a no-op. This for example allows more fine grained control over the published percentiles used by the
Timer
.
Without any customization, a Timer
define the Timer.Builder#distributionStatisticExpiry(Duration)
with a Duration
of 10 minutes and Timer.Builder#publishPercentiles(double...)
with the
percentiles 0.5
, 0.75
, 0.95
, 0.98
, 0.99
and 0.999
.
timerCustomization
- a UnaryOperator
taking in and returning a Timer.Builder
forming a
customization on the Timer
being createdpublic MessageTimerMonitor build()
MessageTimerMonitor
as specified through this Builder.MessageTimerMonitor
as specified through this Builderprotected void validate()
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2022. All rights reserved.