The queue structure for the attached screenshot (PctOfQueueIsInnaccurate.jpg) has the following attributes:
There are 3 apps running in the root.swords.brisingr queue. The attributes for each of these apps are as follows:
||Allocated Memory MB
||% of Queue
The value to the right of the Queue: swords.brisingr bar graph says that the queue is 2001.3% used. This value is (almost) accurate because the actual memory allocation allotted to root.swords.brisingr is 12288 MB * 20% * 25% = 614.4 MB. Since root.swords.brisingr is consuming all 12288 MB, 12288 MB / 614.4 MB = 20 * 100% = 2000%
However, the sum of the % of Queue column for all apps running in root.swords.brisingr is 100.0% + 150.0% + 150.0% = 400%. This is inaccurate.
It appears as if the calculations are not taking into account the capacity of the parent queue, root.swords: 20%. For example,application_1471969002932_0001's usage is 4608 MB, and 12288 MB * 25% = 3072 MB, and 4608 / 3072 = 1.5 * 100% = 150%. This calculation should have been 4608 / 614.4 = 7.5 * 100% = 750%.
RMAppsBlock#renderData is calling ApplicationResourceUsageReport, which eventually calls SchedulerApplicationAttempt#getResourceUsageReport.
The following code in getResourceUsageReport, I think, needs to walk back up the parent tree to get all of the capacity values, not just the one for the leaf queue:
calc.divide(cluster, usedResourceClone, Resources.multiply(cluster,
queue.getQueueInfo(false, false).getCapacity())) * 100;