topk-others-avg
Input Stack:k: Int | stat: String | expr: TimeSeriesExpr |
|
⇨ |
Output Stack: |
Select the top K time series based on a summary statistic and include an average aggregate
of all other excluded series. This combines :topk with an additional "others"
series showing the average of the time series that were not in the top K.
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 highest-ranking series to keep (positive integer)
Behavior
- Selection: Performs the same selection as :topk
- Aggregation: Computes the average of all remaining (excluded) time series
- Output: Returns the top K series plus one additional "others" series
Examples
Top 2 clusters with average of the rest:
Before | After |
 |  |
name,sps,:eq,
(,nf.cluster,),:by
| name,sps,:eq,
(,nf.cluster,),:by,
max,2,:topk-others-avg
|
Since: 1.7