reduce_to.go
reduce_to.go - Overview
This file implements the logic for applying reduce-to operators to time series data. Reduce-to operators aggregate multiple data points in a time series into a single value, allowing for concise representation of data in table or value panels.
Detailed Documentation
applyReduceTo
Purpose:
Applies a reduce-to operator (e.g., last, sum, avg, min, max) to each time series in a query result, reducing the series to a single data point representing the aggregated value.
Parameters:
result
([]*v3.Result): The slice of query results to process.queryRangeParams
(*v3.QueryRangeParamsV3): The query range parameters, including the composite query and builder queries containing the reduce-to operator definition.
Returns:
None. The function modifies the result
slice in place, reducing the series to single values as necessary.
Include in Getting Started: NO