提交 c64d521f 编写于 作者: Y youyong205

modiy the cat dianping.jsp

上级 22bc4af5
......@@ -59,95 +59,6 @@ import com.dianping.cat.system.config.BugConfigManager;
import com.dianping.cat.system.config.UtilizationConfigManager;
public class Handler implements PageHandler<Context> {
public class BugReportVisitor extends BaseVisitor {
private Domain m_currentDomain;
private Map<String, ErrorStatis> m_errors = new HashMap<String, ErrorStatis>();
public ErrorStatis findOrCreateErrorStatis(String productLine) {
ErrorStatis statis = m_errors.get(productLine);
if (statis == null) {
statis = new ErrorStatis();
m_errors.put(productLine, statis);
}
return statis;
}
public Map<String, ErrorStatis> getErrors() {
return m_errors;
}
@Override
public void visitDomain(Domain domain) {
m_currentDomain = domain;
super.visitDomain(domain);
}
@Override
public void visitExceptionItem(ExceptionItem exceptionItem) {
String exception = exceptionItem.getId();
int count = exceptionItem.getCount();
Project project = findProjectByDomain(m_currentDomain.getId());
if (project != null) {
String productLine = project.getProjectLine();
String department = project.getDepartment();
ErrorStatis statis = findOrCreateErrorStatis(productLine);
statis.setDepartment(department);
statis.setProductLine(productLine);
m_currentDomain.setDepartment(department);
m_currentDomain.setProductLine(productLine);
Map<String, ExceptionItem> items = null;
if (isBug(m_currentDomain.getId(), exception)) {
items = statis.getBugs();
} else {
items = statis.getExceptions();
}
ExceptionItem item = items.get(exception);
if (item == null) {
item = new ExceptionItem(exception);
item.setCount(count);
item.getMessages().addAll(exceptionItem.getMessages());
items.put(exception, item);
} else {
List<String> messages = item.getMessages();
item.setCount(item.getCount() + count);
messages.addAll(exceptionItem.getMessages());
if (messages.size() > 10) {
messages = messages.subList(0, 10);
}
}
}
}
}
public class ClearBugReport extends BaseVisitor {
@Override
public void visitDomain(Domain domain) {
String domainName = domain.getId();
Set<String> removes = new HashSet<String>();
Map<String, ExceptionItem> items = domain.getExceptionItems();
for (ExceptionItem item : items.values()) {
if (!isBug(domainName, item.getId())) {
removes.add(item.getId());
}
}
for (String remove : removes) {
items.remove(remove);
}
}
}
@Inject
private JspViewer m_jspViewer;
......@@ -531,5 +442,94 @@ public class Handler implements PageHandler<Context> {
temp.setExceptions(MapUtils.sortMap(exceptions, compator));
}
return errors;
}
public class BugReportVisitor extends BaseVisitor {
private Domain m_currentDomain;
private Map<String, ErrorStatis> m_errors = new HashMap<String, ErrorStatis>();
public ErrorStatis findOrCreateErrorStatis(String productLine) {
ErrorStatis statis = m_errors.get(productLine);
if (statis == null) {
statis = new ErrorStatis();
m_errors.put(productLine, statis);
}
return statis;
}
public Map<String, ErrorStatis> getErrors() {
return m_errors;
}
@Override
public void visitDomain(Domain domain) {
m_currentDomain = domain;
super.visitDomain(domain);
}
@Override
public void visitExceptionItem(ExceptionItem exceptionItem) {
String exception = exceptionItem.getId();
int count = exceptionItem.getCount();
Project project = findProjectByDomain(m_currentDomain.getId());
if (project != null) {
String productLine = project.getProjectLine();
String department = project.getDepartment();
ErrorStatis statis = findOrCreateErrorStatis(productLine);
statis.setDepartment(department);
statis.setProductLine(productLine);
m_currentDomain.setDepartment(department);
m_currentDomain.setProductLine(productLine);
Map<String, ExceptionItem> items = null;
if (isBug(m_currentDomain.getId(), exception)) {
items = statis.getBugs();
} else {
items = statis.getExceptions();
}
ExceptionItem item = items.get(exception);
if (item == null) {
item = new ExceptionItem(exception);
item.setCount(count);
item.getMessages().addAll(exceptionItem.getMessages());
items.put(exception, item);
} else {
List<String> messages = item.getMessages();
item.setCount(item.getCount() + count);
messages.addAll(exceptionItem.getMessages());
if (messages.size() > 10) {
messages = messages.subList(0, 10);
}
}
}
}
}
public class ClearBugReport extends BaseVisitor {
@Override
public void visitDomain(Domain domain) {
String domainName = domain.getId();
Set<String> removes = new HashSet<String>();
Map<String, ExceptionItem> items = domain.getExceptionItems();
for (ExceptionItem item : items.values()) {
if (!isBug(domainName, item.getId())) {
removes.add(item.getId());
}
}
for (String remove : removes) {
items.remove(remove);
}
}
}
}
<%@ page session="false" language="java" pageEncoding="UTF-8" %>
</br>
<h4 class="text-error">CAT QA环境机器调整通知</h4>
1、线下的CAT的环境是一台虚拟机(ip:192.168.7.70),无法满足线下的需求,目前已经正式替换为一台物理机。</br>
2、目前现有机器上/data/appdatas/cat/client.xml需要重新配置。</br>
3、Beta的环境我们会和OPS统一进行替换,Alpha环境我们后续会尝试统一修改。</br>
4、如果是dev或者Alpha机器并使用到CAT,请手动修改此文件,需要将192.168.7.70替换为192.168.213.115</br>
<xmp>
<config mode="client">
<servers>
<server ip="192.168.213.115" port="2280" />
</servers>
<domain id="MobileApi" enabled="true"/>
</config>
</xmp>
</br>
<h4 class="text-error">CAT监控内部</h4>
<div>
......
......@@ -88,7 +88,7 @@
<xmp>
<config mode="client">
<servers>
<server ip="192.168.7.70" port="2280" />
<server ip="192.168.213.115" port="2280" />
</servers>
<domain id="MobileApi" enabled="true"/>
</config>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册