Skip to main content

limit_ratio

Function limit_ratio 

Source
pub fn limit_ratio(
    ratio: f64,
    schema: &SeriesSchema,
    series: &[Series],
) -> Result<Vec<Series>>
Expand description

limit_ratio(r, ...) with a constant r.

Keeps whole series: Prometheus derives an offset in [0, 1) from the hash of a series’ labels and keeps the series when the offset is below r, or, for a negative r, at least 1 + r. Which series are kept does not depend on the grouping, so it is not a parameter. The hash is the one of Prometheus’ default stringlabels build; the other label builds hash differently.