Skip to content

Commit

Permalink
reset on counter reset when cannonical rate is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
arbll committed Dec 12, 2018
1 parent a58f488 commit b5365bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/datadog/jmxfetch/reporter/Reporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,14 @@ public void sendMetrics(LinkedList<HashMap<String, Object>> metrics, String inst
continue;
}

instanceCountersAggregator.put(key, currentValue.longValue());

if (delta < 0 && canonicalRate) {
LOGGER.debug("Counter " + metricName + " has been reset and canonical rate is enabled - not submitting.");
LOGGER.info("Counter " + metricName + " has been reset and canonical rate is enabled - not submitting.");
continue;
}

sendMetricPoint(metricType, metricName, delta, tags);
instanceCountersAggregator.put(key, currentValue.longValue());

} else { // The metric should be 'counter'
String key = generateId(metric);
if (!instanceRatesAggregator.containsKey(key)) {
Expand Down

0 comments on commit b5365bd

Please sign in to comment.