Xeli commented on a change in pull request #8259: [FLINK-12325][metrics] Fix bug in statsd exporter when using negative values URL: https://github.com/apache/flink/pull/8259#discussion_r280538063
########## File path: flink-metrics/flink-metrics-statsd/src/main/java/org/apache/flink/metrics/statsd/StatsDReporter.java ########## @@ -216,4 +238,14 @@ public String filterCharacters(String input) { return chars == null ? input : new String(chars, 0, pos); } + + private boolean numberIsNegative(Number input) { + try { + return new BigDecimal(input.toString()).compareTo(BigDecimal.ZERO) == -1; Review comment: Yeah good call, in this case the rounding that doubleValue might do wouldn't matter anyhow. Changed it! ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services