From e588b682fb91b51ee7aaa8a2e51acb108de56af8 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Tue, 19 Sep 2017 00:01:41 +0900 Subject: [PATCH] import the change, https://github.com/grafana/grafana/pull/9268 --- pkg/tsdb/cloudwatch/cloudwatch.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/tsdb/cloudwatch/cloudwatch.go b/pkg/tsdb/cloudwatch/cloudwatch.go index ef5b8271c3c..62e79f4fab9 100644 --- a/pkg/tsdb/cloudwatch/cloudwatch.go +++ b/pkg/tsdb/cloudwatch/cloudwatch.go @@ -364,8 +364,9 @@ func parseResponse(resp *cloudwatch.GetMetricStatisticsOutput, query *CloudWatch timestamp := *v.Timestamp if _, ok := lastTimestamp[*s]; ok { nextTimestampFromLast := lastTimestamp[*s].Add(time.Duration(query.Period) * time.Second) - if timestamp.After(nextTimestampFromLast) { + for timestamp.After(nextTimestampFromLast) { series.Points = append(series.Points, tsdb.NewTimePoint(null.FloatFromPtr(nil), float64(nextTimestampFromLast.Unix()*1000))) + nextTimestampFromLast = nextTimestampFromLast.Add(time.Duration(query.Period) * time.Second) } } lastTimestamp[*s] = timestamp