From 41361ec39e84ec9949285b86ed97888ed4871bc4 Mon Sep 17 00:00:00 2001 From: Karthik Kambatla Date: Thu, 9 Feb 2017 13:12:21 -0800 Subject: [PATCH] YARN-6112. UpdateCallDuration is calculated only when debug logging is enabled. (Yufei Gu via kasha) --- .../resourcemanager/scheduler/fair/FairScheduler.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java index 9694d62552f..f75f2ddd8f0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java @@ -312,6 +312,9 @@ public class FairScheduler extends long start = getClock().getTime(); update(); long duration = getClock().getTime() - start; + // UpdateCall duration and ThreadRun Duration are the same after + // YARN-4752 (preemption overhaul), we keep both for compatibility. + fsOpDurations.addUpdateCallDuration(duration); fsOpDurations.addUpdateThreadRunDuration(duration); } catch (InterruptedException ie) { LOG.warn("Update thread interrupted. Exiting."); @@ -351,7 +354,6 @@ public class FairScheduler extends protected void update() { try { writeLock.lock(); - long start = getClock().getTime(); FSQueue rootQueue = queueMgr.getRootQueue(); @@ -374,9 +376,6 @@ public class FairScheduler extends rootMetrics.getAvailableVirtualCores()) + " Demand: " + rootQueue.getDemand()); } - - long duration = getClock().getTime() - start; - fsOpDurations.addUpdateCallDuration(duration); } } finally { writeLock.unlock();