Commit b98f817d by Andrew McDonald Committed by Torkel Ödegaard

Fix for cloudwatch datasource requesting too many datapoints (#6544)

The range checking in _getPeriod appeared to be using a different variable than the period that had just been calculated for its bounds checks.
parent e04d27c0
......@@ -78,10 +78,10 @@ function (angular, _, moment, dateMath, kbn, CloudWatchAnnotationQuery) {
} else {
period = kbn.interval_to_seconds(templateSrv.replace(target.period, options.scopedVars));
}
if (query.period < 60) {
if (period < 60) {
period = 60;
}
if (range / query.period >= 1440) {
if (range / period >= 1440) {
period = Math.ceil(range / 1440 / 60) * 60;
}
......
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