if (this.reservations.get(utilization).containsKey(tagGroup)) {
for (Reservation reservation : this.reservations.get(utilization).get(tagGroup)) {
if (time >= reservation.start && time < reservation.end) {
count += reservation.count;
Ec2InstanceReservationPrice.Key key = new Ec2InstanceReservationPrice.Key(tagGroup.region, tagGroup.usageType);
Ec2InstanceReservationPrice ec2Price = ec2InstanceReservationPrices.get(utilization).get(key);
if (ec2Price != null) { // remove this...
upfrontAmortized += reservation.count * ec2Price.upfrontPrice.getPrice(reservation.start).getUpfrontAmortized(reservation.start, term, tier);
houlyCost += reservation.count * ec2Price.hourlyPrice.getPrice(reservation.start).getPrice(tier);
}
else {
logger.error("Not able to find reservation price for " + key);
}
}
}
}
if (count == 0) {
Ec2InstanceReservationPrice.Key key = new Ec2InstanceReservationPrice.Key(tagGroup.region, tagGroup.usageType);
Ec2InstanceReservationPrice ec2Price = ec2InstanceReservationPrices.get(utilization).get(key);
if (ec2Price != null) { // remove this...
upfrontAmortized = ec2Price.upfrontPrice.getPrice(null).getUpfrontAmortized(time, term, tier);
houlyCost = ec2Price.hourlyPrice.getPrice(null).getPrice(tier);
}
}