Skip to content

Commit

Permalink
OpenTSDB: Fixed issue with auto interval variable going below 1s, Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
torkelo committed Feb 23, 2015
1 parent 2c5f192 commit a5fd40e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/app/features/opentsdb/datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ function (angular, _, kbn) {
var end = convertToTSDBTime(options.range.to);
var qs = [];

if (options.interval.match(/\.[0-9]+s/)) {
options.interval = parseFloat(options.interval)*1000 + "ms";
}
_.each(options.targets, function(target) {
qs.push(convertTargetToQuery(target, options.interval));
});
Expand Down Expand Up @@ -158,8 +155,13 @@ function (angular, _, kbn) {
}

if (!target.disableDownsampling) {
var buf = target.downsampleInterval || interval;
query.downsample = templateSrv.replace(buf) + "-" + target.downsampleAggregator;
interval = templateSrv.replace(target.downsampleInterval || interval);

if (interval.match(/\.[0-9]+s/)) {
interval = parseFloat(interval)*1000 + "ms";
}

query.downsample = interval + "-" + target.downsampleAggregator;
}

query.tags = angular.copy(target.tags);
Expand Down

0 comments on commit a5fd40e

Please sign in to comment.