You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/09/25 17:06:51 UTC
[GitHub] sijie closed pull request #2628: In ZK 3.4.13 the elapsed time is
not anymore based on System.currentTimeMillis()
sijie closed pull request #2628: In ZK 3.4.13 the elapsed time is not anymore based on System.currentTimeMillis()
URL: https://github.com/apache/pulsar/pull/2628
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-zookeeper/src/main/java/org/apache/pulsar/zookeeper/FinalRequestProcessorAspect.java b/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/FinalRequestProcessorAspect.java
index bb1c96bcb9..8fbc5f0d03 100644
--- a/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/FinalRequestProcessorAspect.java
+++ b/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/FinalRequestProcessorAspect.java
@@ -22,6 +22,7 @@
import java.util.Map;
import org.apache.zookeeper.ZooDefs.OpCode;
+import org.apache.zookeeper.common.Time;
import org.apache.zookeeper.server.Request;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
@@ -90,7 +91,7 @@ public void timedProcessRequest(ProceedingJoinPoint joinPoint) throws Throwable
String type = requestTypeMap.getOrDefault(request.type, "unknown");
requests.labels(type).inc();
- long latencyMs = System.currentTimeMillis() - request.createTime;
+ long latencyMs = Time.currentElapsedTime() - request.createTime;
String latencyLabel = isWriteRequest(request.type) ? "write" : "read";
requestsLatency.labels(latencyLabel).observe(latencyMs);
}
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services