YARN-7699. queueUsagePercentage is coming as INF for getApp REST api call. Contributed by Sunil G.
This commit is contained in:
parent
bf5c948995
commit
c2d6fa3656
|
@ -1011,11 +1011,14 @@ public class FiCaSchedulerApp extends SchedulerApplicationAttempt {
|
||||||
getAppAMNodePartitionName(), cluster);
|
getAppAMNodePartitionName(), cluster);
|
||||||
ResourceCalculator calc =
|
ResourceCalculator calc =
|
||||||
rmContext.getScheduler().getResourceCalculator();
|
rmContext.getScheduler().getResourceCalculator();
|
||||||
|
float queueUsagePerc = 0.0f;
|
||||||
if (!calc.isInvalidDivisor(totalPartitionRes)) {
|
if (!calc.isInvalidDivisor(totalPartitionRes)) {
|
||||||
Resource effCap = ((AbstractCSQueue) getQueue())
|
Resource effCap = ((AbstractCSQueue) getQueue())
|
||||||
.getEffectiveCapacity(getAppAMNodePartitionName());
|
.getEffectiveCapacity(getAppAMNodePartitionName());
|
||||||
float queueUsagePerc = calc.divide(totalPartitionRes,
|
if (!effCap.equals(Resources.none())) {
|
||||||
report.getUsedResources(), effCap) * 100;
|
queueUsagePerc = calc.divide(totalPartitionRes,
|
||||||
|
report.getUsedResources(), effCap) * 100;
|
||||||
|
}
|
||||||
report.setQueueUsagePercentage(queueUsagePerc);
|
report.setQueueUsagePercentage(queueUsagePerc);
|
||||||
}
|
}
|
||||||
return report;
|
return report;
|
||||||
|
|
Loading…
Reference in New Issue