count_indexed_metrics

Function count_indexed_metrics 

Source
pub fn count_indexed_metrics<F>(
    metrics: &PayloadMetrics,
    cap: usize,
    key_fn: F,
) -> usize
where F: Fn(usize) -> String,
Expand description

Walk 0..cap applying key_fn(i) to form a metric name and count how many consecutive indices yield a present metric. Stops at the first miss — the probe’s walk_json_leaves flattening yields indices 0..N contiguously, so the first gap is the array terminator. Returns the count, which may be cap if every index below the bound is present (inconclusive — the caller should treat cap as “saturated scan, real count may be larger”).