// we have the n OOBs, so lets fetch the MeasurementData for those
List<MeasurementDataPK> pks = new ArrayList<MeasurementDataPK>(results.size());
Map<MeasurementDataPK, MeasurementOOBComposite> map = new HashMap<MeasurementDataPK, MeasurementOOBComposite>();
for (MeasurementOOBComposite comp : results) {
int schedule = comp.getScheduleId();
MeasurementDataPK key = new MeasurementDataPK(comp.getTimestamp(), schedule);
pks.add(key);
map.put(key, comp);
}
// compute and add the outlier data
List<AggregateNumericMetric> datas = getOneHourDataForPKs(pks);
for (AggregateNumericMetric data : datas) {
MeasurementDataPK pk = new MeasurementDataPK(data.getTimestamp(), data.getScheduleId());
MeasurementOOBComposite comp = map.get(pk);
comp.setDataMin(data.getMin());
comp.setDataMax(data.getMax());
comp.calculateOutlier();