提交 070ebcbb 编写于 作者: U unknown

change

上级 f20c8605
......@@ -47,6 +47,8 @@ import com.site.web.mvc.annotation.PayloadMeta;
public class Handler implements PageHandler<Context> {
public static final long ONE_HOUR = 3600 * 1000L;
public static final double NOTEXIST=-2;
@Inject
private JspViewer m_jspViewer;
......@@ -271,7 +273,9 @@ public class Handler implements PageHandler<Context> {
}
model.setReport(transactionReport);
if (!StringUtils.isEmpty(type)) {
model.setDisplayNameReport(new DisplayTransactionNameReport().display(sorted, type, ip, transactionReport, ""));
model
.setDisplayNameReport(new DisplayTransactionNameReport()
.display(sorted, type, ip, transactionReport, ""));
} else {
model.setDisplayTypeReport(new DisplayTransactionTypeReport().display(sorted, ip, transactionReport));
}
......@@ -382,10 +386,11 @@ public class Handler implements PageHandler<Context> {
String type = payload.getType();
String name = payload.getName();
String ip = model.getIpAddress();
String queryIP = "All".equals(ip) == true ? "all" : ip;
List<Graph> graphs = new ArrayList<Graph>();
try {
graphs = this.graphDao.findByDomainNameIpDuration(start, end, ip, domain, "transaction",
graphs = this.graphDao.findByDomainNameIpDuration(start, end, queryIP, domain, "transaction",
GraphEntity.READSET_FULL);
} catch (DalException e) {
e.printStackTrace();
......@@ -397,22 +402,27 @@ public class Handler implements PageHandler<Context> {
Map<String, double[]> buildGraphDates(Date start, Date end, String type, String name, List<Graph> graphs) {
Map<String, double[]> result = new HashMap<String, double[]>();
List<Date> periods = new ArrayList<Date>();
for (long i = start.getTime(); i < end.getTime(); i = i + ONE_HOUR) {
periods.add(new Date(i));
}
int size = periods.size();
int size = (int) ((end.getTime() - start.getTime()) / ONE_HOUR);
double[] total_count = new double[size];
double[] failure_count = new double[size];
double[] min = new double[size];
double[] max = new double[size];
double[] sum = new double[size];
double[] sum2 = new double[size];
//set the default value
for (int i = 0; i < size; i++) {
total_count[i]=NOTEXIST;
failure_count[i]=NOTEXIST;
min[i]=NOTEXIST;
max[i]=NOTEXIST;
sum[i]=NOTEXIST;
sum2[i]=NOTEXIST;
}
if (!isEmpty(type) && isEmpty(name)) {
for (Graph graph : graphs) {
int indexOfperiod = periods.indexOf(graph.getPeriod());
int indexOfperiod = (int) ((graph.getPeriod().getTime() - start.getTime()) / ONE_HOUR);
String summaryContent = graph.getSummaryContent();
String[] allLines = summaryContent.split("\n");
for (int j = 0; j < allLines.length; j++) {
......@@ -429,7 +439,7 @@ public class Handler implements PageHandler<Context> {
}
} else if (!isEmpty(type) && !isEmpty(name)) {
for (Graph graph : graphs) {
int indexOfperiod = periods.indexOf(graph.getPeriod());
int indexOfperiod = (int) ((graph.getPeriod().getTime() - start.getTime()) / ONE_HOUR);
String detailContent = graph.getDetailContent();
String[] allLines = detailContent.split("\n");
for (int j = 0; j < allLines.length; j++) {
......
......@@ -51,13 +51,6 @@
<tag-class>org.unidal.webres.taglib.basic.UseCssTagHandler</tag-class>
<body-content>JSP</body-content>
<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[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
......@@ -79,6 +72,13 @@
<type>java.lang.String</type>
</attribute>
<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>
......@@ -114,18 +114,18 @@
<tag-class>org.unidal.webres.taglib.basic.SetTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[The value]]></description>
<name>value</name>
<description><![CDATA[The name.]]></description>
<name>id</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[The name.]]></description>
<name>id</name>
<description><![CDATA[The value]]></description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
<type>java.lang.Object</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
......@@ -135,13 +135,6 @@
<tag-class>org.unidal.webres.taglib.basic.UseJsTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Set the js value with EL or a js ref.]]></description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
......@@ -163,6 +156,13 @@
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Set the js value with EL or a js ref.]]></description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[Target placement for this js resource to render]]></description>
<name>target</name>
<required>false</required>
......@@ -177,13 +177,6 @@
<tag-class>org.unidal.webres.taglib.basic.LinkTagHandler</tag-class>
<body-content>JSP</body-content>
<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>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
......@@ -197,6 +190,13 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<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>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
......@@ -205,13 +205,6 @@
<tag-class>org.unidal.webres.taglib.basic.ImageTagHandler</tag-class>
<body-content>JSP</body-content>
<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>
<attribute>
<description><![CDATA[Identify whether the image URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
......@@ -232,6 +225,13 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<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>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
......
......@@ -4,7 +4,6 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -50,7 +49,6 @@ public class GraphDateTest {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Test
......@@ -107,10 +105,8 @@ public class GraphDateTest {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private List<Graph> buildGraph(Date start,Date end){
List<Graph> graphs = new ArrayList<Graph>();
String summary="Call 13704 0 0.993 505.822 133680.3 7678055.5"+"\n"+
......@@ -136,5 +132,4 @@ public class GraphDateTest {
}
return graphs;
}
}
......@@ -80,7 +80,6 @@ public class PayloadTest {
String lastTwo = sdf.format(lastTwoDay);
String lastOne = sdf.format(lastOneDay);
String current = sdf.format(currentDay);
String next = sdf.format(new Date(temp + ONE_DAY));
payload.setDate(sdf.format(input));
payload.setStep(-1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册