mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 06:42:21 +08:00
Use opportunities to unindent code (unindent)
This commit fixes the following unindent findings: pkg/api/common.go:102:2: "if x { if y" should be "if x && y" pkg/components/dynmap/dynmap.go:642:2: invert condition and early return pkg/components/dynmap/dynmap.go:681:2: invert condition and early return pkg/components/simplejson/simplejson.go:171:2: "if x { if y" should be "if x && y" pkg/middleware/dashboard_redirect.go:42:3: invert condition and early return pkg/tsdb/mssql/mssql.go:301:3: invert condition and early break pkg/tsdb/mysql/mysql.go:312:3: invert condition and early break pkg/tsdb/postgres/postgres.go:292:3: invert condition and early break pkg/tsdb/sql_engine.go:144:2: invert condition and early return
This commit is contained in:
@ -289,18 +289,19 @@ func (e PostgresQueryEndpoint) transformToTimeSeries(query *tsdb.Query, rows *co
|
||||
key := elem.Value.(string)
|
||||
result.Series = append(result.Series, pointsBySeries[key])
|
||||
|
||||
if fillMissing {
|
||||
series := pointsBySeries[key]
|
||||
// fill in values from last fetched value till interval end
|
||||
intervalStart := series.Points[len(series.Points)-1][1].Float64
|
||||
intervalEnd := float64(tsdbQuery.TimeRange.MustGetTo().UnixNano() / 1e6)
|
||||
if !fillMissing {
|
||||
break
|
||||
}
|
||||
series := pointsBySeries[key]
|
||||
// fill in values from last fetched value till interval end
|
||||
intervalStart := series.Points[len(series.Points)-1][1].Float64
|
||||
intervalEnd := float64(tsdbQuery.TimeRange.MustGetTo().UnixNano() / 1e6)
|
||||
|
||||
// align interval start
|
||||
intervalStart = math.Floor(intervalStart/fillInterval) * fillInterval
|
||||
for i := intervalStart + fillInterval; i < intervalEnd; i += fillInterval {
|
||||
series.Points = append(series.Points, tsdb.TimePoint{fillValue, null.FloatFrom(i)})
|
||||
rowCount++
|
||||
}
|
||||
// align interval start
|
||||
intervalStart = math.Floor(intervalStart/fillInterval) * fillInterval
|
||||
for i := intervalStart + fillInterval; i < intervalEnd; i += fillInterval {
|
||||
series.Points = append(series.Points, tsdb.TimePoint{fillValue, null.FloatFrom(i)})
|
||||
rowCount++
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user