瀏覽代碼

[YARN-10353] Log vcores used and cumulative cpu in containers monitor.
Contributed by Jim Brennan

(cherry picked from commit 736bed6d6d20a17b522a0686ca3fd2d97e7e6838)

Eric Badger 4 年之前
父節點
當前提交
01ada576f3

+ 7 - 2
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

@@ -653,15 +653,20 @@ public class ContainersMonitorImpl extends AbstractService implements
       long vmemLimit = ptInfo.getVmemLimit();
       long pmemLimit = ptInfo.getPmemLimit();
       if (AUDITLOG.isDebugEnabled()) {
+        int vcoreLimit = ptInfo.getCpuVcores();
+        long cumulativeCpuTime = pTree.getCumulativeCpuTime();
         AUDITLOG.debug(String.format(
             "Resource usage of ProcessTree %s for container-id %s:" +
-                " %s CPU:%f CPU/core:%f",
+                " %s %%CPU: %f %%CPU-cores: %f" +
+                " vCores-used: %d of %d Cumulative-CPU-ms: %d",
             pId, containerId.toString(),
             formatUsageString(
                 currentVmemUsage, vmemLimit,
                 currentPmemUsage, pmemLimit),
             cpuUsagePercentPerCore,
-            cpuUsageTotalCoresPercentage));
+            cpuUsageTotalCoresPercentage,
+            milliVcoresUsed / 1000, vcoreLimit,
+            cumulativeCpuTime));
       }
 
       // Add resource utilization for this container