diff --git a/CHANGELOG.md b/CHANGELOG.md index b8997603e31..989dab3bb99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,6 @@ - [Issue #171](https://github.com/grafana/grafana/issues/171). Panel: Different time periods, panels can override dashboard relative time and/or add a time shift - [Issue #1488](https://github.com/grafana/grafana/issues/1488). Dashboard: Clone dashboard / Save as -**Changes** -- Dashboard title change & save will no longer create a new dashboard, it will just change the title. - **Enhancements** - [Issue #1366](https://github.com/grafana/grafana/issues/1366). Graph & Singlestat: Support for additional units, Fahrenheit (°F) and Celsius (°C), Humidity (%H), kW, watt-hour (Wh), kilowatt-hour (kWh), velocities (m/s, km/h, mpg, knot) - [Issue #978](https://github.com/grafana/grafana/issues/978). Graph: Shared tooltip improvement, can now support metrics of different resolution/intervals @@ -26,6 +23,14 @@ - [Issue #1359](https://github.com/grafana/grafana/issues/1359). Graph: Fix for all series tooltip showing series with all null values when ``Hide Empty`` option is enabled - [Issue #1497](https://github.com/grafana/grafana/issues/1497). Dashboard: Fixed memory leak when switching dashboards +**Changes** +- Dashboard title change & save will no longer create a new dashboard, it will just change the title. + +**OpenTSDB breaking change** +- [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. + **Tech** - [Issue #1311](https://github.com/grafana/grafana/issues/1311). Tech: Updated Font-Awesome from 3.2 to 4.2 diff --git a/src/app/features/opentsdb/datasource.js b/src/app/features/opentsdb/datasource.js index 16cb58f94cb..c8861f93d0a 100644 --- a/src/app/features/opentsdb/datasource.js +++ b/src/app/features/opentsdb/datasource.js @@ -24,7 +24,16 @@ function (angular, _, kbn) { OpenTSDBDatasource.prototype.query = function(options) { var start = convertToTSDBTime(options.range.from); var end = convertToTSDBTime(options.range.to); - var queries = _.compact(_.map(options.targets, convertTargetToQuery)); + 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. if (_.isEmpty(queries)) { @@ -119,7 +128,7 @@ function (angular, _, kbn) { return metric; } - function convertTargetToQuery(target) { + function convertTargetToQuery(target, interval) { if (!target.metric || target.hide) { return null; } @@ -148,8 +157,9 @@ function (angular, _, kbn) { } } - if (target.shouldDownsample) { - query.downsample = templateSrv.replace(target.downsampleInterval) + "-" + target.downsampleAggregator; + if (!target.disableDownsampling) { + var buf = target.downsampleInterval || interval; + query.downsample = templateSrv.replace(buf) + "-" + target.downsampleAggregator; } query.tags = angular.copy(target.tags); 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 @@