throw new RuntimeException("Metric report don't support daily report");
}
@Override
public MetricReport queryHourlyReport(String group, Date start, Date end) {
MetricReportMerger merger = new MetricReportMerger(new MetricReport(group));
try {
List<BusinessReport> reports = m_businessReportDao.findAllByPeriodProductLineName(start, group,
BusinessReportEntity.READSET_FULL);
for (BusinessReport report : reports) {
byte[] content = report.getContent();
try {
MetricReport reportModel = DefaultNativeParser.parse(content);
reportModel.accept(merger);
} catch (Exception e) {
Cat.logError(e);
Cat.getProducer().logEvent("ErrorXML", MetricAnalyzer.ID, Event.SUCCESS,
report.getProductLine() + " " + report.getPeriod() + " " + report.getId());
}
}
} catch (DalNotFoundException e) {
m_logger.warn(this.getClass().getSimpleName() + " " + group + " " + start + " " + end);
} catch (Exception e) {
Cat.logError(e);
}
MetricReport metricReport = merger.getMetricReport();
metricReport.setStartTime(start);
metricReport.setEndTime(new Date(end.getTime() - 1));
return transform(metricReport);
}