Commit 65307c46 by Torkel Ödegaard

Refactoring opentsdb editor view, merging #1438, made Downsampling enabled by default

parent 2ae0ef94
# 2.0.0 (unreleased) # 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** **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 #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 - [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
......
...@@ -25,12 +25,14 @@ function (angular, _, kbn) { ...@@ -25,12 +25,14 @@ function (angular, _, kbn) {
var start = convertToTSDBTime(options.range.from); var start = convertToTSDBTime(options.range.from);
var end = convertToTSDBTime(options.range.to); var end = convertToTSDBTime(options.range.to);
var qs = []; var qs = [];
if (options.interval.match(/\.[0-9]+s/)) { if (options.interval.match(/\.[0-9]+s/)) {
options.interval = parseFloat(options.interval)*1000 + "ms"; options.interval = parseFloat(options.interval)*1000 + "ms";
} }
_.each(options.targets, function(target) { _.each(options.targets, function(target) {
qs.push(convertTargetToQuery(target, options.interval)); qs.push(convertTargetToQuery(target, options.interval));
}); });
var queries = _.compact(qs); var queries = _.compact(qs);
// No valid targets, return the empty result to save a round trip. // No valid targets, return the empty result to save a round trip.
...@@ -155,7 +157,7 @@ function (angular, _, kbn) { ...@@ -155,7 +157,7 @@ function (angular, _, kbn) {
} }
} }
if (target.shouldDownsample) { if (!target.disableDownsampling) {
var buf = target.downsampleInterval || interval; var buf = target.downsampleInterval || interval;
query.downsample = templateSrv.replace(buf) + "-" + target.downsampleAggregator; query.downsample = templateSrv.replace(buf) + "-" + target.downsampleAggregator;
} }
......
...@@ -43,14 +43,18 @@ ...@@ -43,14 +43,18 @@
</ul> </ul>
<ul class="tight-form-list" role="menu"> <ul class="tight-form-list" role="menu">
<li class="tight-form-item" style="width: 86px">
Metric
</li>
<li> <li>
<input type="text" <input type="text"
class="tight-form-input" class="input-large tight-form-input"
ng-model="target.metric" ng-model="target.metric"
spellcheck='false' spellcheck='false'
bs-typeahead="suggestMetrics" bs-typeahead="suggestMetrics"
placeholder="metric name" placeholder="metric name"
data-min-length=0 data-items=100 data-min-length=0 data-items=100
ng-model-onblur
ng-blur="targetBlur()" ng-blur="targetBlur()"
> >
<a bs-tooltip="target.errors.metric" <a bs-tooltip="target.errors.metric"
...@@ -76,48 +80,6 @@ ...@@ -76,48 +80,6 @@
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item">
Rate:
<input type="checkbox"
class="tight-form-checkbox"
ng-model="target.shouldComputeRate"
ng-change="targetBlur()"
>
</li>
<li class="tight-form-item" ng-hide="!target.shouldComputeRate">
Counter:
<input type="checkbox"
class="tight-form-checkbox"
ng-disabled="!target.shouldComputeRate"
ng-model="target.isCounter"
ng-change="targetBlur()">
</li>
<li class="tight-form-item" ng-hide="!target.isCounter">
Counter Max:
</li>
<li ng-hide="!target.isCounter">
<input type="text"
class="tight-form-input input-medium"
ng-disabled="!target.shouldComputeRate"
ng-model="target.counterMax"
spellcheck='false'
placeholder="Counter max value"
ng-blur="targetBlur()"
/>
</li>
<li class="tight-form-item" ng-hide="!target.isCounter">
Counter Reset Value:
</li>
<li ng-hide="!target.isCounter">
<input type="text"
class="tight-form-input input-medium"
ng-disabled="!target.shouldComputeRate"
ng-model="target.counterResetValue"
spellcheck='false'
placeholder="Counter reset value"
ng-blur="targetBlur()"
/>
</li>
<li class="tight-form-item">
Alias: Alias:
</li> </li>
<li> <li>
...@@ -138,31 +100,29 @@ ...@@ -138,31 +100,29 @@
<div class="tight-form"> <div class="tight-form">
<ul class="tight-form-list" role="menu"> <ul class="tight-form-list" role="menu">
<li class="tight-form-item"> <li class="tight-form-item">
Downsample: <i class="fa fa-eye invisible"></i>
<input type="checkbox"
class="tight-form-checkbox"
ng-model="target.shouldDownsample"
ng-change="targetBlur(target)"
>
</li> </li>
<li ng-hide="!target.shouldDownsample"> <li class="tight-form-item" style="width: 86px">
Down sample
</li>
<li>
<input type="text" <input type="text"
class="input-small tight-form-input" class="input-large tight-form-input"
ng-disabled="!target.shouldDownsample"
ng-model="target.downsampleInterval" ng-model="target.downsampleInterval"
ng-model-onblur
ng-change="targetBlur()" ng-change="targetBlur()"
placeholder="interval" placeholder="interval (empty = auto)"
> >
</li> </li>
<li class="tight-form-item" ng-hide="!target.shouldDownsample"> <li class="tight-form-item">
Aggregator Aggregator
</li> </li>
<li ng-hide="!target.shouldDownsample"> <li>
<select ng-model="target.downsampleAggregator" <select ng-model="target.downsampleAggregator"
class="tight-form-input input-small" class="tight-form-input input-small"
ng-options="agg for agg in aggregators" ng-options="agg for agg in aggregators"
...@@ -171,7 +131,24 @@ ...@@ -171,7 +131,24 @@
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item">
Tags: Disable downsampling&nbsp;
<input class="cr1" id="target.disableDownsampling" type="checkbox"
ng-model="target.disableDownsampling" ng-checked="target.disableDownsampling" ng-change="targetBlur()">
<label for="target.disableDownsampling" class="cr1"></label>
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="tight-form">
<ul class="tight-form-list" role="menu">
<li class="tight-form-item">
<i class="fa fa-eye invisible"></i>
</li>
<li class="tight-form-item" style="width: 86px">
Tags
</li> </li>
<li ng-repeat="(key, value) in target.tags track by $index" class="tight-form-item"> <li ng-repeat="(key, value) in target.tags track by $index" class="tight-form-item">
{{key}}&nbsp;=&nbsp;{{value}} {{key}}&nbsp;=&nbsp;{{value}}
...@@ -202,7 +179,7 @@ ...@@ -202,7 +179,7 @@
ng-model="target.currentTagValue" ng-model="target.currentTagValue"
placeholder="value"> placeholder="value">
<a ng-click="addTag()"> <a ng-click="addTag()">
<i class="fa fa-plus"></i> add tag
</a> </a>
<a bs-tooltip="target.errors.tags" <a bs-tooltip="target.errors.tags"
style="color: rgb(229, 189, 28)" style="color: rgb(229, 189, 28)"
...@@ -213,5 +190,60 @@ ...@@ -213,5 +190,60 @@
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="tight-form">
<ul class="tight-form-list" role="menu">
<li class="tight-form-item">
<i class="fa fa-eye invisible"></i>
</li>
<li class="tight-form-item" style="width: 86px">
Rate&nbsp;
<input class="cr1" id="target.shouldComputeRate" type="checkbox"
ng-model="target.shouldComputeRate" ng-checked="target.shouldComputeRate" ng-change="targetBlur()">
<label for="target.shouldComputeRate" class="cr1"></label>
</li>
<li class="tight-form-item" ng-hide="!target.shouldComputeRate">
Counter&nbsp;
<input class="cr1" id="target.isCounter" type="checkbox"
ng-model="target.isCounter" ng-checked="target.isCounter" ng-change="targetBlur()">
<label for="target.isCounter" class="cr1"></label>
</li>
<li class="tight-form-item" ng-hide="!target.isCounter">
Counter Max:
</li>
<li ng-hide="!target.isCounter">
<input type="text"
class="tight-form-input input-small"
ng-disabled="!target.shouldComputeRate"
ng-model="target.counterMax"
spellcheck='false'
placeholder="max value"
ng-model-onblur
ng-blur="targetBlur()"
/>
</li>
<li class="tight-form-item" ng-hide="!target.isCounter">
Reset Value:
</li>
<li ng-hide="!target.isCounter">
<input type="text"
class="tight-form-input input-small"
ng-disabled="!target.shouldComputeRate"
ng-model="target.counterResetValue"
spellcheck='false'
placeholder="reset value"
ng-model-onblur
ng-blur="targetBlur()"
/>
</li>
</ul>
<div class="clearfix"></div>
</div>
</div> </div>
</div> </div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment