bottomk
Input Stack:
|
⇨ | Output Stack:
|
Select the bottom K time series based on a summary statistic. This operation keeps only the K time series with the smallest values for the specified statistic, effectively filtering out all but the lowest-performing series according to the chosen criteria.
Parameters¶
- expr: The grouped time series expression to select from
- stat: The summary statistic to rank by (
max
,min
,avg
,count
,total
,last
) - k: Number of lowest-ranking series to keep (positive integer)
Behavior¶
- Statistical evaluation: Computes the specified statistic for each time series over the query window
- Ranking: Sorts all series by the statistic values in ascending order (smallest first)
- Selection: Keeps only the first K series (those with the smallest statistic values)
- Output: Returns the selected time series with their original data, not the statistic values
Examples¶
Selecting the 2 clusters with the lowest maximum values:
Before | After |
name,sps,:eq, (,nf.cluster,),:by | name,sps,:eq, (,nf.cluster,),:by, max,2,:bottomk |
Others Aggregation¶
For including aggregate summaries of the excluded series, use the :bottomk-others-*
operators:
- :bottomk-others-avg - Include average of excluded series
- :bottomk-others-max - Include maximum of excluded series
- :bottomk-others-min - Include minimum of excluded series
- :bottomk-others-sum - Include sum of excluded series
Related Operations¶
- :topk - Select top K time series (largest values)
- :limit - Limit results after sorting (different ranking criteria)
- :sort - Sort time series by statistics
- :filter - Filter based on statistical criteria
- :stat - Compute statistics used for ranking
Since: 1.7