mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #9983 from mtanda/prometheus_nested
prometheus nested query support
This commit is contained in:
@@ -590,4 +590,19 @@ describe('PrometheusDatasource', function() {
|
||||
expect(query.scopedVars.__interval_ms.value).to.be(5 * 1000);
|
||||
});
|
||||
});
|
||||
describe('The nested query', function() {
|
||||
it('should generate correct query', function() {
|
||||
let query = 'sum(rate(#A[1m]))';
|
||||
let options = {
|
||||
targets: [
|
||||
{
|
||||
refId: 'A',
|
||||
expr: 'http_requests_total'
|
||||
}
|
||||
]
|
||||
};
|
||||
let result = ctx.ds.replaceNestedQuery(query, options);
|
||||
expect(result).to.be('sum(rate(http_requests_total[1m]))');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user