You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/05/02 18:14:10 UTC

[GitHub] [flink] Xeli commented on a change in pull request #8259: [FLINK-12325][metrics] Fix bug in statsd exporter when using negative values

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:
users@infra.apache.org


With regards,
Apache Git Services