feat(elasticsearch): remove pipeline aggs as possible sources

This commit is contained in:
carl bergquist 2015-12-10 17:18:22 +01:00
parent 005e14a060
commit 6e50e2412e
2 changed files with 16 additions and 2 deletions

View File

@ -96,7 +96,7 @@ function (_) {
var self = this;
var result = [];
_.each(targets.metrics, function(metric) {
if (metric.type !== 'moving_avg') {
if (!self.isPipelineAgg(metric)) {
result.push({text: self.describeMetric(metric), value: metric.id });
}
});

View File

@ -42,10 +42,24 @@ describe('ElasticQueryDef', function() {
var response = QueryDef.getPipelineAggOptions(targets);
it('should return zero', function() {
it('should return one', function() {
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() {