mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(elasticsearch): remove pipeline aggs as possible sources
This commit is contained in:
parent
005e14a060
commit
6e50e2412e
@ -96,7 +96,7 @@ function (_) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
var result = [];
|
var result = [];
|
||||||
_.each(targets.metrics, function(metric) {
|
_.each(targets.metrics, function(metric) {
|
||||||
if (metric.type !== 'moving_avg') {
|
if (!self.isPipelineAgg(metric)) {
|
||||||
result.push({text: self.describeMetric(metric), value: metric.id });
|
result.push({text: self.describeMetric(metric), value: metric.id });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -42,10 +42,24 @@ describe('ElasticQueryDef', function() {
|
|||||||
|
|
||||||
var response = QueryDef.getPipelineAggOptions(targets);
|
var response = QueryDef.getPipelineAggOptions(targets);
|
||||||
|
|
||||||
it('should return zero', function() {
|
it('should return one', function() {
|
||||||
expect(response.length).to.be(1);
|
expect(response.length).to.be(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('with derivatives targets', function() {
|
||||||
|
var targets = {
|
||||||
|
metrics: [
|
||||||
|
{ type: 'derivative', field: '@value' }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
var response = QueryDef.getPipelineAggOptions(targets);
|
||||||
|
|
||||||
|
it('should return zero', function() {
|
||||||
|
expect(response.length).to.be(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('isPipelineMetric', function() {
|
describe('isPipelineMetric', function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user