frame

Description

Specify the approximate relative time frame for a window context.

The frame starts from the current row’s “Valid From” time minus “back”, and ends at “Valid From” plus “ahead” (both ends are inclusive). For better performance, the window frame boundaries may not be exact and can deviate by at most twice the resolution, where resolution is 1/120th of the total frame size or 10 seconds, whichever is larger. To make the window boundaries exact, at the cost of slower performance, use the frame_exact() function.

Return type

frame

Domain

This is a scalar function (calculates a single output value for a single input row.)

Categories

Usage

frame([ backOrAhead_1, backOrAhead_2, ... ])

Argument

Type

Optional

Repeatable

Restrictions

backOrAhead

expression

yes

yes

none

Examples

make_col avg:window(avg(load), group_by(host), order_by(time), frame(back:10m))

Compute the moving average of system load within the past 10 minutes of each event