return report;
}
@Override
public TransactionReport queryDailyReport(String domain, Date start, Date end) {
TransactionReportMerger merger = new TransactionReportMerger(new TransactionReport(domain));
long startTime = start.getTime();
long endTime = end.getTime();
String name = TransactionAnalyzer.ID;
for (; startTime < endTime; startTime = startTime + TimeHelper.ONE_DAY) {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
if (xml != null && xml.length() > 0) {
TransactionReport reportModel = com.dianping.cat.consumer.transaction.model.transform.DefaultSaxParser
.parse(xml);
reportModel.accept(merger);
} else {
TransactionReport reportModel = queryFromDailyBinary(report.getId(), domain);
reportModel.accept(merger);
}
} catch (DalNotFoundException e) {
// ignore
} catch (Exception e) {
Cat.logError(e);
}
}
TransactionReport transactionReport = merger.getTransactionReport();
transactionReport.setStartTime(start);
transactionReport.setEndTime(end);
return transactionReport;
}