Kaynağa Gözat

Merge branch 'elasticsearch_precision_threshold' of https://github.com/lucasrodcosta/grafana into lucasrodcosta-elasticsearch_precision_threshold

Torkel Ödegaard 9 yıl önce
ebeveyn
işleme
6c6dae1c92

+ 5 - 0
public/app/plugins/datasource/elasticsearch/metric_agg.js

@@ -68,6 +68,11 @@ function (angular, _, queryDef) {
       }
 
       switch($scope.agg.type) {
+        case 'cardinality': {
+          var precision_threshold = $scope.agg.settings.precision_threshold || '';
+          $scope.settingsLinkText = 'Precision threshold: ' + precision_threshold;
+          break;
+        }
         case 'percentiles': {
           $scope.agg.settings.percents = $scope.agg.settings.percents || [25,50,75,95,99];
           $scope.settingsLinkText = 'Values: ' + $scope.agg.settings.percents.join(',');

+ 5 - 0
public/app/plugins/datasource/elasticsearch/partials/metric_agg.html

@@ -58,6 +58,11 @@
 		<input type="text" class="gf-form-input max-width-12" ng-model="agg.settings.percents" array-join ng-blur="onChange()"></input>
 	</div>
 
+	<div class="gf-form offset-width-7" ng-if="agg.type === 'cardinality'">
+		<label class="gf-form-label width-10">Precision threshold</label>
+		<input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.precision_threshold" ng-blur="onChange()"></input>
+	</div>
+
 	<div ng-if="agg.type === 'extended_stats'">
 		<gf-form-switch ng-repeat="stat in extendedStats" class="gf-form offset-width-7" label="{{stat.text}}" label-class="width-10" checked="agg.meta[stat.value]" on-change="onChangeInternal()"></gf-form-switch>