Commit a20c4195 by Ryan Patterson Committed by Torkel Ödegaard

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.
parent 2ac6e23f
...@@ -386,8 +386,9 @@ function (angular, _, moment, dateMath, kbn, templatingVariable, CloudWatchAnnot ...@@ -386,8 +386,9 @@ function (angular, _, moment, dateMath, kbn, templatingVariable, CloudWatchAnnot
}) })
.each(function(dp) { .each(function(dp) {
var timestamp = new Date(dp.Timestamp).getTime(); var timestamp = new Date(dp.Timestamp).getTime();
if (lastTimestamp && (timestamp - lastTimestamp) > periodMs) { while (lastTimestamp && (timestamp - lastTimestamp) > periodMs) {
dps.push([null, lastTimestamp + periodMs]); dps.push([null, lastTimestamp + periodMs]);
lastTimestamp = lastTimestamp + periodMs;
} }
lastTimestamp = timestamp; lastTimestamp = timestamp;
if (!extended) { if (!extended) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment