frame

Description

Specify the relative time frame for a window context. The frame will start from the current row’s “Valid From” time minus “back”, and end 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 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( back, ahead )

Argument

Type

Required

Multiple

back

expression

Required

Only one

ahead

expression

Required

Only one

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