Commit 63665dcc by Torkel Ödegaard

fix(grafana datasource): fixed the built in test data source, fixes #2795

parent 792b194d
define([ define([
'angular', 'angular',
'lodash', 'lodash',
'kbn',
'./directives', './directives',
], ],
function (angular, _, kbn) { function (angular, _) {
'use strict'; 'use strict';
var module = angular.module('grafana.services'); var module = angular.module('grafana.services');
...@@ -15,11 +14,11 @@ function (angular, _, kbn) { ...@@ -15,11 +14,11 @@ function (angular, _, kbn) {
} }
GrafanaDatasource.prototype.query = function(options) { GrafanaDatasource.prototype.query = function(options) {
// get from & to in seconds return backendSrv.get('/api/metrics/test', {
var from = kbn.parseDate(options.range.from).getTime(); from: options.range.from.valueOf(),
var to = kbn.parseDate(options.range.to).getTime(); to: options.range.to.valueOf(),
maxDataPoints: options.maxDataPoints
return backendSrv.get('/api/metrics/test', { from: from, to: to, maxDataPoints: options.maxDataPoints }); });
}; };
GrafanaDatasource.prototype.metricFindQuery = function() { GrafanaDatasource.prototype.metricFindQuery = function() {
......
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