From d795661868e330ac55d6ac7b0ee62fb658e03ff7 Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Thu, 4 Jan 2018 10:15:52 -0600 Subject: [PATCH] YARN-7678. Ability to enable logging of container memory stats. Contributed by Jim Brennan --- .../containermanager/monitor/ContainersMonitorImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java index bc2864691f8..23c89c034f8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java @@ -59,6 +59,8 @@ public class ContainersMonitorImpl extends AbstractService implements private final static Logger LOG = LoggerFactory.getLogger(ContainersMonitorImpl.class); + private final static Logger AUDITLOG = + LoggerFactory.getLogger(ContainersMonitorImpl.class.getName()+".audit"); private long monitoringInterval; private MonitoringThread monitoringThread; @@ -595,8 +597,8 @@ public class ContainersMonitorImpl extends AbstractService implements * maxVCoresAllottedForContainers /nodeCpuPercentageForYARN); long vmemLimit = ptInfo.getVmemLimit(); long pmemLimit = ptInfo.getPmemLimit(); - if (LOG.isDebugEnabled()) { - LOG.debug(String.format( + if (AUDITLOG.isDebugEnabled()) { + AUDITLOG.debug(String.format( "Memory usage of ProcessTree %s for container-id %s: ", pId, containerId.toString()) + formatUsageString(