@Override public QueueMetrics getRootQueueMetrics() { return scheduler.getRootQueueMetrics(); }
@Override public Integer getValue() { if(scheduler == null || scheduler.getRootQueueMetrics() == null) { return 0; } else { return scheduler.getRootQueueMetrics().getAvailableMB(); } } }
@Override public Integer getValue() { if(scheduler == null || scheduler.getRootQueueMetrics() == null) { return 0; } else { return scheduler.getRootQueueMetrics().getAllocatedMB(); } } }
@Override public Integer getValue() { if(scheduler == null || scheduler.getRootQueueMetrics() == null) { return 0; } else { return scheduler.getRootQueueMetrics().getAllocatedVirtualCores(); } } }
@Override public Integer getValue() { if(scheduler == null || scheduler.getRootQueueMetrics() == null) { return 0; } else { return scheduler.getRootQueueMetrics().getAllocatedContainers(); } } }
@Override public Integer getValue() { if (scheduler == null || scheduler.getRootQueueMetrics() == null) { return 0; } else { return scheduler.getRootQueueMetrics().getAppsRunning(); } } }
@Override public Integer getValue() { if(scheduler == null || scheduler.getRootQueueMetrics() == null) { return 0; } else { return scheduler.getRootQueueMetrics().getAvailableVirtualCores(); } } }
private void waitForClusterMemory(MockNM nm1, ResourceScheduler rs, int clusterMemory) throws Exception, InterruptedException { int counter = 0; while (rs.getRootQueueMetrics().getAllocatedMB() != clusterMemory) { nm1.nodeHeartbeat(true); Thread.sleep(100); if (counter++ == 50) { Assert.fail("Wait for cluster memory is timed out.Expected=" + clusterMemory + " Actual=" + rs.getRootQueueMetrics().getAllocatedMB()); } } }
private void waitForClusterMemory(MockNM nm1, ResourceScheduler rs, int clusterMemory) throws Exception, InterruptedException { int counter = 0; while (rs.getRootQueueMetrics().getAllocatedMB() != clusterMemory) { nm1.nodeHeartbeat(true); Thread.sleep(100); if (counter++ == 50) { Assert.fail("Wait for cluster memory is timed out.Expected=" + clusterMemory + " Actual=" + rs.getRootQueueMetrics().getAllocatedMB()); } } }
@Test public void testMetricsInitializedOnRMInit() { YarnConfiguration conf = new YarnConfiguration(); conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class); MockRM rm = new MockRM(conf); QueueMetrics metrics = rm.getResourceScheduler().getRootQueueMetrics(); checkApps(metrics, 0, 0, 0, 0, 0, 0, true); MetricsAsserts.assertGauge("ReservedContainers", 0, metrics); }
@Test public void testMetricsInitializedOnRMInit() { YarnConfiguration conf = new YarnConfiguration(); conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class); MockRM rm = new MockRM(conf); QueueMetrics metrics = rm.getResourceScheduler().getRootQueueMetrics(); checkApps(metrics, 0, 0, 0, 0, 0, 0, true); MetricsAsserts.assertGauge("ReservedContainers", 0, metrics); }
QueueMetrics metrics = rm.getResourceScheduler().getRootQueueMetrics();
QueueMetrics metrics = rm.getResourceScheduler().getRootQueueMetrics();
int activeApplications) throws Exception { int timeoutSecs = 0; QueueMetrics metrics = rm.getResourceScheduler().getRootQueueMetrics(); ClusterMetrics clusterMetrics = ClusterMetrics.getMetrics(); boolean isAllMetricAssertionDone = false;
int activeApplications) throws Exception { int timeoutSecs = 0; QueueMetrics metrics = rm.getResourceScheduler().getRootQueueMetrics(); ClusterMetrics clusterMetrics = ClusterMetrics.getMetrics(); boolean isAllMetricAssertionDone = false;
public UserMetricsInfo(final ResourceManager rm, final String user) { ResourceScheduler rs = rm.getResourceScheduler(); QueueMetrics metrics = rs.getRootQueueMetrics(); QueueMetrics userMetrics = metrics.getUserMetrics(user); this.userMetricsAvailable = false; if (userMetrics != null) { this.userMetricsAvailable = true; this.appsSubmitted = userMetrics.getAppsSubmitted(); this.appsCompleted = userMetrics.getAppsCompleted(); this.appsPending = userMetrics.getAppsPending(); this.appsRunning = userMetrics.getAppsRunning(); this.appsFailed = userMetrics.getAppsFailed(); this.appsKilled = userMetrics.getAppsKilled(); this.runningContainers = userMetrics.getAllocatedContainers(); this.pendingContainers = userMetrics.getPendingContainers(); this.reservedContainers = userMetrics.getReservedContainers(); this.reservedMB = userMetrics.getReservedMB(); this.pendingMB = userMetrics.getPendingMB(); this.allocatedMB = userMetrics.getAllocatedMB(); this.reservedVirtualCores = userMetrics.getReservedVirtualCores(); this.pendingVirtualCores = userMetrics.getPendingVirtualCores(); this.allocatedVirtualCores = userMetrics.getAllocatedVirtualCores(); } }
public UserMetricsInfo(final ResourceManager rm, final String user) { ResourceScheduler rs = rm.getResourceScheduler(); QueueMetrics metrics = rs.getRootQueueMetrics(); QueueMetrics userMetrics = metrics.getUserMetrics(user); this.userMetricsAvailable = false; if (userMetrics != null) { this.userMetricsAvailable = true; this.appsSubmitted = userMetrics.getAppsSubmitted(); this.appsCompleted = userMetrics.getAppsCompleted(); this.appsPending = userMetrics.getAppsPending(); this.appsRunning = userMetrics.getAppsRunning(); this.appsFailed = userMetrics.getAppsFailed(); this.appsKilled = userMetrics.getAppsKilled(); this.runningContainers = userMetrics.getAllocatedContainers(); this.pendingContainers = userMetrics.getPendingContainers(); this.reservedContainers = userMetrics.getReservedContainers(); this.reservedMB = userMetrics.getReservedMB(); this.pendingMB = userMetrics.getPendingMB(); this.allocatedMB = userMetrics.getAllocatedMB(); this.reservedVirtualCores = userMetrics.getReservedVirtualCores(); this.pendingVirtualCores = userMetrics.getPendingVirtualCores(); this.allocatedVirtualCores = userMetrics.getAllocatedVirtualCores(); } }
public UserMetricsInfo(final ResourceManager rm, final String user) { ResourceScheduler rs = rm.getResourceScheduler(); QueueMetrics metrics = rs.getRootQueueMetrics(); QueueMetrics userMetrics = metrics.getUserMetrics(user); this.userMetricsAvailable = false; if (userMetrics != null) { this.userMetricsAvailable = true; this.appsSubmitted = userMetrics.getAppsSubmitted(); this.appsCompleted = userMetrics.getAppsCompleted(); this.appsPending = userMetrics.getAppsPending(); this.appsRunning = userMetrics.getAppsRunning(); this.appsFailed = userMetrics.getAppsFailed(); this.appsKilled = userMetrics.getAppsKilled(); this.runningContainers = userMetrics.getAllocatedContainers(); this.pendingContainers = userMetrics.getPendingContainers(); this.reservedContainers = userMetrics.getReservedContainers(); this.reservedMB = userMetrics.getReservedMB(); this.pendingMB = userMetrics.getPendingMB(); this.allocatedMB = userMetrics.getAllocatedMB(); this.reservedVirtualCores = userMetrics.getReservedVirtualCores(); this.pendingVirtualCores = userMetrics.getPendingVirtualCores(); this.allocatedVirtualCores = userMetrics.getAllocatedVirtualCores(); } }
public ClusterMetricsInfo(final ResourceManager rm) { ResourceScheduler rs = rm.getResourceScheduler(); QueueMetrics metrics = rs.getRootQueueMetrics(); ClusterMetrics clusterMetrics = ClusterMetrics.getMetrics(); this.appsSubmitted = metrics.getAppsSubmitted(); this.appsCompleted = metrics.getAppsCompleted(); this.appsPending = metrics.getAppsPending(); this.appsRunning = metrics.getAppsRunning(); this.appsFailed = metrics.getAppsFailed(); this.appsKilled = metrics.getAppsKilled(); this.reservedMB = metrics.getReservedMB(); this.availableMB = metrics.getAvailableMB(); this.allocatedMB = metrics.getAllocatedMB(); this.reservedVirtualCores = metrics.getReservedVirtualCores(); this.availableVirtualCores = metrics.getAvailableVirtualCores(); this.allocatedVirtualCores = metrics.getAllocatedVirtualCores(); this.containersAllocated = metrics.getAllocatedContainers(); this.containersPending = metrics.getPendingContainers(); this.containersReserved = metrics.getReservedContainers(); this.totalMB = availableMB + allocatedMB; this.totalVirtualCores = availableVirtualCores + allocatedVirtualCores; this.activeNodes = clusterMetrics.getNumActiveNMs(); this.lostNodes = clusterMetrics.getNumLostNMs(); this.unhealthyNodes = clusterMetrics.getUnhealthyNMs(); this.decommissionedNodes = clusterMetrics.getNumDecommisionedNMs(); this.rebootedNodes = clusterMetrics.getNumRebootedNMs(); this.totalNodes = activeNodes + lostNodes + decommissionedNodes + rebootedNodes + unhealthyNodes; }
public ClusterMetricsInfo(final ResourceManager rm) { ResourceScheduler rs = rm.getResourceScheduler(); QueueMetrics metrics = rs.getRootQueueMetrics(); ClusterMetrics clusterMetrics = ClusterMetrics.getMetrics();