bug 10848: listCapacity - sum the used and reserved capacities. Also apply overprovisioning factore explicitly

This commit is contained in:
Nitin 2011-10-19 18:01:30 +05:30
parent 2fc5cc73ba
commit 3921421ce5
2 changed files with 7 additions and 3 deletions

View File

@ -255,7 +255,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
public Long getUsedCapacity() {
return sumUsed;
}
public long getSumReserved() {
public long getReservedCapacity() {
return sumReserved;
}
public Long getTotalCapacity() {

View File

@ -2481,8 +2481,12 @@ public class ManagementServerImpl implements ManagementServer {
for (SummedCapacity summedCapacity : summedCapacities){
CapacityVO capacity = new CapacityVO(null, zoneId, podId, clusterId,
summedCapacity.getUsedCapacity(), summedCapacity.getTotalCapacity(), summedCapacity.getCapacityType());
summedCapacity.getUsedCapacity() + summedCapacity.getReservedCapacity(),
summedCapacity.getTotalCapacity(), summedCapacity.getCapacityType());
if (capacityType == Capacity.CAPACITY_TYPE_CPU){
capacity.setTotalCapacity((long)(summedCapacity.getTotalCapacity() * ApiDBUtils.getCpuOverprovisioningFactor()));
}
capacities.add(capacity);
}