Просмотр исходного кода

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

Pranay Kanwar 9 лет назад
Родитель
Сommit
6ab90425c4
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      pkg/tsdb/opentsdb/opentsdb.go

+ 4 - 0
pkg/tsdb/opentsdb/opentsdb.go

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