Loki: alerting: adjust step-calculation to be the same as in frontend (#42033)

* loki: alerting: adjust step-calculation to be the same as in frontend

* loki: simplified test

* lint fix
This commit is contained in:
Gábor Farkas
2021-11-22 14:28:51 +01:00
committed by GitHub
parent d11ae6dc3f
commit 037fd9cc8c
4 changed files with 90 additions and 52 deletions

View File

@@ -197,7 +197,7 @@ func parseQuery(dsInfo *datasourceInfo, queryContext *backend.QueryDataRequest)
resolution = model.Resolution
}
step := time.Duration(int64(query.Interval) * resolution)
step := calculateStep(query.Interval, query.TimeRange.To.Sub(query.TimeRange.From), resolution)
qs = append(qs, &lokiQuery{
Expr: model.Expr,