mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Test Datasource/Bug: Fixes division by zero in csv metric values scenario (#29029)
Closes #8705
This commit is contained in:
parent
8f9e5a839f
commit
9659c98d61
@ -237,7 +237,10 @@ func init() {
|
||||
series := newSeriesForQuery(query, 0)
|
||||
startTime := context.TimeRange.GetFromAsMsEpoch()
|
||||
endTime := context.TimeRange.GetToAsMsEpoch()
|
||||
step := (endTime - startTime) / int64(len(values)-1)
|
||||
var step int64 = 0
|
||||
if len(values) > 1 {
|
||||
step = (endTime - startTime) / int64(len(values)-1)
|
||||
}
|
||||
|
||||
for _, val := range values {
|
||||
series.Points = append(series.Points, tsdb.TimePoint{val, null.FloatFrom(float64(startTime))})
|
||||
|
Loading…
Reference in New Issue
Block a user