Enum ProjectionLagAvailability
- Namespace
- Excalibur.EventSourcing.Projections
- Assembly
- Excalibur.EventSourcing.dll
Whether projection lag could be measured.
public enum ProjectionLagAvailability
Fields
CheckpointAheadOfHead = 1The head was read, but at least one checkpoint reports a position ABOVE it. That is impossible under correct wiring, so the numbers are reported but must not be read as lag.
Why this is a distinct state rather than a clamped zero. The head is, by construction, at least every position that has been delivered to any subscription, so a checkpoint cannot exceed it while the head source and the event store describe the same stream. A non-negative clamp is still correct arithmetic — lag is never negative — but clamping ALONE discards the one observation that proves the configuration is wrong, and reports the result as a measurement that found nothing behind. The clamp absorbs a transient disagreement, which is what it was written for, and it also absorbed the permanent one.
The likeliest cause is a head source that does not describe the store being written. Every global-stream query registration in this framework is a
TryAdd, and the global-stream query is not registered under a key, so in a host that configures two event-store providers the first registration wins and cannot be selected against. The event store itself IS selectable by key, so a host can end up writing to one store and reading its stream head from another — durable writes, an empty head, and every subscription appearing caught up.Treat this as a configuration fault, not as lag. The entries are still reported, with their non-negative clamped values, so an operator can see WHICH subscriptions are implicated.
Measured = 0The global-stream head was read, so the reported entries are a measurement. An empty set of entries means no subscription is behind.
NoHeadSource = 2No global-stream head source is registered, so there is nothing to subtract a checkpoint from and lag is undefined. The reported entries are empty because nothing was measured — NOT because nothing is behind.
A host reaches this state by registering the lag read model without an event-store head source. It is a configuration gap rather than a runtime fault, which is exactly why it must be reported rather than thrown: a monitoring surface should degrade to "not reporting", never to "all clear".