提交 058142c1 编写于 作者: G gaocogn

Reset score

上级 576e6344
cat @ dbcbe7e1
Subproject commit dbcbe7e175f7bec0b0d123cdd75f3281bf444794
......@@ -165,12 +165,14 @@ public class Handler implements PageHandler<Context> {
List<com.dianping.cat.home.utilization.entity.Domain> dUWebList = new LinkedList<com.dianping.cat.home.utilization.entity.Domain>();
List<com.dianping.cat.home.utilization.entity.Domain> dUServiceList = new LinkedList<com.dianping.cat.home.utilization.entity.Domain>();
for(com.dianping.cat.home.utilization.entity.Domain d : dUList){
if(d.getUrlCount() > 0)
if(d.getUrlCount() > 0){
dUWebList.add(d);
}
if(d.getServiceCount() > 0)
dUServiceList.add(d);
}
model.setUtilizationReport(utilizationReport);
resetWebScore(dUWebList, findMaxWebScore(dUWebList));
resetServiceScore(dUServiceList, findMaxServiceScore(dUServiceList));
model.setUtilizationList(dUList);
model.setUtilizationWebList(dUWebList);
model.setUtilizationServiceList(dUServiceList);
......@@ -179,6 +181,38 @@ public class Handler implements PageHandler<Context> {
model.setPage(ReportPage.BUG);
m_jspViewer.view(ctx, model);
}
private void resetWebScore(List<com.dianping.cat.home.utilization.entity.Domain> l, double maxScore){
for(com.dianping.cat.home.utilization.entity.Domain d : l){
d.setWebScore(d.getWebScore() * 100.0 / maxScore);
}
}
private void resetServiceScore(List<com.dianping.cat.home.utilization.entity.Domain> l, double maxScore){
for(com.dianping.cat.home.utilization.entity.Domain d : l){
d.setServiceScore(d.getServiceScore() * 100.0 / maxScore);
}
}
private double findMaxWebScore(List<com.dianping.cat.home.utilization.entity.Domain> l){
double maxScore = 0;
for(com.dianping.cat.home.utilization.entity.Domain d : l){
if(d.getWebScore() > maxScore){
maxScore = d.getWebScore();
}
}
return maxScore;
}
private double findMaxServiceScore(List<com.dianping.cat.home.utilization.entity.Domain> l){
double maxScore = 0;
for(com.dianping.cat.home.utilization.entity.Domain d : l){
if(d.getServiceScore() > maxScore){
maxScore = d.getServiceScore();
}
}
return maxScore;
}
private boolean isBug(String domain, String exception) {
Set<String> bugConfig = m_bugConfigManager.queryBugConfigsByDomain(domain);
......
......@@ -91,7 +91,6 @@ public class BugReportService extends AbstractReportService<BugReport> {
try {
BugReport reportModel = com.dianping.cat.home.bug.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
System.out.println(reportModel);
} catch (Exception e) {
Cat.logError(e);
Cat.getProducer().logEvent("ErrorXML", name, Event.SUCCESS,
......
......@@ -18,7 +18,7 @@
<attribute name="pigeon-call-count" value-type="long" primitive="true"/>
<attribute name="swallow-call-count" value-type="long" primitive="true"/>
<attribute name="memcache-count" value-type="long" primitive="true"/>
<attribute name="web-score" value-type="long" primitive="true"/>
<attribute name="service-score" value-type="long" primitive="true"/>
<attribute name="web-score" value-type="double" primitive="true"/>
<attribute name="service-score" value-type="double" primitive="true"/>
</entity>
</model>
......@@ -39,7 +39,7 @@
<td style="text-align:right">${w:format(item.pigeonCallCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.swallowCallCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.memcacheCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.webScore,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.webScore,'0.00')}</td>
</tr>
</c:forEach>
</table>
......@@ -74,7 +74,7 @@
<td style="text-align:right">${w:format(item.pigeonCallCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.swallowCallCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.memcacheCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.serviceScore,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.serviceScore,'0.00')}</td>
</tr>
</c:forEach>
</table>
......
......@@ -80,7 +80,7 @@
<td style="text-align:right">${w:format(item.pigeonCallCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.swallowCallCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.memcacheCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.webScore,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.webScore,'0.00')}</td>
</tr>
</c:forEach>
</table>
......@@ -115,7 +115,7 @@
<td style="text-align:right">${w:format(item.pigeonCallCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.swallowCallCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.memcacheCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.serviceScore,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.serviceScore,'0.00')}</td>
</tr>
</c:forEach>
</table>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册