mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
refactor(elasticsearch): mavg naming -> pipeline agg
This commit is contained in:
parent
c8c9e0a7e7
commit
005e14a060
@ -22,7 +22,7 @@ function (angular, _, queryDef) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.updatePipelineAggOptions = function() {
|
$scope.updatePipelineAggOptions = function() {
|
||||||
$scope.pipelineAggOptions = queryDef.getMovingAverageOptions($scope.target);
|
$scope.pipelineAggOptions = queryDef.getPipelineAggOptions($scope.target);
|
||||||
};
|
};
|
||||||
|
|
||||||
$rootScope.onAppEvent('elastic-query-updated', function() {
|
$rootScope.onAppEvent('elastic-query-updated', function() {
|
||||||
|
@ -92,7 +92,7 @@ function (_) {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
getMovingAverageOptions: function(targets) {
|
getPipelineAggOptions: function(targets) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var result = [];
|
var result = [];
|
||||||
_.each(targets.metrics, function(metric) {
|
_.each(targets.metrics, function(metric) {
|
||||||
|
@ -8,9 +8,9 @@ declare var QueryDef: any;
|
|||||||
|
|
||||||
describe('ElasticQueryDef', function() {
|
describe('ElasticQueryDef', function() {
|
||||||
|
|
||||||
describe('getMovingAverageOptions', function() {
|
describe('getPipelineAggOptions', function() {
|
||||||
describe('with zero targets', function() {
|
describe('with zero targets', function() {
|
||||||
var response = QueryDef.getMovingAverageOptions([]);
|
var response = QueryDef.getPipelineAggOptions([]);
|
||||||
|
|
||||||
it('should return zero', function() {
|
it('should return zero', function() {
|
||||||
expect(response.length).to.be(0);
|
expect(response.length).to.be(0);
|
||||||
@ -25,7 +25,7 @@ describe('ElasticQueryDef', function() {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
var response = QueryDef.getMovingAverageOptions(targets);
|
var response = QueryDef.getPipelineAggOptions(targets);
|
||||||
|
|
||||||
it('should return zero', function() {
|
it('should return zero', function() {
|
||||||
expect(response.length).to.be(2);
|
expect(response.length).to.be(2);
|
||||||
@ -40,7 +40,7 @@ describe('ElasticQueryDef', function() {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
var response = QueryDef.getMovingAverageOptions(targets);
|
var response = QueryDef.getPipelineAggOptions(targets);
|
||||||
|
|
||||||
it('should return zero', function() {
|
it('should return zero', function() {
|
||||||
expect(response.length).to.be(1);
|
expect(response.length).to.be(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user