TopN

Filters and sorts the time series by the total aggregation (over time) value and returns the top or bottom series based on that aggregation. E.g. find the top 10 hosts using the most memory or the 5 coldest regions over a day.

Fields include:

Name

Data Type

Required

Description

Default

Example

aggregator

String

Required

The aggregation function to use to compute the sorting value.

null

sum

top

Boolean

Optional

Whether or not to return the highest results (True) or lowest results (False).

false

true

count

Integer

Required

The number of results to return.

null

10

infectiousNan

Boolean

Optional

Whether or not NaNs from the source data should infect the final aggregation. E.g. if one value out of 20 are NaN in the source this is true, the aggregation will return a NaN. If all values in the source are NaN then the result will be NaN regardless.

false

true

Example:

{
      "start": "1h-ago",
      "executionGraph": [{
                      "id": "m1",
                      "type": "TimeSeriesDataSource",
                      "metric": {
                              "type": "MetricLiteral",
                              "metric": "sys.if.in"
                      }
              },
              {
                      "id": "ds1",
                      "type": "downsample",
                      "aggregator": "sum",
                      "interval": "1m",
                      "runAll": false,
                      "fill": true,
                      "interpolatorConfigs": [{
                              "dataType": "numeric",
                              "fillPolicy": "NAN",
                              "realFillPolicy": "NONE"
                      }],
                      "sources": ["m1"]
              },
              {
                      "id": "top1",
                      "type": "topn",
                      "aggregator": "avg",
           "top": "true",
                      "sources": ["ds1"]
              }
      ]
  }