Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
ae35957d
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,发现更多精彩内容 >>
提交
ae35957d
编写于
3月 24, 2012
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the page at home
上级
ba5b2f81
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
128 addition
and
87 deletion
+128
-87
cat-core/src/main/java/com/dianping/cat/message/spi/codec/HtmlMessageCodec.java
.../com/dianping/cat/message/spi/codec/HtmlMessageCodec.java
+27
-17
cat-home/src/main/java/com/dianping/cat/report/page/problem/GroupLevelInfo.java
.../com/dianping/cat/report/page/problem/GroupLevelInfo.java
+14
-11
cat-home/src/main/java/com/dianping/cat/report/page/problem/Handler.java
...in/java/com/dianping/cat/report/page/problem/Handler.java
+4
-1
cat-home/src/main/java/com/dianping/cat/report/page/problem/ProblemStatistics.java
...m/dianping/cat/report/page/problem/ProblemStatistics.java
+6
-4
cat-home/src/main/java/com/dianping/cat/report/page/problem/ThreadLevelInfo.java
...com/dianping/cat/report/page/problem/ThreadLevelInfo.java
+13
-10
cat-home/src/main/java/com/dianping/cat/report/view/ProblemReportHelper.java
...ava/com/dianping/cat/report/view/ProblemReportHelper.java
+16
-8
cat-home/src/main/webapp/WEB-INF/webres.tld
cat-home/src/main/webapp/WEB-INF/webres.tld
+34
-34
cat-home/src/main/webapp/css/logview.css
cat-home/src/main/webapp/css/logview.css
+2
-1
cat-home/src/main/webapp/js/problem.js
cat-home/src/main/webapp/js/problem.js
+11
-0
cat-home/src/main/webapp/jsp/report/problemDetail.jsp
cat-home/src/main/webapp/jsp/report/problemDetail.jsp
+1
-1
未找到文件。
cat-core/src/main/java/com/dianping/cat/message/spi/codec/HtmlMessageCodec.java
浏览文件 @
ae35957d
...
...
@@ -111,23 +111,33 @@ public class HtmlMessageCodec implements MessageCodec, Initializable {
protected
int
encodeHeader
(
MessageTree
tree
,
ChannelBuffer
buf
)
{
BufferHelper
helper
=
m_bufferHelper
;
int
count
=
0
;
count
+=
helper
.
tr1
(
buf
,
"header"
);
count
+=
helper
.
td
(
buf
,
ID
);
count
+=
helper
.
td
(
buf
,
tree
.
getDomain
());
count
+=
helper
.
td
(
buf
,
tree
.
getHostName
());
count
+=
helper
.
td
(
buf
,
tree
.
getIpAddress
());
count
+=
helper
.
td
(
buf
,
tree
.
getThreadGroupName
());
count
+=
helper
.
td
(
buf
,
tree
.
getThreadId
());
count
+=
helper
.
td
(
buf
,
tree
.
getThreadName
());
count
+=
helper
.
td
(
buf
,
tree
.
getMessageId
());
count
+=
helper
.
td
(
buf
,
tree
.
getParentMessageId
());
count
+=
helper
.
td
(
buf
,
tree
.
getRootMessageId
());
count
+=
helper
.
td
(
buf
,
tree
.
getSessionToken
());
count
+=
helper
.
tr2
(
buf
);
count
+=
helper
.
crlf
(
buf
);
// int count = 0;
// count += helper.tr1(buf,"header");
// count += helper.td(buf, ID);
// count += helper.td(buf, tree.getDomain());
// count += helper.td(buf, tree.getHostName());
// count += helper.td(buf, tree.getIpAddress());
// count += helper.td(buf, tree.getThreadGroupName());
// count += helper.td(buf, tree.getThreadId());
// count += helper.td(buf, tree.getThreadName());
// count += helper.td(buf, tree.getMessageId());
// count += helper.td(buf, tree.getParentMessageId());
// count += helper.td(buf, tree.getRootMessageId());
// count += helper.td(buf, tree.getSessionToken());
// count += helper.tr2(buf);
// count += helper.crlf(buf);
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"<tr class=\"header\" ><td colspan=5>"
);
sb
.
append
(
ID
).
append
(
" "
).
append
(
tree
.
getDomain
()).
append
(
" "
);
sb
.
append
(
tree
.
getHostName
()).
append
(
" "
).
append
(
tree
.
getIpAddress
()).
append
(
" "
);
sb
.
append
(
tree
.
getThreadGroupName
()).
append
(
" "
).
append
(
tree
.
getThreadId
()).
append
(
" "
);
sb
.
append
(
tree
.
getThreadName
()).
append
(
" "
).
append
(
tree
.
getMessageId
()).
append
(
" "
);
sb
.
append
(
tree
.
getParentMessageId
()).
append
(
" "
).
append
(
tree
.
getRootMessageId
()).
append
(
" "
);
sb
.
append
(
tree
.
getSessionToken
()).
append
(
" "
);
sb
.
append
(
"</td></tr>"
);
int
count
=
helper
.
write
(
buf
,
sb
.
toString
());
return
count
;
}
...
...
cat-home/src/main/java/com/dianping/cat/report/page/problem/GroupLevelInfo.java
浏览文件 @
ae35957d
...
...
@@ -33,24 +33,27 @@ public class GroupLevelInfo {
}
private
String
getShowDetailByMinte
(
int
minute
)
{
Map
<
String
,
String
>
params
=
new
LinkedHashMap
<
String
,
String
>();
String
baseUrl
=
"/cat/r/p?op=detail"
;
params
.
put
(
"domain"
,
m_model
.
getDomain
());
params
.
put
(
"ip"
,
m_model
.
getIpAddress
());
params
.
put
(
"date"
,
m_model
.
getDate
());
params
.
put
(
"minute"
,
Integer
.
toString
(
minute
));
StringBuilder
sb
=
new
StringBuilder
().
append
(
"<td>"
);
String
minuteStr
=
Integer
.
toString
(
minute
);
if
(
minute
<
10
)
{
sb
.
append
(
"0"
)
;
minuteStr
=
"0"
+
minute
;
}
sb
.
append
(
minute
).
append
(
"</td>"
);
sb
.
append
(
ProblemReportHelper
.
creatLinkString
(
baseUrl
,
"minute"
,
params
,
minuteStr
));
sb
.
append
(
"</td>"
);
for
(
java
.
util
.
Map
.
Entry
<
String
,
GroupStatistics
>
statistics
:
m_groupStatistics
.
entrySet
())
{
sb
.
append
(
"<td>"
);
params
.
put
(
"group"
,
statistics
.
getKey
());
GroupStatistics
value
=
statistics
.
getValue
();
for
(
String
temp
:
value
.
getStatistics
().
get
(
minute
))
{
Map
<
String
,
String
>
params
=
new
LinkedHashMap
<
String
,
String
>();
String
baseUrl
=
"/cat/r/p?op=detail"
;
params
.
put
(
"group"
,
statistics
.
getKey
());
params
.
put
(
"domain"
,
m_model
.
getDomain
());
params
.
put
(
"ip"
,
m_model
.
getIpAddress
());
params
.
put
(
"date"
,
m_model
.
getDate
());
params
.
put
(
"minute"
,
Integer
.
toString
(
minute
));
String
url
=
ProblemReportHelper
.
creatLinkString
(
baseUrl
,
temp
,
params
);
String
url
=
ProblemReportHelper
.
creatLinkString
(
baseUrl
,
temp
,
params
,
""
);
sb
.
append
(
url
);
}
sb
.
append
(
"</td>"
);
...
...
cat-home/src/main/java/com/dianping/cat/report/page/problem/Handler.java
浏览文件 @
ae35957d
...
...
@@ -152,7 +152,10 @@ public class Handler implements PageHandler<Context> {
String
ip
=
getIpAddress
(
report
,
payload
);
if
(
period
.
isCurrent
()
||
period
.
isFuture
())
{
model
.
setLastMinute
(
getLastMinute
(
report
,
ip
));
Calendar
cal
=
Calendar
.
getInstance
();
int
minute
=
cal
.
get
(
Calendar
.
MINUTE
);
//model.setLastMinute(getLastMinute(report, ip));
model
.
setLastMinute
(
minute
);
}
else
{
model
.
setLastMinute
(
59
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/page/problem/ProblemStatistics.java
浏览文件 @
ae35957d
...
...
@@ -41,7 +41,7 @@ public class ProblemStatistics {
statisticsEntries
(
entries
);
}
}
else
if
(
isEmpty
(
m_groupName
)
&&
!
isEmpty
(
m_threadId
))
{
}
else
if
(
!
isEmpty
(
m_groupName
)
&&
isEmpty
(
m_threadId
))
{
Map
<
String
,
JavaThread
>
threads
=
machine
.
getThreads
();
for
(
JavaThread
thread
:
threads
.
values
())
{
if
(
thread
.
getGroupName
().
equals
(
m_groupName
))
{
...
...
@@ -54,7 +54,7 @@ public class ProblemStatistics {
}
}
}
else
{
}
else
if
(!
isEmpty
(
m_groupName
)
&&
!
isEmpty
(
m_threadId
))
{
// Thread Level
JavaThread
thread
=
machine
.
getThreads
().
get
(
model
.
getThreadId
());
if
(
thread
==
null
)
{
...
...
@@ -66,6 +66,8 @@ public class ProblemStatistics {
}
List
<
Entry
>
entries
=
segment
.
getEntries
();
statisticsEntries
(
entries
);
}
else
{
throw
new
RuntimeException
(
"The url is error, it should contains thread group name at least!"
);
}
return
this
;
...
...
cat-home/src/main/java/com/dianping/cat/report/page/problem/ThreadLevelInfo.java
浏览文件 @
ae35957d
...
...
@@ -60,12 +60,21 @@ public class ThreadLevelInfo {
}
private
String
getShowDetailByMinte
(
int
minute
)
{
StringBuilder
sb
=
new
StringBuilder
().
append
(
"<td>"
);
Map
<
String
,
String
>
params
=
new
LinkedHashMap
<
String
,
String
>();
String
baseUrl
=
"/cat/r/p?op=detail"
;
params
.
put
(
"domain"
,
m_model
.
getDomain
());
params
.
put
(
"ip"
,
m_model
.
getIpAddress
());
params
.
put
(
"date"
,
m_model
.
getDate
());
params
.
put
(
"minute"
,
Integer
.
toString
(
minute
));
StringBuilder
sb
=
new
StringBuilder
().
append
(
"<td>"
);
String
minuteStr
=
Integer
.
toString
(
minute
);
if
(
minute
<
10
)
{
sb
.
append
(
"0"
)
;
minuteStr
=
"0"
+
minute
;
}
sb
.
append
(
minute
).
append
(
"</td>"
);
sb
.
append
(
ProblemReportHelper
.
creatLinkString
(
baseUrl
,
"minute"
,
params
,
minuteStr
));
sb
.
append
(
"</td>"
);
for
(
java
.
util
.
Map
.
Entry
<
String
,
GroupStatistics
>
statistics
:
m_groupStatistics
.
entrySet
())
{
GroupStatistics
value
=
statistics
.
getValue
();
String
groupName
=
statistics
.
getKey
();
...
...
@@ -77,17 +86,11 @@ public class ThreadLevelInfo {
HashSet
<
String
>
errors
=
theadStatistics
.
getStatistics
().
get
(
minute
);
sb
.
append
(
"<td>"
);
for
(
String
error
:
errors
)
{
Map
<
String
,
String
>
params
=
new
LinkedHashMap
<
String
,
String
>();
String
baseUrl
=
"/cat/r/p?op=detail"
;
params
.
put
(
"group"
,
statistics
.
getKey
());
if
(
groupName
.
equals
(
m_groupName
))
{
params
.
put
(
"thread"
,
thread
);
}
params
.
put
(
"domain"
,
m_model
.
getDomain
());
params
.
put
(
"ip"
,
m_model
.
getIpAddress
());
params
.
put
(
"date"
,
m_model
.
getDate
());
params
.
put
(
"minute"
,
Integer
.
toString
(
minute
));
String
url
=
ProblemReportHelper
.
creatLinkString
(
baseUrl
,
error
,
params
);
String
url
=
ProblemReportHelper
.
creatLinkString
(
baseUrl
,
error
,
params
,
""
);
sb
.
append
(
url
);
}
sb
.
append
(
"</td>"
);
...
...
cat-home/src/main/java/com/dianping/cat/report/view/ProblemReportHelper.java
浏览文件 @
ae35957d
...
...
@@ -42,22 +42,30 @@ public class ProblemReportHelper {
sb
.
append
(
"&date="
).
append
(
date
);
sb
.
append
(
"&minute="
).
append
(
minute
);
sb
.
append
(
"\" class=\""
).
append
(
name
).
append
(
"\"> </a>"
);
//sb.append("<a href=\"/cat/r/m/").append(messageId).append("/logview.html\" class=\"");
//sb.append(name);
//sb.append("\"> </a>");
//
sb.append("<a href=\"/cat/r/m/").append(messageId).append("/logview.html\" class=\"");
//
sb.append(name);
//
sb.append("\"> </a>");
}
}
return
sb
.
toString
();
}
public
static
String
creatLinkString
(
String
baseUrl
,
String
classStyle
,
Map
<
String
,
String
>
params
)
{
public
static
String
creatLinkString
(
String
baseUrl
,
String
classStyle
,
Map
<
String
,
String
>
params
,
String
text
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"<a href=\""
).
append
(
baseUrl
);
sb
.
append
(
"<a "
);
sb
.
append
(
"href=\""
).
append
(
baseUrl
);
for
(
java
.
util
.
Map
.
Entry
<
String
,
String
>
param
:
params
.
entrySet
())
{
sb
.
append
(
"&"
).
append
(
param
.
getKey
()).
append
(
"="
).
append
(
param
.
getValue
());
}
sb
.
append
(
"\" class=\""
).
append
(
classStyle
).
append
(
"\"> </a>"
);
sb
.
append
(
"\" class=\""
).
append
(
classStyle
).
append
(
"\""
);
sb
.
append
(
" onclick=\"return show(this);\""
).
append
(
" >"
);
if
(
text
.
trim
().
length
()
==
0
)
{
sb
.
append
(
"  "
);
}
else
{
sb
.
append
(
text
);
}
sb
.
append
(
"</a>"
);
return
sb
.
toString
();
}
...
...
cat-home/src/main/webapp/WEB-INF/webres.tld
浏览文件 @
ae35957d
...
...
@@ -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/main/webapp/css/logview.css
浏览文件 @
ae35957d
...
...
@@ -37,5 +37,6 @@ tr.link td {
.header
{
display
:
hidden
;
font-size
:
small
;
white-space
:
nowrap
;
}
\ No newline at end of file
cat-home/src/main/webapp/js/problem.js
浏览文件 @
ae35957d
function
show
(
anchor
)
{
alert
(
anchor
)
$
.
ajax
({
type
:
"
get
"
,
url
:
anchor
.
href
,
success
:
function
(
data
,
textStatus
)
{
alert
(
data
);
}
});
}
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/problemDetail.jsp
浏览文件 @
ae35957d
...
...
@@ -24,7 +24,7 @@
<res:useJs
value=
"
${
res
.
js
.
local
.
problem_js
}
"
target=
"head-js"
/>
<table
class=
"problem"
>
<tr><th>
Type
</th><th>
Count
</th><th>
Detail
</th></tr>
<c:forEach
var=
"statistics"
items=
"
${
model
.
statistic
s
}
"
>
<c:forEach
var=
"statistics"
items=
"
${
model
.
problemStatistics
.
statu
s
}
"
>
<tr>
<td><a
href=
"#"
class=
"${statistics.value.type}"
>
</a>
${statistics.value.type}
</td>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录