-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Add moving average calculation type to downsampling plugin
Description:
Add support for a moving average calculation type in the downsampling plugin. This would allow users to compute rolling/sliding window averages over a configurable number of preceding rows.
Example use case:
SELECT
time,
site_id,
AVG(metric_value) OVER (
PARTITION BY metric_name, site, region, zone, site_id, group_id
ORDER BY time
ROWS BETWEEN 4 PRECEDING AND CURRENT ROW
) AS 5_sec_moving_avg
FROM measurements
WHERE
$__timeFilter(time)
AND group_id IN (${group_id:singlequote})
AND asset_id LIKE (${asset_id:singlequote})
ORDER BY time ASC
Requirements:
- New moving_avg calculation type alongside existing types (e.g. mean, sum, min, max)
- Configurable window size (number of preceding rows)
- Support for partition-by grouping on tag columns
- Results ordered by time
Configuration example:
[[calculations]]
type = "moving_avg"
window_size = 5
field = "metric_value"
partition_by = ["metric_name", "site", "region", "zone"]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request