pub struct CheckpointMetrics { /* private fields */ }Expand description
Checkpointer handles (spate_checkpoint_*).
Implementations§
Source§impl CheckpointMetrics
impl CheckpointMetrics
Sourcepub fn new(labels: &ComponentLabels, per_partition_detail: bool) -> Self
pub fn new(labels: &ComponentLabels, per_partition_detail: bool) -> Self
Resolve all checkpointer handles.
Claims the spate_checkpoint_* series for these labels; a second live
handle set logs and becomes a shadow, counting commits but publishing
no gauge.
Sourcepub fn try_new(
labels: &ComponentLabels,
per_partition_detail: bool,
) -> Result<Self, MetricsError>
pub fn try_new( labels: &ComponentLabels, per_partition_detail: bool, ) -> Result<Self, MetricsError>
Resolve all checkpointer handles, failing when another live handle set already owns the series. The pipeline runtime’s path.
§Errors
MetricsError::DuplicateSeries on a collision.
Sourcepub fn set_pending_max(&self, pending: usize)
pub fn set_pending_max(&self, pending: usize)
Set the max pending-batch count across partitions.
Sourcepub fn publishes_partition_detail(&self) -> bool
pub fn publishes_partition_detail(&self) -> bool
Whether this handle set publishes the per-partition series.
False when per_partition_detail was not set, and false for a shadow,
which publishes no gauge.
set_partition_pending and
retain_partitions no-op in both cases. A
caller reads this to skip gathering the counts at all.
Sourcepub fn set_partition_pending(&self, partition: PartitionId, pending: usize)
pub fn set_partition_pending(&self, partition: PartitionId, pending: usize)
Set one partition’s pending count. No-op unless
per_partition_detail.
Sourcepub fn retain_partitions(&self, keep: &[PartitionId])
pub fn retain_partitions(&self, keep: &[PartitionId])
Drop per-partition series for revoked partitions.
Two things differ from
SourceMetrics::retain_partitions,
and both follow from what this family counts.
This takes the live set on every commit cycle rather than once a new
assignment is known. Zeroing a partition the runtime is about to be
handed back costs nothing, because the unlabeled series reads the same
0 from the same empty tracker map in the same cycle. The lag family
has no aggregate to agree with, so it waits instead.
This also zeroes a partition no other member will publish, where a lag
gauge holds its last value. 0 here is the count of what the
checkpointer tracks, and it tracks nothing for a partition it has
dropped, so the reading stays true. A lag of 0 instead claims the
partition is caught up, which is a claim about the world rather than
about the handle, and false for a partition still being consumed
somewhere.
Sourcepub fn set_watermark_age(&self, age: Duration)
pub fn set_watermark_age(&self, age: Duration)
Set the age of the oldest unacknowledged batch.