Browse Source

Added feature request "predict value" in moving averages pipeline agg (#5689)

issue-id: #5688
vaibhavinbayarea 9 years ago
parent
commit
24172fca01

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

@@ -53,6 +53,11 @@
 		<input type="text" class="gf-form-input max-width-12" ng-change="onChangeInternal()" ng-model="agg.settings.model" blur="onChange()" spellcheck='false'>
 	</div>
 
+	<div class="gf-form offset-width-7" ng-if="agg.type === 'moving_avg'">
+		<label class="gf-form-label width-10">Predict</label>
+		<input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.predict" ng-blur="onChangeInternal()" spellcheck='false'>
+	</div>
+
 	<div class="gf-form offset-width-7" ng-if="agg.type === 'percentiles'">
 		<label class="gf-form-label width-10">Percentiles</label>
 		<input type="text" class="gf-form-input max-width-12" ng-model="agg.settings.percents" array-join ng-blur="onChange()"></input>

+ 2 - 1
public/app/plugins/datasource/elasticsearch/query_def.js

@@ -72,7 +72,8 @@ function (_) {
     pipelineOptions: {
       'moving_avg' : [
         {text: 'window', default: 5},
-        {text: 'model', default: 'simple'}
+        {text: 'model', default: 'simple'},
+        {text: 'predict', default: 0}
       ],
       'derivative': [
         {text: 'unit', default: undefined},