public ClusterMetricsInfo(ResourceManager rm) { // JAXB needs this 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 UserMetricsInfo(ResourceManager rm, string user) { // JAXB needs this 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(); } }