AVG_TIME_SERIES

Gets the average value per time interval. The size of the time intervals is configurable and dynamic.

The time interval used changes depending on how many points you wish to hold per aggregation key. You can change the time interval and/or the number of points per interval to suit your graph.

Syntax

AVG_TIME_SERIES([MAX_POINTS, INTERVALS,] TIME, VALUE)

Arguments

MAX_POINTS

Type: integer

Default: 300

(Optional) The maximum amount of points to hold before reducing the resolution to the next interval size.

INTERVALS

Type: array

Default: [60000, 300000, 600000, 1800000, 3600000, 10800000, 21600000, 43200000, 86400000]

(Optional) Array of integers representing the time interval buckets in epoch ms for which to return data.

If the aggregation has more than MAX_POINTS values in the given window, it will use the next interval from this array to reduce the amount of points to comply withMAX_POINTS.

TIME

Type: numeric

The field with the time in epoch ms that VALUE is associated with.

VALUE

Type: any type

The field to average per TIME bucket.

Returns

Type: array

Returns an array of key value pairs where the key is the time (in epoch ms) and the value is the average of VALUE from within that time frame.

Last updated