Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 816C5200CE6 for ; Wed, 16 Aug 2017 20:20:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7FEB7169169; Wed, 16 Aug 2017 18:20:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D4E16169174 for ; Wed, 16 Aug 2017 20:20:55 +0200 (CEST) Received: (qmail 61264 invoked by uid 500); 16 Aug 2017 18:20:51 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 60043 invoked by uid 99); 16 Aug 2017 18:20:50 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Aug 2017 18:20:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 41758F5CCD; Wed, 16 Aug 2017 18:20:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sunilg@apache.org To: common-commits@hadoop.apache.org Date: Wed, 16 Aug 2017 18:21:00 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [13/50] [abbrv] hadoop git commit: HADOOP-14732. ProtobufRpcEngine should use Time.monotonicNow to measure durations. Contributed by Hanisha Koneru. archived-at: Wed, 16 Aug 2017 18:20:56 -0000 HADOOP-14732. ProtobufRpcEngine should use Time.monotonicNow to measure durations. Contributed by Hanisha Koneru. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8bef4eca Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8bef4eca Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8bef4eca Branch: refs/heads/YARN-3926 Commit: 8bef4eca28a3466707cc4ea0de0330449319a5eb Parents: 5558792 Author: Arpit Agarwal Authored: Mon Aug 14 15:53:35 2017 -0700 Committer: Arpit Agarwal Committed: Mon Aug 14 15:53:35 2017 -0700 ---------------------------------------------------------------------- .../java/org/apache/hadoop/ipc/ProtobufRpcEngine.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8bef4eca/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java index 639bbad..2c0cfe5 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java @@ -190,7 +190,7 @@ public class ProtobufRpcEngine implements RpcEngine { throws ServiceException { long startTime = 0; if (LOG.isDebugEnabled()) { - startTime = Time.now(); + startTime = Time.monotonicNow(); } if (args.length != 2) { // RpcController + Message @@ -245,7 +245,7 @@ public class ProtobufRpcEngine implements RpcEngine { } if (LOG.isDebugEnabled()) { - long callTime = Time.now() - startTime; + long callTime = Time.monotonicNow() - startTime; LOG.debug("Call: " + method.getName() + " took " + callTime + "ms"); } @@ -373,19 +373,19 @@ public class ProtobufRpcEngine implements RpcEngine { this.server = currentCallInfo.get().server; this.call = Server.getCurCall().get(); this.methodName = currentCallInfo.get().methodName; - this.setupTime = Time.now(); + this.setupTime = Time.monotonicNow(); } @Override public void setResponse(Message message) { - long processingTime = Time.now() - setupTime; + long processingTime = Time.monotonicNow() - setupTime; call.setDeferredResponse(RpcWritable.wrap(message)); server.updateDeferredMetrics(methodName, processingTime); } @Override public void error(Throwable t) { - long processingTime = Time.now() - setupTime; + long processingTime = Time.monotonicNow() - setupTime; String detailedMetricsName = t.getClass().getSimpleName(); server.updateDeferredMetrics(detailedMetricsName, processingTime); call.setDeferredError(t); @@ -513,7 +513,7 @@ public class ProtobufRpcEngine implements RpcEngine { Message param = request.getValue(prototype); Message result; - long startTime = Time.now(); + long startTime = Time.monotonicNow(); int qTime = (int) (startTime - receiveTime); Exception exception = null; boolean isDeferred = false; @@ -537,7 +537,7 @@ public class ProtobufRpcEngine implements RpcEngine { throw e; } finally { currentCallInfo.set(null); - int processingTime = (int) (Time.now() - startTime); + int processingTime = (int) (Time.monotonicNow() - startTime); if (LOG.isDebugEnabled()) { String msg = "Served: " + methodName + (isDeferred ? ", deferred" : "") + --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org