Compare commits

...

1 Commits

Author SHA1 Message Date
Srikanth Chekuri
5a9267d698 fix: make timeshift work with cache 2024-08-05 23:46:11 +05:30
2 changed files with 9 additions and 1 deletions

View File

@@ -306,7 +306,7 @@ func (q *querier) runBuilderQuery(
}
// response doesn't need everything
filterCachedPoints(mergedSeries, params.Start, params.End)
filterCachedPoints(mergedSeries, start, end)
ch <- channelResult{
Err: nil,

View File

@@ -346,6 +346,10 @@ func (c *cacheKeyGenerator) GenerateKeys(params *v3.QueryRangeParamsV3) map[stri
parts = append(parts, fmt.Sprintf("aggregate=%s", query.AggregateOperator))
parts = append(parts, fmt.Sprintf("limit=%d", query.Limit))
if query.ShiftBy != 0 {
parts = append(parts, fmt.Sprintf("shiftBy=%d", query.ShiftBy))
}
if query.AggregateAttribute.Key != "" {
parts = append(parts, fmt.Sprintf("aggregateAttribute=%s", query.AggregateAttribute.CacheKey()))
}
@@ -387,6 +391,10 @@ func (c *cacheKeyGenerator) GenerateKeys(params *v3.QueryRangeParamsV3) map[stri
parts = append(parts, fmt.Sprintf("timeAggregation=%s", query.TimeAggregation))
parts = append(parts, fmt.Sprintf("spaceAggregation=%s", query.SpaceAggregation))
if query.ShiftBy != 0 {
parts = append(parts, fmt.Sprintf("shiftBy=%d", query.ShiftBy))
}
if query.AggregateAttribute.Key != "" {
parts = append(parts, fmt.Sprintf("aggregateAttribute=%s", query.AggregateAttribute.CacheKey()))
}