Skip to content

Commit

Permalink
CR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com>
  • Loading branch information
pedro-stanaka committed Oct 31, 2024
1 parent 413e96d commit b69c9bb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/cortex/querier/queryrange/stats_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ func (s statsMiddleware) Do(ctx context.Context, r Request) (Response, error) {
}

if resp.GetStats() != nil {
sts := stats.FromContext(ctx)
if sts != nil {
if sts.LoadPeakSamples() < resp.GetStats().Samples.PeakSamples {
sts.SetPeakSamples(resp.GetStats().Samples.PeakSamples)
}
if sts := stats.FromContext(ctx); sts != nil {
sts.SetPeakSamples(max(sts.LoadPeakSamples(), resp.GetStats().Samples.PeakSamples))
sts.AddTotalSamples(resp.GetStats().Samples.TotalQueryableSamples)
}
}
Expand Down

0 comments on commit b69c9bb

Please sign in to comment.