Struct ProjectionLag
- Namespace
- Excalibur.EventSourcing.Projections
- Assembly
- Excalibur.EventSourcing.dll
The projection lag for a single subscription at a point in time.
public readonly record struct ProjectionLag : IEquatable<ProjectionLag>
- Implements
- Inherited Members
Remarks
CheckpointPosition is nullable because a configured subscription that has never run has no checkpoint row, and that is not the same fact as a checkpoint of zero. While this was a plain long the distinction was inexpressible, so a subscription with a large backlog and no first run was reported as nothing at all — the lag report held zero entries, which the health check read as "no subscription is behind" and published as healthy. A count of zero checkpoint rows is evidence of no recorded progress, never evidence of no configured subscription.
Constructors
ProjectionLag(string, long?, long, long)
The projection lag for a single subscription at a point in time.
public ProjectionLag(string SubscriptionName, long? CheckpointPosition, long HeadPosition, long Lag)
Parameters
SubscriptionNamestringThe unique subscription identifier.
CheckpointPositionlong?The subscription's last checkpointed global-stream position, or null when it has recorded NO progress at all.
HeadPositionlongThe current global-stream head position.
LaglongThe number of events the subscription trails the head, computed as
max(0,, or the whole head when there is no checkpoint, because such a subscription must process the stream from its beginning.HeadPosition-CheckpointPosition)
Remarks
CheckpointPosition is nullable because a configured subscription that has never run has no checkpoint row, and that is not the same fact as a checkpoint of zero. While this was a plain long the distinction was inexpressible, so a subscription with a large backlog and no first run was reported as nothing at all — the lag report held zero entries, which the health check read as "no subscription is behind" and published as healthy. A count of zero checkpoint rows is evidence of no recorded progress, never evidence of no configured subscription.
Properties
CheckpointPosition
The subscription's last checkpointed global-stream position, or null when it has recorded NO progress at all.
public long? CheckpointPosition { get; init; }
Property Value
- long?
HeadPosition
The current global-stream head position.
public long HeadPosition { get; init; }
Property Value
Lag
The number of events the subscription trails the head, computed as
max(0, , or the whole
head when there is no checkpoint, because such a subscription must process the stream from its
beginning.HeadPosition - CheckpointPosition)
public long Lag { get; init; }
Property Value
SubscriptionName
The unique subscription identifier.
public string SubscriptionName { get; init; }