Commit c7ba6016 by Mitsuhiro Tanda

(cloudwatch) add Divide By Sum option

parent 05ec24e7
......@@ -330,6 +330,9 @@ function (angular, _, moment, dateMath) {
dps.push([null, lastTimestamp + periodMs]);
}
lastTimestamp = timestamp;
if (options.divideSumByPeriod && stat === 'Sum') {
dp[stat] = dp[stat] / options.period;
}
dps.push([dp[stat], timestamp]);
});
......
......@@ -52,6 +52,9 @@
<li>
<input type="text" class="input-xlarge tight-form-input" ng-model="target.alias" spellcheck='false' ng-model-onblur ng-change="onChange()">
</li>
<li class="tight-form-item query-keyword">
Sum / Period <editor-checkbox text="" model="target.divideSumByPeriod" change="onChange()"></editor-checkbox>
</li>
</ul>
<div class="clearfix"></div>
</div>
......
......@@ -10,6 +10,7 @@ function (angular, _) {
module.controller('CloudWatchQueryCtrl', function($scope) {
$scope.init = function() {
$scope.target.divideSumByPeriod = $scope.target.divideSumByPeriod || false;
$scope.aliasSyntax = '{{metric}} {{stat}} {{namespace}} {{region}} {{<dimension name>}}';
};
......
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