YARN-11653. Add Totoal_Memory and Total_Vcores columns in Nodes page (#6501) Contributed by Jiandan Yang.
Signed-off-by: Shilun Fan <slfan1989@apache.org>
This commit is contained in:
parent
8261229daa
commit
98259fb4da
@ -88,18 +88,22 @@ protected void render(Block html) {
|
|||||||
.th(".allocationTags", "Allocation Tags")
|
.th(".allocationTags", "Allocation Tags")
|
||||||
.th(".mem", "Mem Used")
|
.th(".mem", "Mem Used")
|
||||||
.th(".mem", "Mem Avail")
|
.th(".mem", "Mem Avail")
|
||||||
|
.th(".mem", "Mem Total")
|
||||||
.th(".mem", "Phys Mem Used %")
|
.th(".mem", "Phys Mem Used %")
|
||||||
.th(".vcores", "VCores Used")
|
.th(".vcores", "VCores Used")
|
||||||
.th(".vcores", "VCores Avail")
|
.th(".vcores", "VCores Avail")
|
||||||
|
.th(".vcores", "VCores Total")
|
||||||
.th(".vcores", "Phys VCores Used %");
|
.th(".vcores", "Phys VCores Used %");
|
||||||
} else {
|
} else {
|
||||||
trbody.th(".containers", "Running Containers (G)")
|
trbody.th(".containers", "Running Containers (G)")
|
||||||
.th(".allocationTags", "Allocation Tags")
|
.th(".allocationTags", "Allocation Tags")
|
||||||
.th(".mem", "Mem Used (G)")
|
.th(".mem", "Mem Used (G)")
|
||||||
.th(".mem", "Mem Avail (G)")
|
.th(".mem", "Mem Avail (G)")
|
||||||
|
.th(".mem", "Mem Total")
|
||||||
.th(".mem", "Phys Mem Used %")
|
.th(".mem", "Phys Mem Used %")
|
||||||
.th(".vcores", "VCores Used (G)")
|
.th(".vcores", "VCores Used (G)")
|
||||||
.th(".vcores", "VCores Avail (G)")
|
.th(".vcores", "VCores Avail (G)")
|
||||||
|
.th(".vcores", "VCores Total")
|
||||||
.th(".vcores", "Phys VCores Used %")
|
.th(".vcores", "Phys VCores Used %")
|
||||||
.th(".containers", "Running Containers (O)")
|
.th(".containers", "Running Containers (O)")
|
||||||
.th(".mem", "Mem Used (O)")
|
.th(".mem", "Mem Used (O)")
|
||||||
@ -175,6 +179,8 @@ protected void render(Block html) {
|
|||||||
NodeInfo info = new NodeInfo(ni, sched);
|
NodeInfo info = new NodeInfo(ni, sched);
|
||||||
int usedMemory = (int) info.getUsedMemory();
|
int usedMemory = (int) info.getUsedMemory();
|
||||||
int availableMemory = (int) info.getAvailableMemory();
|
int availableMemory = (int) info.getAvailableMemory();
|
||||||
|
long totalMemory = info.getTotalResource().getMemorySize();
|
||||||
|
int totalVcore = info.getTotalResource().getvCores();
|
||||||
nodeTableData.append("[\"")
|
nodeTableData.append("[\"")
|
||||||
.append(StringUtils.join(",", info.getNodeLabels())).append("\",\"")
|
.append(StringUtils.join(",", info.getNodeLabels())).append("\",\"")
|
||||||
.append(info.getRack()).append("\",\"").append(info.getState())
|
.append(info.getRack()).append("\",\"").append(info.getState())
|
||||||
@ -198,6 +204,8 @@ protected void render(Block html) {
|
|||||||
.append("\",\"").append("<br title='")
|
.append("\",\"").append("<br title='")
|
||||||
.append(String.valueOf(availableMemory)).append("'>")
|
.append(String.valueOf(availableMemory)).append("'>")
|
||||||
.append(StringUtils.byteDesc(availableMemory * BYTES_IN_MB))
|
.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("\",\"")
|
||||||
.append(String.valueOf((int) info.getMemUtilization()))
|
.append(String.valueOf((int) info.getMemUtilization()))
|
||||||
.append("\",\"")
|
.append("\",\"")
|
||||||
@ -205,6 +213,8 @@ protected void render(Block html) {
|
|||||||
.append("\",\"")
|
.append("\",\"")
|
||||||
.append(String.valueOf(info.getAvailableVirtualCores()))
|
.append(String.valueOf(info.getAvailableVirtualCores()))
|
||||||
.append("\",\"")
|
.append("\",\"")
|
||||||
|
.append(String.valueOf(totalVcore))
|
||||||
|
.append("\",\"")
|
||||||
.append(String.valueOf((int) info.getVcoreUtilization()))
|
.append(String.valueOf((int) info.getVcoreUtilization()))
|
||||||
.append("\",\"");
|
.append("\",\"");
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ public class TestNodesPage {
|
|||||||
// Number of Actual Table Headers for NodesPage.NodesBlock might change in
|
// Number of Actual Table Headers for NodesPage.NodesBlock might change in
|
||||||
// future. In that case this value should be adjusted to the new value.
|
// future. In that case this value should be adjusted to the new value.
|
||||||
private final int numberOfThInMetricsTable = 25;
|
private final int numberOfThInMetricsTable = 25;
|
||||||
private final int numberOfActualTableHeaders = 16;
|
private final int numberOfActualTableHeaders = 18;
|
||||||
private final int numberOfThForOpportunisticContainers = 4;
|
private final int numberOfThForOpportunisticContainers = 4;
|
||||||
|
|
||||||
private Injector injector;
|
private Injector injector;
|
||||||
|
Loading…
Reference in New Issue
Block a user