Class EventProcessorLatencyMonitor
- All Implemented Interfaces:
MessageMonitor<EventMessage<?>>
MessageMonitor implementation dedicated to EventMessages.
This monitor defines the latency between the EventMessage.getTimestamp() and the Clock.wallTime().
Doing so, it depicts the latency from when an event was published compared to when an
EventProcessor processes the event to clarify how far behind an
EventProcessor is.
Do note that a replay (as triggered through StreamingEventProcessor.resetTokens(), for example) will cause
this metric to bump up due to the processor handling old events.
- Since:
- 4.1
- Author:
- Marijn van Zelst, Ivan Dugalic, Allard Buijze
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class to instantiate aEventProcessorLatencyMonitor.Nested classes/interfaces inherited from interface org.axonframework.monitoring.MessageMonitor
MessageMonitor.MonitorCallback -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiate aEventProcessorLatencyMonitorbased on the fields contained in theEventProcessorLatencyMonitor.Builder. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Instantiate a Builder to be able to create aEventProcessorLatencyMonitor.static EventProcessorLatencyMonitorbuildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry) Deprecated.static EventProcessorLatencyMonitorbuildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry, Function<Message<?>, Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder) Deprecated.in favor of using thebuilder()onMessageIngested(EventMessage<?> message) Takes a message and returns a callback that should be used to inform the message monitor about the result of processing the messageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.monitoring.MessageMonitor
onMessagesIngested
-
Constructor Details
-
EventProcessorLatencyMonitor
Instantiate aEventProcessorLatencyMonitorbased on the fields contained in theEventProcessorLatencyMonitor.Builder.Will assert that the
meterNamePrefixandMeterRegistryare notnulland will throw anAxonConfigurationExceptionif this is the case.- Parameters:
builder- theEventProcessorLatencyMonitor.Builderused to instantiate aEventProcessorLatencyMonitorinstance
-
-
Method Details
-
builder
Instantiate a Builder to be able to create aEventProcessorLatencyMonitor.The
tagsBuilderis defaulted to aFunctionreturningTags.empty()and theClockto a aClock.SYSTEM. ThemeterNamePrefixandMeterRegistryare hard requirements and as such should be provided.- Returns:
- a Builder to be able to create a
EventProcessorLatencyMonitor
-
buildMonitor
@Deprecated public static EventProcessorLatencyMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry) Deprecated.in favor of using thebuilder()Build anEventProcessorLatencyMonitor- Parameters:
meterNamePrefix- the prefix for the meter name that will be created in the givenmeterRegistrymeterRegistry- the meter registry used to create and register the meters- Returns:
- the created
EventProcessorLatencyMonitor
-
buildMonitor
@Deprecated public static EventProcessorLatencyMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry, Function<Message<?>, Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder) Deprecated.in favor of using thebuilder()Build anEventProcessorLatencyMonitor.- Parameters:
meterNamePrefix- the prefix for the meter name that will be created in the givenmeterRegistrymeterRegistry- the meter registry used to create and register the meterstagsBuilder- the function used to construct the list of micrometerTag, based on the ingested message- Returns:
- the created
EventProcessorLatencyMonitor
-
onMessageIngested
Description copied from interface:MessageMonitorTakes a message and returns a callback that should be used to inform the message monitor about the result of processing the message- Specified by:
onMessageIngestedin interfaceMessageMonitor<EventMessage<?>>- Parameters:
message- the message to monitor- Returns:
- the callback
-
builder()