Skip to main content

rebuild_published

Function rebuild_published 

Source
fn rebuild_published(
    working: &BTreeMap<(String, Vec<(String, String)>, Option<u64>, Option<MetricKind>, bool, String), i64>,
) -> (BTreeMap<(String, Vec<(String, String)>), (f64, MetricKind, String)>, u64, u64)
Expand description

Collapses the live, representable rows of working into one published entry per (metric_name, labels) series and counts colliding and null-suppressed series.

A series collides when more than one distinct live non-null value exists for its (metric_name, labels): a genuine conflict of two source rows, unlike an ordinary value update whose old row is retracted and new row inserted within the same closed timestamp, which leaves a single live value. When a series collides, the winner is chosen deterministically as the row with the numerically smallest value, breaking ties by metric type then help. A null value carries no number to compare or publish: a series whose live rows are all null-valued is absent from published (a gap) and counted in the returned null_values instead of collisions. A series with at least one live non-null value publishes normally and is not counted in null_values, even if null-valued rows are also live for it.