From b05f57fd49894d8f5e9330e84c9fac860b42957d Mon Sep 17 00:00:00 2001 From: "yong.you" Date: Thu, 17 Oct 2013 13:34:04 +0800 Subject: [PATCH] fix bug report merger size problem --- .../cat/report/task/bug/BugReportBuilder.java | 2 +- .../report/task/bug/HistoryBugReportMerger.java | 17 +++++++++++++++++ cat-home/src/main/webapp/WEB-INF/tags/body.tag | 2 +- .../main/webapp/WEB-INF/tags/hourlyReport.tag | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 cat-home/src/main/java/com/dianping/cat/report/task/bug/HistoryBugReportMerger.java diff --git a/cat-home/src/main/java/com/dianping/cat/report/task/bug/BugReportBuilder.java b/cat-home/src/main/java/com/dianping/cat/report/task/bug/BugReportBuilder.java index 6d38ba3e4..0517dad1c 100644 --- a/cat-home/src/main/java/com/dianping/cat/report/task/bug/BugReportBuilder.java +++ b/cat-home/src/main/java/com/dianping/cat/report/task/bug/BugReportBuilder.java @@ -135,7 +135,7 @@ public class BugReportBuilder implements ReportTaskBuilder { private BugReport queryDailyReportsByDuration(String domain, Date start, Date end) { long startTime = start.getTime(); long endTime = end.getTime(); - BugReportMerger merger = new BugReportMerger(new BugReport(domain)); + HistoryBugReportMerger merger = new HistoryBugReportMerger(new BugReport(domain)); for (; startTime < endTime; startTime += TimeUtil.ONE_DAY) { try { diff --git a/cat-home/src/main/java/com/dianping/cat/report/task/bug/HistoryBugReportMerger.java b/cat-home/src/main/java/com/dianping/cat/report/task/bug/HistoryBugReportMerger.java new file mode 100644 index 000000000..072616e9d --- /dev/null +++ b/cat-home/src/main/java/com/dianping/cat/report/task/bug/HistoryBugReportMerger.java @@ -0,0 +1,17 @@ +package com.dianping.cat.report.task.bug; + +import com.dianping.cat.home.bug.entity.BugReport; +import com.dianping.cat.home.bug.entity.ExceptionItem; + +public class HistoryBugReportMerger extends BugReportMerger { + + public HistoryBugReportMerger(BugReport bugReport) { + super(bugReport); + } + + @Override + protected void mergeExceptionItem(ExceptionItem old, ExceptionItem exceptionItem) { + old.setCount(old.getCount() + exceptionItem.getCount()); + old.getMessages().addAll(exceptionItem.getMessages()); + } +} diff --git a/cat-home/src/main/webapp/WEB-INF/tags/body.tag b/cat-home/src/main/webapp/WEB-INF/tags/body.tag index 84cd37dd0..e406bbba0 100755 --- a/cat-home/src/main/webapp/WEB-INF/tags/body.tag +++ b/cat-home/src/main/webapp/WEB-INF/tags/body.tag @@ -21,7 +21,7 @@