Class EventProcessorLatencyMonitor
java.lang.Object
org.axonframework.extension.metrics.dropwizard.EventProcessorLatencyMonitor
- All Implemented Interfaces:
com.codahale.metrics.Metric,com.codahale.metrics.MetricSet,MessageMonitor<EventMessage>
public class EventProcessorLatencyMonitor
extends Object
implements MessageMonitor<EventMessage>, com.codahale.metrics.MetricSet
A
MessageMonitor implementation dedicated to EventMessages.
This monitor defines the latency between the EventMessage.timestamp() and the Clock.instant().
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:
- 3.0
- Author:
- Marijn van Zelst, Allard Buijze
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.axonframework.messaging.monitoring.MessageMonitor
MessageMonitor.MonitorCallback -
Constructor Summary
ConstructorsConstructorDescriptionConstruct anEventProcessorLatencyMonitorusing aClock.systemUTC().Construct anEventProcessorLatencyMonitorusing the givenclock. -
Method Summary
Modifier and TypeMethodDescriptiononMessageIngested(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
public EventProcessorLatencyMonitor()Construct anEventProcessorLatencyMonitorusing aClock.systemUTC(). -
EventProcessorLatencyMonitor
Construct anEventProcessorLatencyMonitorusing the givenclock.- Parameters:
clock- defines theClockused by thisMessageMonitorimplementation
-
-
Method Details
-
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
-
getMetrics
- Specified by:
getMetricsin interfacecom.codahale.metrics.MetricSet
-