private CrossReport queryHourlyReportsByDuration(String name, String domain, Date period, Date endDate) {
Set<String> domainSet = m_reportService.queryAllDomainNames(period, endDate, CrossAnalyzer.ID);
long startTime = period.getTime();
long endTime = endDate.getTime();
CrossReportMerger merger = new CrossReportMerger(new CrossReport(domain));
for (; startTime < endTime; startTime = startTime + TimeHelper.ONE_HOUR) {
Date date = new Date(startTime);
CrossReport reportModel = m_reportService.queryCrossReport(domain, date, new Date(date.getTime()
+ TimeHelper.ONE_HOUR));
reportModel.accept(merger);
}
CrossReport crossReport = merger.getCrossReport();
crossReport.getDomainNames().addAll(domainSet);
crossReport.setStartTime(period);
crossReport.setEndTime(endDate);
return crossReport;
}