Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YARN-11653. Add Totoal_Memory and Total_Vcores columns in Nodes page #6501

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,22 @@ protected void render(Block html) {
.th(".allocationTags", "Allocation Tags")
.th(".mem", "Mem Used")
.th(".mem", "Mem Avail")
.th(".mem", "Mem Total")
.th(".mem", "Phys Mem Used %")
.th(".vcores", "VCores Used")
.th(".vcores", "VCores Avail")
.th(".vcores", "VCores Total")
.th(".vcores", "Phys VCores Used %");
} else {
trbody.th(".containers", "Running Containers (G)")
.th(".allocationTags", "Allocation Tags")
.th(".mem", "Mem Used (G)")
.th(".mem", "Mem Avail (G)")
.th(".mem", "Mem Total")
.th(".mem", "Phys Mem Used %")
.th(".vcores", "VCores Used (G)")
.th(".vcores", "VCores Avail (G)")
.th(".vcores", "VCores Total")
.th(".vcores", "Phys VCores Used %")
.th(".containers", "Running Containers (O)")
.th(".mem", "Mem Used (O)")
Expand Down Expand Up @@ -175,6 +179,8 @@ protected void render(Block html) {
NodeInfo info = new NodeInfo(ni, sched);
int usedMemory = (int) info.getUsedMemory();
int availableMemory = (int) info.getAvailableMemory();
long totalMemory = info.getTotalResource().getMemorySize();
int totalVcore = info.getTotalResource().getvCores();
nodeTableData.append("[\"")
.append(StringUtils.join(",", info.getNodeLabels())).append("\",\"")
.append(info.getRack()).append("\",\"").append(info.getState())
Expand All @@ -198,13 +204,17 @@ protected void render(Block html) {
.append("\",\"").append("<br title='")
.append(String.valueOf(availableMemory)).append("'>")
.append(StringUtils.byteDesc(availableMemory * BYTES_IN_MB))
.append("\",\"").append("<br title='").append(String.valueOf(totalMemory))
.append("'>").append(StringUtils.byteDesc(totalMemory * BYTES_IN_MB))
.append("\",\"")
.append(String.valueOf((int) info.getMemUtilization()))
.append("\",\"")
.append(String.valueOf(info.getUsedVirtualCores()))
.append("\",\"")
.append(String.valueOf(info.getAvailableVirtualCores()))
.append("\",\"")
.append(String.valueOf(totalVcore))
.append("\",\"")
.append(String.valueOf((int) info.getVcoreUtilization()))
.append("\",\"");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class TestNodesPage {
// Number of Actual Table Headers for NodesPage.NodesBlock might change in
// future. In that case this value should be adjusted to the new value.
private final int numberOfThInMetricsTable = 25;
private final int numberOfActualTableHeaders = 16;
private final int numberOfActualTableHeaders = 18;
private final int numberOfThForOpportunisticContainers = 4;

private Injector injector;
Expand Down