Class EventProcessorLatencyMonitor
- All Implemented Interfaces:
MessageMonitor<EventMessage>
MessageMonitor implementation dedicated to EventMessages.
This monitor defines the latency between the EventMessage.timestamp() 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.messaging.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.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.messaging.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
-
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
-