提交 28cfc6ee 编写于 作者: Y You Yong

modify the matrix bug

上级 783f49d6
......@@ -22,7 +22,6 @@ public class MatrixReportMerger extends DefaultMerger {
@Override
protected void mergeRatio(Ratio old, Ratio ratio) {
old.setCount(old.getCount() + ratio.getCount());
old.setTotalCount(old.getTotalCount() + ratio.getTotalCount());
old.setTotalTime(old.getTotalTime() + ratio.getTotalTime());
if (old.getMin() == 0) {
......
......@@ -53,10 +53,7 @@ public class Handler implements PageHandler<Context> {
model.setPage(ReportPage.SQL);
model.setDisplayDomain(payload.getDomain());
model.setAction(payload.getAction());
// Last hour is default
if (payload.getPeriod().isCurrent()) {
payload.setStep(payload.getStep() - 1);
}
switch (payload.getAction()) {
case VIEW:
showReport(model, payload);
......@@ -82,10 +79,15 @@ public class Handler implements PageHandler<Context> {
String durationOvertime = "";
String hitsovOvrtime = "";
String failureOvertime = "";
// Last hour is default
long date = payload.getDate();
if (payload.getPeriod().isCurrent()) {
date = date - 60 * 60 * 1000;
}
// when id is 0, will analyze all the data under this domain
if (id == 0) {
List<SqlReportRecord> allRecords = m_dao.findAllByDomainAndDate(payload.getDomain(),
new Date(payload.getDate()), SqlReportRecordEntity.READSET_FULL);
List<SqlReportRecord> allRecords = m_dao.findAllByDomainAndDate(payload.getDomain(), new Date(date),
SqlReportRecordEntity.READSET_FULL);
List<String> durationDistributions = new ArrayList<String>();
List<String> durationOvertimes = new ArrayList<String>();
List<String> hitsovOvrtimes = new ArrayList<String>();
......@@ -135,6 +137,9 @@ public class Handler implements PageHandler<Context> {
String domain = payload.getDomain();
long startDate = payload.getDate();
model.setLongDate(startDate);
if (payload.getPeriod().isCurrent()) {
startDate = startDate - 60 * 60 * 1000;
}
Date transactiondate = new Date(startDate);
List<String> domains = new ArrayList<String>();
Readset<SqlReportRecord> domainSet = SqlReportRecordEntity.READSET_DOMAIN;
......@@ -220,7 +225,7 @@ public class Handler implements PageHandler<Context> {
}
}
for (int m = 0; m <= 12; m++) {
average[m] = totalHit[m] == 0 ? 0 : sum[m] /(double) totalHit[m];
average[m] = totalHit[m] == 0 ? 0 : sum[m] / (double) totalHit[m];
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i <= 12; i++) {
......
......@@ -836,12 +836,24 @@
<requirement>
<role>com.dianping.cat.report.page.task.JspViewer</role>
</requirement>
<requirement>
<role>com.dianping.cat.hadoop.dal.TaskDao</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.task.JspViewer</role>
<implementation>com.dianping.cat.report.page.task.JspViewer</implementation>
</component>
<component>
<role>com.dianping.cat.hadoop.dal.TaskDao</role>
<implementation>com.dianping.cat.hadoop.dal.TaskDao</implementation>
<requirements>
<requirement>
<role>com.site.dal.jdbc.QueryEngine</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.matrix.Handler</role>
<implementation>com.dianping.cat.report.page.matrix.Handler</implementation>
......
......@@ -42,8 +42,6 @@
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
<<<<<<< HEAD
=======
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
......@@ -58,15 +56,7 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
>>>>>>> 241d65c954b0d5e7ca03a2c1cb32207603dceec9
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[useCss Resource Tag]]></description>
<name>useCss</name>
<tag-class>org.unidal.webres.taglib.basic.UseCssTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
......@@ -88,28 +78,6 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<<<<<<< HEAD
<attribute>
<description><![CDATA[Set the css value with EL or a css ref.]]></description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[Target placement for this css resource to render]]></description>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Resource token tag for page resources]]></description>
<name>token</name>
<tag-class>org.unidal.webres.taglib.basic.TokenTagHandler</tag-class>
=======
<attribute>
<description><![CDATA[Target placement for this css resource to render]]></description>
<name>target</name>
......@@ -144,7 +112,6 @@
<description><![CDATA[Set tag to define a page attribute with id as name]]></description>
<name>set</name>
<tag-class>org.unidal.webres.taglib.basic.SetTagHandler</tag-class>
>>>>>>> 241d65c954b0d5e7ca03a2c1cb32207603dceec9
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[The value]]></description>
......@@ -160,31 +127,6 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<<<<<<< HEAD
<attribute>
<description><![CDATA[Token type of resource: js, css]]></description>
<name>type</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Set tag to define a page attribute with id as name]]></description>
<name>set</name>
<tag-class>org.unidal.webres.taglib.basic.SetTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[The name.]]></description>
<name>id</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[The value]]></description>
=======
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
......@@ -194,19 +136,11 @@
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Set the js value with EL or a js ref.]]></description>
>>>>>>> 241d65c954b0d5e7ca03a2c1cb32207603dceec9
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[useJs Resource Tag]]></description>
<name>useJs</name>
<tag-class>org.unidal.webres.taglib.basic.UseJsTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
......@@ -228,10 +162,6 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<<<<<<< HEAD
<attribute>
<description><![CDATA[Set the js value with EL or a js ref.]]></description>
=======
<attribute>
<description><![CDATA[Target placement for this js resource to render]]></description>
<name>target</name>
......@@ -248,35 +178,12 @@
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[The value for link, could be a expression or a link ref.]]></description>
>>>>>>> 241d65c954b0d5e7ca03a2c1cb32207603dceec9
<name>value</name>
<required>false</required>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<<<<<<< HEAD
<description><![CDATA[Target placement for this js resource to render]]></description>
<name>target</name>
=======
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
>>>>>>> 241d65c954b0d5e7ca03a2c1cb32207603dceec9
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<<<<<<< HEAD
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Link Resource Tag]]></description>
<name>link</name>
<tag-class>org.unidal.webres.taglib.basic.LinkTagHandler</tag-class>
<body-content>JSP</body-content>
=======
>>>>>>> 241d65c954b0d5e7ca03a2c1cb32207603dceec9
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
......@@ -290,16 +197,6 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<<<<<<< HEAD
<attribute>
<description><![CDATA[The value for link, could be a expression or a link ref.]]></description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
=======
>>>>>>> 241d65c954b0d5e7ca03a2c1cb32207603dceec9
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
......@@ -308,8 +205,6 @@
<tag-class>org.unidal.webres.taglib.basic.ImageTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<<<<<<< HEAD
=======
<description><![CDATA[The value for image, could be a expression or a image path.]]></description>
<name>value</name>
<required>true</required>
......@@ -317,7 +212,6 @@
<type>java.lang.Object</type>
</attribute>
<attribute>
>>>>>>> 241d65c954b0d5e7ca03a2c1cb32207603dceec9
<description><![CDATA[Identify whether the image URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
......@@ -338,16 +232,6 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<<<<<<< HEAD
<attribute>
<description><![CDATA[The value for image, could be a expression or a image path.]]></description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
=======
>>>>>>> 241d65c954b0d5e7ca03a2c1cb32207603dceec9
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册