From d08b8c801a908b4242e7b21a54f3b1e4072f1eae Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Tue, 26 Sep 2017 16:45:39 +0900 Subject: [PATCH] HADOOP-14893. WritableRpcEngine should use Time.monotonicNow. Contributed by Chetna Chaudhari. --- .../main/java/org/apache/hadoop/ipc/WritableRpcEngine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/WritableRpcEngine.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/WritableRpcEngine.java index fa0726d401..f2b5862372 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/WritableRpcEngine.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/WritableRpcEngine.java @@ -231,7 +231,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { long startTime = 0; if (LOG.isDebugEnabled()) { - startTime = Time.now(); + startTime = Time.monotonicNow(); } // if Tracing is on then start a new span for this rpc. @@ -251,7 +251,7 @@ public Object invoke(Object proxy, Method method, Object[] args) if (traceScope != null) traceScope.close(); } if (LOG.isDebugEnabled()) { - long callTime = Time.now() - startTime; + long callTime = Time.monotonicNow() - startTime; LOG.debug("Call: " + method.getName() + " " + callTime); } return value.get();