Fully fill out nulls in cloudfront data source (#9268)

Summary:
Previously, cloudwatch data sources would only fill in a single null value if
there was missing data. This results in behavior described in #9267. This
resolves that issue by filling the entire missing period with null values. The
null values can then be interpreted as normal by the graphing frontend.

Test Plan:
Used on a data source that had missing data for many consecutive periods.
Ensured that the graph remained at 0 across the entire window.
This commit is contained in:
Ryan Patterson
2017-09-18 11:12:52 +02:00
committed by Torkel Ödegaard
parent 2ac6e23fc5
commit a20c419583
@@ -386,8 +386,9 @@ function (angular, _, moment, dateMath, kbn, templatingVariable, CloudWatchAnnot
})
.each(function(dp) {
var timestamp = new Date(dp.Timestamp).getTime();
if (lastTimestamp && (timestamp - lastTimestamp) > periodMs) {
while (lastTimestamp && (timestamp - lastTimestamp) > periodMs) {
dps.push([null, lastTimestamp + periodMs]);
lastTimestamp = lastTimestamp + periodMs;
}
lastTimestamp = timestamp;
if (!extended) {