Graphite: Fix for nested complex queries, where a query references a query that references another query (ie the #[A-Z] syntax), Fixes #1372
This commit is contained in:
1 parent
5cef73331c
commit
d3c37bda71
3 files changed
+9
No files matched your search
@@ -276,6 +276,7 @@ function (angular, _, $, config, kbn, moment) {
|
||||
|
||||
targetValue = targets[this._seriesRefLetters[i]];
|
||||
targetValue = targetValue.replace(regex, nestedSeriesRegexReplacer);
|
||||
targets[this._seriesRefLetters[i]] = targetValue;
|
||||
|
||||
clean_options.push("target=" + encodeURIComponent(targetValue));
|
||||
}
|
||||
|
||||
@@ -74,6 +74,13 @@ define([
|
||||
expect(results[2]).to.be('target=asPercent(series1%2Cseries2)');
|
||||
});
|
||||
|
||||
it('should replace target placeholder when nesting query references', function() {
|
||||
var results = ctx.ds.buildGraphiteParams({
|
||||
targets: [{target: 'series1'}, {target: 'sumSeries(#A)'}, {target: 'asPercent(#A,#B)'}]
|
||||
});
|
||||
expect(results[2]).to.be('target=' + encodeURIComponent("asPercent(series1,sumSeries(series1))"));
|
||||
});
|
||||
|
||||
it('should fix wrong minute interval parameters', function() {
|
||||
var results = ctx.ds.buildGraphiteParams({
|
||||
targets: [{target: "summarize(prod.25m.count, '25m', 'sum')" }]
|
||||
|
||||
Reference in new issue
Block a user