top(set[], options={})

The top method operates over the entire series across the given time-window. For each series returned in the set[] list, the method will compute the given function (as specified in the options) across all points in the window. The output of that function will be a scalar value and it is used to generate a ranking of each series. From that ranking the top function will return one to N series, where the series are ordered from highest to lowest rank value. The following options are supported:

  • count: how many series to return
  • function: a function that defines the ranking algorithm by which the streams should be selected. The permitted functions are: min, max, mean, and sum. The default function is mean.

Example

The following expression will return the top 10 streams for the system.cpu.user metric based on the maximum value in the observed time period.

top(s("system.cpu.user", {"@host":"*"}), {"count": "10","function": "max"})

func_top