From c9fe2bab6042efc12cfda9d75dfd842bc738a31a Mon Sep 17 00:00:00 2001 From: benrubson Date: Mon, 22 Feb 2016 10:27:08 +0100 Subject: [PATCH] make it more smartly --- public/app/core/utils/kbn.js | 6 +----- public/app/features/templating/templateValuesSrv.js | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/public/app/core/utils/kbn.js b/public/app/core/utils/kbn.js index 8f4970b0a83..fbb854148f9 100644 --- a/public/app/core/utils/kbn.js +++ b/public/app/core/utils/kbn.js @@ -119,14 +119,10 @@ function($, _) { s: 1 }; - kbn.calculateInterval = function(range, resolution, userInterval, lowLimit) { + kbn.calculateInterval = function(range, resolution, userInterval) { var lowLimitMs = 1; // 1 millisecond default low limit var intervalMs, lowLimitInterval; - if (lowLimit) { - lowLimitMs = kbn.interval_to_ms(lowLimit); - } - if (userInterval) { if (userInterval[0] === '>') { lowLimitInterval = userInterval.slice(1); diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index aa2cb177727..2760bb42ca0 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -60,7 +60,7 @@ function (angular, _, kbn) { variable.options.unshift({ text: 'auto', value: '$__auto_interval' }); } - var interval = kbn.calculateInterval(timeSrv.timeRange(), variable.auto_count, null, variable.auto_min); + var interval = kbn.calculateInterval(timeSrv.timeRange(), variable.auto_count, (variable.auto_min ? ">"+variable.auto_min : null)); templateSrv.setGrafanaVariable('$__auto_interval', interval); };