From 65307c463a5ffc25b8e6923c122c83f2792979ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 Feb 2015 12:48:07 +0100 Subject: [PATCH] Refactoring opentsdb editor view, merging #1438, made Downsampling enabled by default --- CHANGELOG.md | 5 + src/app/features/opentsdb/datasource.js | 4 +- .../opentsdb/partials/query.editor.html | 168 +++++++++++------- 3 files changed, 108 insertions(+), 69 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 330aad603f3..b2c3f4e495c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # 2.0.0 (unreleased) +**Changes** +- [Issue #1438](https://github.com/grafana/grafana/issues/1438). OpenTSDB: Automatic downsample interval passed to OpenTSDB (depends on timespan and graph width) +- NOTICE, Downsampling is now enabled by default, so if you have not picked a downsample aggregator in your metric query do so or your graphs will be missleading +- This will make Grafana a lot quicker for OpenTSDB users when viewing large time spans without having to change the downsample interval manually. + **New features** - [Issue #1331](https://github.com/grafana/grafana/issues/1331). Graph & Singlestat: New axis/unit format selector and more units (kbytes, Joule, Watt, eV), and new design for graph axis & grid tab and single stat options tab views - [Issue #1241](https://github.com/grafana/grafana/issues/1242). Timepicker: New option in timepicker (under dashboard settings), to change ``now`` to be for example ``now-1m``, usefull when you want to ignore last minute because it contains incomplete data diff --git a/src/app/features/opentsdb/datasource.js b/src/app/features/opentsdb/datasource.js index a90379b9fc4..17b98ba9dca 100644 --- a/src/app/features/opentsdb/datasource.js +++ b/src/app/features/opentsdb/datasource.js @@ -25,12 +25,14 @@ function (angular, _, kbn) { var start = convertToTSDBTime(options.range.from); 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)); }); + var queries = _.compact(qs); // No valid targets, return the empty result to save a round trip. @@ -155,7 +157,7 @@ function (angular, _, kbn) { } } - if (target.shouldDownsample) { + if (!target.disableDownsampling) { var buf = target.downsampleInterval || interval; query.downsample = templateSrv.replace(buf) + "-" + target.downsampleAggregator; } diff --git a/src/app/features/opentsdb/partials/query.editor.html b/src/app/features/opentsdb/partials/query.editor.html index 794d148676c..09def6a471b 100644 --- a/src/app/features/opentsdb/partials/query.editor.html +++ b/src/app/features/opentsdb/partials/query.editor.html @@ -43,14 +43,18 @@