From dcf4559ebdb5bb11d03b264a9875bff316b89eef Mon Sep 17 00:00:00 2001 From: Brahma Reddy Battula Date: Thu, 25 May 2017 01:27:13 +0800 Subject: [PATCH] HADOOP-14166. Reset the DecayRpcScheduler AvgResponseTime metric to zero when queue is not used. Contributed by Surendra Singh Lilhore. --- .../src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java index 3c096258301..5ae4e8bcc50 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java @@ -618,6 +618,8 @@ public class DecayRpcScheduler implements RpcScheduler, } else { responseTimeAvgInLastWindow.set(i, averageResponseTime); } + } else { + responseTimeAvgInLastWindow.set(i, 0); } responseTimeCountInLastWindow.set(i, responseTimeCount); if (LOG.isDebugEnabled()) {