Commit d9d4e6c8 by Torkel Ödegaard

Merge pull request #3819 from bobrik/opentsdb-fill-policy

Support OpenTSDB 2.2 fill policies, closes #3802
parents 28fabade bbfdbaf9
......@@ -272,6 +272,10 @@ function (angular, _, dateMath) {
}
query.downsample = interval + "-" + target.downsampleAggregator;
if (target.downsampleFillPolicy !== "none") {
query.downsample += "-" + target.downsampleFillPolicy;
}
}
query.tags = angular.copy(target.tags);
......
......@@ -105,6 +105,18 @@
</li>
<li class="tight-form-item query-keyword">
Fill policy
<tip>Available since OpenTSDB 2.2</tip>
</li>
<li>
<select ng-model="target.downsampleFillPolicy" class="tight-form-input input-small"
ng-options="agg for agg in fillPolicies"
ng-change="targetBlur()">
</select>
</li>
<li class="tight-form-item query-keyword">
Disable downsampling <editor-checkbox text="" model="target.disableDownsampling" change="targetBlur()"></editor-checkbox>
</li>
......
......@@ -13,6 +13,7 @@ function (angular, _, kbn) {
$scope.init = function() {
$scope.target.errors = validateTarget($scope.target);
$scope.aggregators = ['avg', 'sum', 'min', 'max', 'dev', 'zimsum', 'mimmin', 'mimmax'];
$scope.fillPolicies = ['none', 'nan', 'null', 'zero'];
if (!$scope.target.aggregator) {
$scope.target.aggregator = 'sum';
......@@ -22,6 +23,10 @@ function (angular, _, kbn) {
$scope.target.downsampleAggregator = 'avg';
}
if (!$scope.target.downsampleFillPolicy) {
$scope.target.downsampleFillPolicy = 'none';
}
$scope.datasource.getAggregators().then(function(aggs) {
$scope.aggregators = aggs;
});
......
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