* Cloudwatch: Fix nil values for a period gap in metrics
* Use fields periods for intervals
(cherry picked from commit 5edcc2e795)
Co-authored-by: Shirley <4163034+fridgepoet@users.noreply.github.com>
This commit is contained in:
co-authored by
Shirley
parent
90316bedee
commit
6c370d7d66
@@ -162,13 +162,6 @@ func buildDataFrames(startTime time.Time, endTime time.Time, aggregatedResponse
|
||||
timestamps := []*time.Time{}
|
||||
points := []*float64{}
|
||||
for j, t := range metric.Timestamps {
|
||||
if j > 0 {
|
||||
expectedTimestamp := metric.Timestamps[j-1].Add(time.Duration(query.Period) * time.Second)
|
||||
if expectedTimestamp.Before(*t) {
|
||||
timestamps = append(timestamps, &expectedTimestamp)
|
||||
points = append(points, nil)
|
||||
}
|
||||
}
|
||||
val := metric.Values[j]
|
||||
timestamps = append(timestamps, t)
|
||||
points = append(points, val)
|
||||
|
||||
Reference in New Issue
Block a user