Skip to content

Commit

Permalink
Merge pull request #79 from v3io/development
Browse files Browse the repository at this point in the history
ignore step&aggrWindow when tsdb should not do any aggregations (#78)
  • Loading branch information
dinal authored Dec 2, 2020
2 parents 8d3e0b7 + c20e3a4 commit b2af85e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions storage/tsdb/promtsdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,20 @@ func (promQuery *V3ioPromQuerier) Select(params *storage.SelectParams, oms ...*l
promQuery.LastTSDBAggregatedAggr = params.Func
}

// In case we can not do aggregations, make sure no step or aggregation window is passed.
step,aggrWindow := params.Step, params.AggregationWindow
if !promQuery.UseV3ioAggregations(){
step = 0
aggrWindow = 0
}

selectParams := &pquerier.SelectParams{Name: name,
Functions: function,
Step: params.Step,
Step: step,
Filter: filter,
From: promQuery.mint,
To: promQuery.maxt,
AggregationWindow: params.AggregationWindow}
AggregationWindow: aggrWindow}

promQuery.logger.DebugWith("Going to query tsdb", "params", selectParams,
"UseAggregates", promQuery.UseAggregates, "UseAggregatesConfig", promQuery.UseAggregatesConfig)
Expand Down

0 comments on commit b2af85e

Please sign in to comment.