Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
070ebcbb
C
cat
项目概览
梦中观雨
/
cat
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
070ebcbb
编写于
6月 13, 2012
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change
上级
f20c8605
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
54 addition
and
50 deletion
+54
-50
cat-home/src/main/java/com/dianping/cat/report/page/transaction/Handler.java
...ava/com/dianping/cat/report/page/transaction/Handler.java
+20
-10
cat-home/src/main/webapp/WEB-INF/webres.tld
cat-home/src/main/webapp/WEB-INF/webres.tld
+34
-34
cat-home/src/test/java/com/dianping/cat/report/page/transaction/GraphDateTest.java
...m/dianping/cat/report/page/transaction/GraphDateTest.java
+0
-5
cat-home/src/test/java/com/dianping/cat/report/page/transaction/PayloadTest.java
...com/dianping/cat/report/page/transaction/PayloadTest.java
+0
-1
未找到文件。
cat-home/src/main/java/com/dianping/cat/report/page/transaction/Handler.java
浏览文件 @
070ebcbb
...
...
@@ -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
++)
{
...
...
cat-home/src/main/webapp/WEB-INF/webres.tld
浏览文件 @
070ebcbb
...
...
@@ -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>
...
...
cat-home/src/test/java/com/dianping/cat/report/page/transaction/GraphDateTest.java
浏览文件 @
070ebcbb
...
...
@@ -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
;
}
}
cat-home/src/test/java/com/dianping/cat/report/page/transaction/PayloadTest.java
浏览文件 @
070ebcbb
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录