Commit 7a2e8324 by Torkel Ödegaard

Merge branch 'v3.1.x'

parents b943e414 ddf579f2
......@@ -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');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment