limit.go
limit.go - Overview
This file implements the logic for applying limits to metric query results. It allows restricting the number of time series returned based on sorting criteria.
Detailed Documentation
ApplyMetricLimit
Purpose:
Applies a limit to the number of time series in a metric query result, sorting the series based on the specified order-by criteria before applying the limit.
Parameters:
results
([]*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 limit and order-by information.
Returns:
None. The function modifies the results
slice in place, limiting the number of series as necessary.
Include in Getting Started: NO