internal CapacitySchedulerQueueInfo(CSQueue q) { queuePath = q.GetQueuePath(); capacity = q.GetCapacity() * 100; usedCapacity = q.GetUsedCapacity() * 100; maxCapacity = q.GetMaximumCapacity(); if (maxCapacity < Epsilon || maxCapacity > 1f) { maxCapacity = 1f; } maxCapacity *= 100; absoluteCapacity = Cap(q.GetAbsoluteCapacity(), 0f, 1f) * 100; absoluteMaxCapacity = Cap(q.GetAbsoluteMaximumCapacity(), 0f, 1f) * 100; absoluteUsedCapacity = Cap(q.GetAbsoluteUsedCapacity(), 0f, 1f) * 100; numApplications = q.GetNumApplications(); queueName = q.GetQueueName(); state = q.GetState(); resourcesUsed = new ResourceInfo(q.GetUsedResources()); if (q is PlanQueue && !((PlanQueue)q).ShowReservationsAsQueues()) { hideReservationQueues = true; } // add labels ICollection <string> labelSet = q.GetAccessibleNodeLabels(); if (labelSet != null) { Sharpen.Collections.AddAll(nodeLabels, labelSet); nodeLabels.Sort(); } }
private void VerifyQueueMetrics(CSQueue queue, int expectedMemory, Org.Apache.Hadoop.Yarn.Api.Records.Resource clusterResource) { NUnit.Framework.Assert.AreEqual(ComputeQueueAbsoluteUsedCapacity(queue, expectedMemory , clusterResource), queue.GetAbsoluteUsedCapacity(), Delta); NUnit.Framework.Assert.AreEqual(ComputeQueueUsedCapacity(queue, expectedMemory, clusterResource ), queue.GetUsedCapacity(), Delta); }