jerrypeng closed pull request #2868: Fixing function latency metric arithmetic error URL: https://github.com/apache/pulsar/pull/2868
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/FunctionStats.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/FunctionStats.java index c45837bafd..f2195de85c 100644 --- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/FunctionStats.java +++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/FunctionStats.java @@ -99,7 +99,7 @@ public double computeLatency() { if (totalSuccessfullyProcessed <= 0) { return 0; } else { - return totalLatencyMs / totalSuccessfullyProcessed; + return totalLatencyMs / (double) totalSuccessfullyProcessed; } } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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