Elasticsearch: Adds cumulative sum aggregation support (#24820)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
Kevin Retzke
2020-06-01 17:55:15 -04:00
committed by GitHub
parent b2745c3e23
commit 51d1261a4b
12 changed files with 2142 additions and 159 deletions

View File

@@ -64,6 +64,11 @@
<div class="gf-form offset-width-7" ng-if="agg.type === 'derivative'">
<label class="gf-form-label width-10">Unit</label>
<input type="text" class="gf-form-input max-width-12" ng-model="agg.settings.unit" ng-blur="onChangeInternal()" spellcheck='false'>
</div>
<div class="gf-form offset-width-7" ng-if="agg.type === 'cumulative_sum'">
<label class="gf-form-label width-10">Format</label>
<input type="text" class="gf-form-input max-width-12" ng-model="agg.settings.format" ng-blur="onChangeInternal()" spellcheck='false'>
</div>
<div ng-if="agg.type === 'moving_avg'">

View File

@@ -64,6 +64,13 @@ export const metricAggTypes = [
isPipelineAgg: true,
minVersion: 2,
},
{
text: 'Cumulative Sum',
value: 'cumulative_sum',
requiresField: false,
isPipelineAgg: true,
minVersion: 2,
},
{
text: 'Bucket Script',
value: 'bucket_script',
@@ -143,6 +150,7 @@ export const pipelineOptions: any = {
{ text: 'minimize', default: false },
],
derivative: [{ text: 'unit', default: undefined }],
cumulative_sum: [{ text: 'format', default: undefined }],
bucket_script: [],
};

View File

@@ -104,13 +104,13 @@ describe('ElasticQueryDef', () => {
describe('using esversion 2', () => {
test('should get pipeline aggs', () => {
expect(queryDef.getMetricAggTypes(2).length).toBe(13);
expect(queryDef.getMetricAggTypes(2).length).toBe(14);
});
});
describe('using esversion 5', () => {
test('should get pipeline aggs', () => {
expect(queryDef.getMetricAggTypes(5).length).toBe(13);
expect(queryDef.getMetricAggTypes(5).length).toBe(14);
});
});
});