Skip to main content

limitk

Function limitk 

Source
pub fn limitk(
    k: f64,
    grouping: &Grouping,
    schema: &SeriesSchema,
    series: &[Series],
) -> Result<Vec<Series>>
Expand description

limitk(k, ...) with a constant k.

At every point each group keeps the first k series in input order that hold a sample there, float or histogram, with their labels and values. Prometheus takes them in the order its storage returns series: label order once a query reads several queriers (the head and a block), creation order when the TSDB head alone answers it. A caller that wants Prometheus’ result over persisted data passes the series in label order.