flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [3/3] flink git commit: [FLINK-6416] Fix divide-by-zero in InputGateMetrics
Date Thu, 18 May 2017 19:04:35 GMT
[FLINK-6416] Fix divide-by-zero in InputGateMetrics


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/979228b3
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/979228b3
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/979228b3

Branch: refs/heads/release-1.3
Commit: 979228b3e2cac52c79c78855645a536d515befc9
Parents: 5569c4f
Author: zentol <chesnay@apache.org>
Authored: Mon May 15 13:44:54 2017 +0200
Committer: zentol <chesnay@apache.org>
Committed: Thu May 18 17:43:08 2017 +0200

----------------------------------------------------------------------
 .../runtime/io/network/partition/consumer/InputGateMetrics.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/979228b3/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java
index c9fed9b..796a6db 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java
@@ -130,7 +130,7 @@ public class InputGateMetrics {
 			}
 		}
 
-		return total / (float) count;
+		return count == 0 ? 0 : total / (float) count;
 	}
 
 	// ------------------------------------------------------------------------


Mime
View raw message