提交 e61a2c1d 编写于 作者: J jialinsun

resolve merge

上级 fb30e0b9
...@@ -133,9 +133,9 @@ public class ProductLineConfigManager implements Initializable, LogEnabled { ...@@ -133,9 +133,9 @@ public class ProductLineConfigManager implements Initializable, LogEnabled {
if ("broker-service".equals(domain)) { if ("broker-service".equals(domain)) {
userMonitor = true; userMonitor = true;
} else if (line.startsWith(NETWORK_MONITOR_PREFIX)) { } else if (line.toLowerCase().startsWith(NETWORK_MONITOR_PREFIX)) {
networkMonitor = true; networkMonitor = true;
} else if (line.startsWith(SYSTEM_MONITOR_PREFIX)) { } else if (line.toLowerCase().startsWith(SYSTEM_MONITOR_PREFIX)) {
systemMonitor = true; systemMonitor = true;
} }
productLine.setNetworkDashboard(networkMonitor); productLine.setNetworkDashboard(networkMonitor);
......
...@@ -66,7 +66,7 @@ public class ExceptionAlert implements Task, LogEnabled { ...@@ -66,7 +66,7 @@ public class ExceptionAlert implements Task, LogEnabled {
private TopMetric buildTopMetric(Date date) { private TopMetric buildTopMetric(Date date) {
TopReport topReport = queryTopReport(date); TopReport topReport = queryTopReport(date);
TopMetric topMetric = new TopMetric(ALERT_PERIOD, Integer.MAX_VALUE, m_configManager); TopMetric topMetric = new TopMetric(ALERT_PERIOD, Integer.MAX_VALUE, m_configManager);
topMetric.setStart(date).setEnd(new Date(date.getTime() + TimeUtil.ONE_MINUTE)); topMetric.setStart(date).setEnd(new Date(date.getTime() + TimeUtil.ONE_MINUTE));
topMetric.visitTopReport(topReport); topMetric.visitTopReport(topReport);
return topMetric; return topMetric;
...@@ -209,7 +209,7 @@ public class ExceptionAlert implements Task, LogEnabled { ...@@ -209,7 +209,7 @@ public class ExceptionAlert implements Task, LogEnabled {
List<String> emails = m_alertConfig.buildMailReceivers(project); List<String> emails = m_alertConfig.buildMailReceivers(project);
StringBuilder title = new StringBuilder(); StringBuilder title = new StringBuilder();
title.append("[异常告警] [项目组: ").append(domain).append("] [时间: ").append(new Date()).append("]"); title.append("[异常告警] [项目组: ").append(domain).append("]");
List<String> errorExceptions = new ArrayList<String>(); List<String> errorExceptions = new ArrayList<String>();
List<String> warnExceptions = new ArrayList<String>(); List<String> warnExceptions = new ArrayList<String>();
...@@ -220,10 +220,13 @@ public class ExceptionAlert implements Task, LogEnabled { ...@@ -220,10 +220,13 @@ public class ExceptionAlert implements Task, LogEnabled {
errorExceptions.add(exception.getName()); errorExceptions.add(exception.getName());
} }
} }
String mailContent = "[异常警告] [" + domain + "] : " + exceptions.toString(); StringBuilder mailContent = new StringBuilder();
mailContent.append("[异常警告] [").append(domain).append(exceptions.toString());
mailContent.append("[时间: ").append(new Date()).append("]");
m_logger.info(title + " " + mailContent + " " + emails); m_logger.info(title + " " + mailContent + " " + emails);
m_mailSms.sendEmail(title.toString(), mailContent, emails); m_mailSms.sendEmail(title.toString(), mailContent.toString(), emails);
Cat.logEvent("ExceptionAlert", project.getDomain(), Event.SUCCESS, title + " " + mailContent); Cat.logEvent("ExceptionAlert", project.getDomain(), Event.SUCCESS, title + " " + mailContent);
} }
......
...@@ -468,7 +468,8 @@ public class Handler implements PageHandler<Context> { ...@@ -468,7 +468,8 @@ public class Handler implements PageHandler<Context> {
private List<String> queryDoaminList() { private List<String> queryDoaminList() {
List<String> result = new ArrayList<String>(); List<String> result = new ArrayList<String>();
List<Project> projects = queryAllProjects(); List<Project> projects = queryAllProjects();
result.add("Default");
for (Project p : projects) { for (Project p : projects) {
result.add(p.getDomain()); result.add(p.getDomain());
} }
...@@ -481,6 +482,8 @@ public class Handler implements PageHandler<Context> { ...@@ -481,6 +482,8 @@ public class Handler implements PageHandler<Context> {
Date end = new Date(start.getTime() + TimeUtil.ONE_HOUR); Date end = new Date(start.getTime() + TimeUtil.ONE_HOUR);
BugReport report = m_reportService.queryBugReport(Constants.CAT, start, end); BugReport report = m_reportService.queryBugReport(Constants.CAT, start, end);
Set<String> exceptions = new HashSet<String>(); Set<String> exceptions = new HashSet<String>();
exceptions.add("Total");
for (Entry<String, com.dianping.cat.home.bug.entity.Domain> domain : report.getDomains().entrySet()) { for (Entry<String, com.dianping.cat.home.bug.entity.Domain> domain : report.getDomains().entrySet()) {
exceptions.addAll(domain.getValue().getExceptionItems().keySet()); exceptions.addAll(domain.getValue().getExceptionItems().keySet());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册