Pass dropcounter rate option if no max counter and no reset value or reset value as 0 is specified (#7743)

This commit is contained in:
Pranay Kanwar
2017-03-06 20:49:37 +05:30
committed by Torkel Ödegaard
parent c3202d3f99
commit 6ab90425c4

View File

@@ -190,6 +190,10 @@ func (e *OpenTsdbExecutor) buildMetric(query *tsdb.Query) map[string]interface{}
rateOptions["resetValue"] = resetValue.MustFloat64()
}
if !counterMaxCheck && (!resetValueCheck || resetValue.MustFloat64() == 0) {
rateOptions["dropcounter"] = true
}
metric["rateOptions"] = rateOptions
}