timeSeriesPredictLinearToGrid
Aggregate function that takes time series data as pairs of timestamps and values and calculates a PromQL-like linear prediction with a specified prediction timestamp offset from this data on a regular time grid described by start timestamp, end timestamp and step. For each point on the grid the samples for calculating predict_linear
are considered within the specified time window.
Parameters:
start timestamp
- グリッドの開始を指定します。end timestamp
- グリッドの終了を指定します。grid step
- 秒単位でグリッドのステップを指定します。staleness
- 考慮するサンプルの最大「老朽化」を秒単位で指定します。老朽化ウィンドウは左閉じ右開きの区間です。predict_offset
- 予測時間に加える秒数を指定します。
Arguments:
timestamp
- サンプルのタイムスタンプvalue
-timestamp
に対応する時系列の値
Return value:
predict_linear
の値を指定されたグリッド上で Array(Nullable(Float64))
として返します。返される配列には、各時間グリッドポイントに対して一つの値が含まれます。特定のグリッドポイントのレート値を計算するのに十分なサンプルがウィンドウ内に存在しない場合、値は NULL になります。
Example:
次のクエリは、60秒のオフセットを持つグリッド [90, 105, 120, 135, 150, 165, 180, 195, 210] 上で predict_linear
の値を計算します。
Response:
また、タイムスタンプと値のサンプルを同じサイズの配列として複数渡すことも可能です。配列引数を使用した同じクエリは次の通りです:
この関数は実験的です。 allow_experimental_ts_to_grid_aggregate_function=true
を設定することで有効にできます。