Frontend query changes corresponding #8336 (#8489)

This commit is contained in:
Pranay Kanwar 2017-05-30 13:23:11 +05:30 committed by Torkel Ödegaard
parent 5c1833de1f
commit 26ec874fb1

View File

@ -28,8 +28,8 @@ function (angular, _, dateMath) {
_.each(options.targets, function(target) { _.each(options.targets, function(target) {
if (!target.metric) { return; } if (!target.metric) { return; }
qs.push(convertTargetToQuery(target, options)); qs.push(convertTargetToQuery(target, options, this.tsdbVersion));
}); }.bind(this));
var queries = _.compact(qs); var queries = _.compact(qs);
@ -366,7 +366,7 @@ function (angular, _, dateMath) {
return label; return label;
} }
function convertTargetToQuery(target, options) { function convertTargetToQuery(target, options, tsdbVersion) {
if (!target.metric || target.hide) { if (!target.metric || target.hide) {
return null; return null;
} }
@ -393,6 +393,11 @@ function (angular, _, dateMath) {
if (target.counterResetValue && target.counterResetValue.length) { if (target.counterResetValue && target.counterResetValue.length) {
query.rateOptions.resetValue = parseInt(target.counterResetValue); query.rateOptions.resetValue = parseInt(target.counterResetValue);
} }
if(tsdbVersion >= 2) {
query.rateOptions.dropResets = !query.rateOptions.counterMax &&
(!query.rateOptions.ResetValue || query.rateOptions.ResetValue === 0);
}
} }
if (!target.disableDownsampling) { if (!target.disableDownsampling) {