提交 72ddb488 编写于 作者: Y yong.you

modify the top anlyzer

上级 41246f3f
......@@ -66,9 +66,11 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
topReport.setEndTime(new Date(m_startTime + 60 * MINUTE - 1));
for (String temp : domains) {
TransactionReport report = m_transactionAnalyzer.getReport(temp);
if (!temp.equals("FrontEnd")) {
TransactionReport report = m_transactionAnalyzer.getReport(temp);
new TransactionReportVisitor(topReport).visitTransactionReport(report);
new TransactionReportVisitor(topReport).visitTransactionReport(report);
}
}
for (String temp : domains) {
......@@ -165,8 +167,8 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
int minute = range2.getValue();
long count = range2.getCount();
double sum = range2.getSum();
com.dianping.cat.consumer.top.model.entity.Segment detail = m_report.findOrCreateDomain(m_domain).findOrCreateSegment(
minute);
com.dianping.cat.consumer.top.model.entity.Segment detail = m_report.findOrCreateDomain(m_domain)
.findOrCreateSegment(minute);
Range2Function function = Range2Function.getByName(m_type);
if (function != null) {
......@@ -189,7 +191,7 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
detail.setUrl(count + detail.getUrl());
detail.setUrlSum(sum + detail.getUrlSum());
detail.setUrlError(errorCount+detail.getUrlError());
detail.setUrlError(errorCount + detail.getUrlError());
detail.setUrlDuration(detail.getUrlSum() / detail.getUrl());
}
},
......@@ -200,10 +202,10 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
long count = range2.getCount();
long errorCount = range2.getFails();
double sum = range2.getSum();
detail.setService(count + detail.getService());
detail.setServiceSum(sum + detail.getServiceSum());
detail.setServiceError(errorCount+detail.getServiceError());
detail.setServiceError(errorCount + detail.getServiceError());
detail.setServiceDuration(detail.getServiceSum() / detail.getService());
}
},
......@@ -214,9 +216,9 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
long count = range2.getCount();
long errorCount = range2.getFails();
double sum = range2.getSum();
detail.setService(count + detail.getService());
detail.setServiceError(errorCount+detail.getServiceError());
detail.setServiceError(errorCount + detail.getServiceError());
detail.setServiceSum(sum + detail.getServiceSum());
detail.setServiceDuration(detail.getServiceSum() / detail.getService());
}
......@@ -228,9 +230,9 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
long count = range2.getCount();
long errorCount = range2.getFails();
double sum = range2.getSum();
detail.setCall(count + detail.getCall());
detail.setCallError(errorCount+detail.getCallError());
detail.setCallError(errorCount + detail.getCallError());
detail.setCallSum(sum + detail.getCallSum());
detail.setCallDuration(detail.getCallSum() / detail.getCall());
......@@ -243,9 +245,9 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
long count = range2.getCount();
long errorCount = range2.getFails();
double sum = range2.getSum();
detail.setCall(count + detail.getCall());
detail.setCallError(errorCount+detail.getCallError());
detail.setCallError(errorCount + detail.getCallError());
detail.setCallSum(sum + detail.getCallSum());
detail.setCallDuration(detail.getCallSum() / detail.getCall());
}
......@@ -257,9 +259,9 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
long count = range2.getCount();
long errorCount = range2.getFails();
double sum = range2.getSum();
detail.setSql(count + detail.getSql());
detail.setSqlError(errorCount+detail.getSqlError());
detail.setSqlError(errorCount + detail.getSqlError());
detail.setSqlSum(sum + detail.getSqlSum());
detail.setSqlDuration(detail.getSqlSum() / detail.getSql());
}
......@@ -310,10 +312,12 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
int count = segment.getCount();
if ("error".equals(m_type)) {
com.dianping.cat.consumer.top.model.entity.Segment temp = m_report.findOrCreateDomain(m_domain).findOrCreateSegment(id);
com.dianping.cat.consumer.top.model.entity.Segment temp = m_report.findOrCreateDomain(m_domain)
.findOrCreateSegment(id);
temp.setError(temp.getError() + count);
} else if ("call".equals(m_type)) {
com.dianping.cat.consumer.top.model.entity.Segment temp = m_report.findOrCreateDomain(m_domain).findOrCreateSegment(id);
com.dianping.cat.consumer.top.model.entity.Segment temp = m_report.findOrCreateDomain(m_domain)
.findOrCreateSegment(id);
temp.setCallError(temp.getCallError() + count);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册