Skip to content

Commit 736bed6

Browse files
committed
[YARN-10353] Log vcores used and cumulative cpu in containers monitor.
Contributed by Jim Brennan
1 parent f2033de commit 736bed6

File tree

1 file changed

+7
-2
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,15 +648,20 @@ private void recordUsage(ContainerId containerId, String pId,
648648
long vmemLimit = ptInfo.getVmemLimit();
649649
long pmemLimit = ptInfo.getPmemLimit();
650650
if (AUDITLOG.isDebugEnabled()) {
651+
int vcoreLimit = ptInfo.getCpuVcores();
652+
long cumulativeCpuTime = pTree.getCumulativeCpuTime();
651653
AUDITLOG.debug(
652654
"Resource usage of ProcessTree {} for container-id {}:" +
653-
" {} CPU:{} CPU/core:{}",
655+
" {} %CPU: {} %CPU-cores: {}" +
656+
" vCores-used: {} of {} Cumulative-CPU-ms: {}",
654657
pId, containerId,
655658
formatUsageString(
656659
currentVmemUsage, vmemLimit,
657660
currentPmemUsage, pmemLimit),
658661
cpuUsagePercentPerCore,
659-
cpuUsageTotalCoresPercentage);
662+
cpuUsageTotalCoresPercentage,
663+
milliVcoresUsed / 1000, vcoreLimit,
664+
cumulativeCpuTime);
660665
}
661666

662667
// Add resource utilization for this container

0 commit comments

Comments
 (0)