public class EventProcessorLatencyMonitor extends Object implements 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.
| Modifier and Type | Class and Description |
|---|---|
static class |
EventProcessorLatencyMonitor.Builder
Builder class to instantiate a
EventProcessorLatencyMonitor. |
MessageMonitor.MonitorCallback| Modifier | Constructor and Description |
|---|---|
protected |
EventProcessorLatencyMonitor(EventProcessorLatencyMonitor.Builder builder)
Instantiate a
EventProcessorLatencyMonitor based on the fields contained in the EventProcessorLatencyMonitor.Builder. |
| Modifier and Type | Method and Description |
|---|---|
static EventProcessorLatencyMonitor.Builder |
builder()
Instantiate a Builder to be able to create a
EventProcessorLatencyMonitor. |
static EventProcessorLatencyMonitor |
buildMonitor(String meterNamePrefix,
io.micrometer.core.instrument.MeterRegistry meterRegistry)
Deprecated.
in favor of using the
builder() |
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 the
builder() |
MessageMonitor.MonitorCallback |
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 message
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonMessagesIngestedprotected EventProcessorLatencyMonitor(EventProcessorLatencyMonitor.Builder builder)
EventProcessorLatencyMonitor based on the fields contained in the EventProcessorLatencyMonitor.Builder.
Will assert that the meterNamePrefix and MeterRegistry are not null and will throw an
AxonConfigurationException if this is the case.
builder - the EventProcessorLatencyMonitor.Builder used to instantiate a EventProcessorLatencyMonitor instancepublic static EventProcessorLatencyMonitor.Builder builder()
EventProcessorLatencyMonitor.
The tagsBuilder is defaulted to a Function returning Tags.empty() and the Clock
to a a Clock.SYSTEM. The meterNamePrefix and MeterRegistry are hard requirements
and as such should be provided.
EventProcessorLatencyMonitor@Deprecated public static EventProcessorLatencyMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry)
builder()EventProcessorLatencyMonitormeterNamePrefix - the prefix for the meter name that will be created in the given meterRegistrymeterRegistry - the meter registry used to create and register the metersEventProcessorLatencyMonitor@Deprecated public static EventProcessorLatencyMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry, Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
builder()EventProcessorLatencyMonitor.meterNamePrefix - the prefix for the meter name that will be created in the given meterRegistrymeterRegistry - the meter registry used to create and register the meterstagsBuilder - the function used to construct the list of micrometer Tag, based on the ingested
messageEventProcessorLatencyMonitorpublic MessageMonitor.MonitorCallback onMessageIngested(@Nonnull EventMessage<?> message)
MessageMonitoronMessageIngested in interface MessageMonitor<EventMessage<?>>message - the message to monitorCopyright © 2010–2023. All rights reserved.