YARN-3467. Expose allocatedMB, allocatedVCores, and runningContainers metrics on running Applications in RM Web UI. (Anubhav Dhoot via kasha)

This commit is contained in:
Karthik Kambatla 2015-05-30 13:36:24 -07:00
parent eb6bf91eea
commit a8acdd65b3
5 changed files with 33 additions and 2 deletions

View File

@ -283,6 +283,9 @@ Release 2.8.0 - UNRELEASED
YARN-3713. Remove duplicate function call storeContainerDiagnostics in
ContainerDiagnosticsUpdateTransition (zxu via rkanter)
YARN-3467. Expose allocatedMB, allocatedVCores, and runningContainers metrics on
running Applications in RM Web UI. (Anubhav Dhoot via kasha)
OPTIMIZATIONS
YARN-3339. TestDockerContainerExecutor should pull a single image and not

View File

@ -52,9 +52,9 @@ public class WebPageUtils {
.append(", 'mRender': renderHadoopDate }")
.append("\n, {'sType':'numeric', bSearchable:false, 'aTargets':");
if (isFairSchedulerPage) {
sb.append("[11]");
sb.append("[13]");
} else if (isResourceManager) {
sb.append("[10]");
sb.append("[12]");
} else {
sb.append("[9]");
}

View File

@ -58,6 +58,8 @@ public class AppInfo {
protected long finishedTime;
protected long elapsedTime;
protected String applicationTags;
private int allocatedCpuVcores;
private int allocatedMemoryMB;
public AppInfo() {
// JAXB needs this
@ -86,6 +88,10 @@ public class AppInfo {
if (app.getApplicationResourceUsageReport() != null) {
runningContainers =
app.getApplicationResourceUsageReport().getNumUsedContainers();
allocatedCpuVcores = app.getApplicationResourceUsageReport()
.getUsedResources().getVirtualCores();
allocatedMemoryMB = app.getApplicationResourceUsageReport()
.getUsedResources().getMemory();
}
progress = app.getProgress() * 100; // in percent
if (app.getApplicationTags() != null && !app.getApplicationTags().isEmpty()) {
@ -133,6 +139,14 @@ public class AppInfo {
return runningContainers;
}
public int getAllocatedCpuVcores() {
return allocatedCpuVcores;
}
public int getAllocatedMemoryMB() {
return allocatedMemoryMB;
}
public float getProgress() {
return progress;
}

View File

@ -93,6 +93,8 @@ public class FairSchedulerAppsBlock extends HtmlBlock {
th(".state", "State").
th(".finalstatus", "FinalStatus").
th(".runningcontainer", "Running Containers").
th(".allocatedCpu", "Allocated CPU VCores").
th(".allocatedMemory", "Allocated Memory MB").
th(".progress", "Progress").
th(".ui", "Tracking UI")._()._().
tbody();
@ -136,6 +138,10 @@ public class FairSchedulerAppsBlock extends HtmlBlock {
.append(appInfo.getFinalStatus()).append("\",\"")
.append(appInfo.getRunningContainers() == -1 ? "N/A" : String
.valueOf(appInfo.getRunningContainers())).append("\",\"")
.append(appInfo.getAllocatedVCores() == -1 ? "N/A" : String
.valueOf(appInfo.getAllocatedVCores())).append("\",\"")
.append(appInfo.getAllocatedMB() == -1 ? "N/A" : String
.valueOf(appInfo.getAllocatedMB())).append("\",\"")
// Progress bar
.append("<br title='").append(percent)
.append("'> <div class='").append(C_PROGRESSBAR).append("' title='")

View File

@ -60,6 +60,8 @@ public class RMAppsBlock extends AppsBlock {
.th(".finishtime", "FinishTime").th(".state", "State")
.th(".finalstatus", "FinalStatus")
.th(".runningcontainer", "Running Containers")
.th(".allocatedCpu", "Allocated CPU VCores")
.th(".allocatedMemory", "Allocated Memory MB")
.th(".progress", "Progress")
.th(".ui", "Tracking UI").th(".blacklisted", "Blacklisted Nodes")._()
._().tbody();
@ -114,6 +116,12 @@ public class RMAppsBlock extends AppsBlock {
.append(app.getRunningContainers() == -1 ? "N/A" : String
.valueOf(app.getRunningContainers()))
.append("\",\"")
.append(app.getAllocatedCpuVcores() == -1 ? "N/A" : String
.valueOf(app.getAllocatedCpuVcores()))
.append("\",\"")
.append(app.getAllocatedMemoryMB() == -1 ? "N/A" : String
.valueOf(app.getAllocatedMemoryMB()))
.append("\",\"")
// Progress bar
.append("<br title='").append(percent).append("'> <div class='")
.append(C_PROGRESSBAR).append("' title='").append(join(percent, '%'))