|
@@ -389,6 +389,10 @@ public class TestRMWebServices extends JerseyTest {
|
|
|
WebServicesTestUtils.getXmlInt(element, "reservedMB"),
|
|
|
WebServicesTestUtils.getXmlInt(element, "availableMB"),
|
|
|
WebServicesTestUtils.getXmlInt(element, "allocatedMB"),
|
|
|
+ WebServicesTestUtils.getXmlInt(element, "reservedVirtualCores"),
|
|
|
+ WebServicesTestUtils.getXmlInt(element, "availableVirtualCores"),
|
|
|
+ WebServicesTestUtils.getXmlInt(element, "allocatedVirtualCores"),
|
|
|
+ WebServicesTestUtils.getXmlInt(element, "totalVirtualCores"),
|
|
|
WebServicesTestUtils.getXmlInt(element, "containersAllocated"),
|
|
|
WebServicesTestUtils.getXmlInt(element, "totalMB"),
|
|
|
WebServicesTestUtils.getXmlInt(element, "totalNodes"),
|
|
@@ -404,11 +408,13 @@ public class TestRMWebServices extends JerseyTest {
|
|
|
Exception {
|
|
|
assertEquals("incorrect number of elements", 1, json.length());
|
|
|
JSONObject clusterinfo = json.getJSONObject("clusterMetrics");
|
|
|
- assertEquals("incorrect number of elements", 19, clusterinfo.length());
|
|
|
+ assertEquals("incorrect number of elements", 23, clusterinfo.length());
|
|
|
verifyClusterMetrics(
|
|
|
clusterinfo.getInt("appsSubmitted"), clusterinfo.getInt("appsCompleted"),
|
|
|
clusterinfo.getInt("reservedMB"), clusterinfo.getInt("availableMB"),
|
|
|
clusterinfo.getInt("allocatedMB"),
|
|
|
+ clusterinfo.getInt("reservedVirtualCores"), clusterinfo.getInt("availableVirtualCores"),
|
|
|
+ clusterinfo.getInt("allocatedVirtualCores"), clusterinfo.getInt("totalVirtualCores"),
|
|
|
clusterinfo.getInt("containersAllocated"),
|
|
|
clusterinfo.getInt("totalMB"), clusterinfo.getInt("totalNodes"),
|
|
|
clusterinfo.getInt("lostNodes"), clusterinfo.getInt("unhealthyNodes"),
|
|
@@ -418,7 +424,9 @@ public class TestRMWebServices extends JerseyTest {
|
|
|
|
|
|
public void verifyClusterMetrics(int submittedApps, int completedApps,
|
|
|
int reservedMB, int availableMB,
|
|
|
- int allocMB, int containersAlloc, int totalMB, int totalNodes,
|
|
|
+ int allocMB, int reservedVirtualCores, int availableVirtualCores,
|
|
|
+ int allocVirtualCores, int totalVirtualCores,
|
|
|
+ int containersAlloc, int totalMB, int totalNodes,
|
|
|
int lostNodes, int unhealthyNodes, int decommissionedNodes,
|
|
|
int rebootedNodes, int activeNodes) throws JSONException, Exception {
|
|
|
|
|
@@ -428,7 +436,8 @@ public class TestRMWebServices extends JerseyTest {
|
|
|
|
|
|
long totalMBExpect =
|
|
|
metrics.getAvailableMB() + metrics.getAllocatedMB();
|
|
|
-
|
|
|
+ long totalVirtualCoresExpect =
|
|
|
+ metrics.getAvailableVirtualCores() + metrics.getAllocatedVirtualCores();
|
|
|
assertEquals("appsSubmitted doesn't match",
|
|
|
metrics.getAppsSubmitted(), submittedApps);
|
|
|
assertEquals("appsCompleted doesn't match",
|
|
@@ -439,6 +448,12 @@ public class TestRMWebServices extends JerseyTest {
|
|
|
metrics.getAvailableMB(), availableMB);
|
|
|
assertEquals("allocatedMB doesn't match",
|
|
|
metrics.getAllocatedMB(), allocMB);
|
|
|
+ assertEquals("reservedVirtualCores doesn't match",
|
|
|
+ metrics.getReservedVirtualCores(), reservedVirtualCores);
|
|
|
+ assertEquals("availableVirtualCores doesn't match",
|
|
|
+ metrics.getAvailableVirtualCores(), availableVirtualCores);
|
|
|
+ assertEquals("allocatedVirtualCores doesn't match",
|
|
|
+ totalVirtualCoresExpect, allocVirtualCores);
|
|
|
assertEquals("containersAllocated doesn't match", 0, containersAlloc);
|
|
|
assertEquals("totalMB doesn't match", totalMBExpect, totalMB);
|
|
|
assertEquals(
|