mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 12:14:08 -06:00
Merge branch 'v3.1.x'
This commit is contained in:
commit
7a2e8324b9
@ -40,7 +40,7 @@ export function GraphiteDatasource(instanceSettings, $q, backendSrv, templateSrv
|
||||
};
|
||||
|
||||
if (options.panelId) {
|
||||
httpOptions.requestId = 'panel' + options.panelId;
|
||||
httpOptions.requestId = this.name + '.panelId.' + options.panelId;
|
||||
}
|
||||
|
||||
return this.doGraphiteRequest(httpOptions).then(this.convertDataPointsToMs);
|
||||
|
@ -5,7 +5,7 @@ import {GraphiteDatasource} from "../datasource";
|
||||
|
||||
describe('graphiteDatasource', function() {
|
||||
var ctx = new helpers.ServiceTestContext();
|
||||
var instanceSettings: any = {url: ['']};
|
||||
var instanceSettings: any = {url: [''], name: 'graphiteProd'};
|
||||
|
||||
beforeEach(angularMocks.module('grafana.core'));
|
||||
beforeEach(angularMocks.module('grafana.services'));
|
||||
@ -24,9 +24,10 @@ describe('graphiteDatasource', function() {
|
||||
|
||||
describe('When querying influxdb with one target using query editor target spec', function() {
|
||||
var query = {
|
||||
rangeRaw: { from: 'now-1h', to: 'now' },
|
||||
targets: [{ target: 'prod1.count' }, {target: 'prod2.count'}],
|
||||
maxDataPoints: 500,
|
||||
panelId: 3,
|
||||
rangeRaw: { from: 'now-1h', to: 'now' },
|
||||
targets: [{ target: 'prod1.count' }, {target: 'prod2.count'}],
|
||||
maxDataPoints: 500,
|
||||
};
|
||||
|
||||
var results;
|
||||
@ -46,6 +47,10 @@ describe('graphiteDatasource', function() {
|
||||
expect(requestOptions.url).to.be('/render');
|
||||
});
|
||||
|
||||
it('should set unique requestId', function() {
|
||||
expect(requestOptions.requestId).to.be('graphiteProd.panelId.3');
|
||||
});
|
||||
|
||||
it('should query correctly', function() {
|
||||
var params = requestOptions.data.split('&');
|
||||
expect(params).to.contain('target=prod1.count');
|
||||
|
Loading…
Reference in New Issue
Block a user