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

This commit is contained in:
Torkel Ödegaard 2015-09-22 07:12:36 +02:00
parent 792b194d0e
commit 63665dccae

View File

@ -1,10 +1,9 @@
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) {
} }
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() {