mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Elasticsearch: Adds cumulative sum aggregation support (#24820)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
@@ -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'">
|
||||
|
||||
@@ -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: [],
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user