Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
f4a0d288
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,发现更多精彩内容 >>
提交
f4a0d288
编写于
3月 12, 2013
作者:
Y
youyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix top analyzer error count bug
上级
ef9aecc2
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
164 addition
and
68 deletion
+164
-68
cat-consumer/src/main/java/com/dianping/cat/consumer/problem/ProblemType.java
...n/java/com/dianping/cat/consumer/problem/ProblemType.java
+1
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/top/TopAnalyzer.java
.../main/java/com/dianping/cat/consumer/top/TopAnalyzer.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/page/model/top/TopReportMerger.java
...m/dianping/cat/report/page/model/top/TopReportMerger.java
+2
-0
cat-home/src/main/java/com/dianping/cat/report/page/query/Payload.java
...main/java/com/dianping/cat/report/page/query/Payload.java
+14
-0
cat-home/src/main/webapp/css/body.css
cat-home/src/main/webapp/css/body.css
+8
-0
cat-home/src/main/webapp/css/bootstrap.css
cat-home/src/main/webapp/css/bootstrap.css
+0
-1
cat-home/src/main/webapp/js/query.js
cat-home/src/main/webapp/js/query.js
+52
-0
cat-home/src/main/webapp/jsp/report/crossMethodQuery.jsp
cat-home/src/main/webapp/jsp/report/crossMethodQuery.jsp
+19
-2
cat-home/src/main/webapp/jsp/report/query.jsp
cat-home/src/main/webapp/jsp/report/query.jsp
+66
-62
未找到文件。
cat-consumer/src/main/java/com/dianping/cat/consumer/problem/ProblemType.java
浏览文件 @
f4a0d288
...
...
@@ -2,7 +2,7 @@ package com.dianping.cat.consumer.problem;
public
enum
ProblemType
{
ERROR
(
"error"
),
FAILURE
(
"failure"
),
HEARTBEAT
(
"heartbeat"
),
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/top/TopAnalyzer.java
浏览文件 @
f4a0d288
...
...
@@ -314,11 +314,11 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
if
(
"error"
.
equals
(
m_type
))
{
com
.
dianping
.
cat
.
consumer
.
top
.
model
.
entity
.
Segment
temp
=
m_report
.
findOrCreateDomain
(
m_domain
)
.
findOrCreateSegment
(
id
);
temp
.
setError
(
count
);
temp
.
setError
(
temp
.
getError
()
+
count
);
}
else
if
(
"call"
.
equals
(
m_type
))
{
com
.
dianping
.
cat
.
consumer
.
top
.
model
.
entity
.
Segment
temp
=
m_report
.
findOrCreateDomain
(
m_domain
)
.
findOrCreateSegment
(
id
);
temp
.
setCallError
(
count
);
temp
.
setCallError
(
temp
.
getCallError
()
+
count
);
}
}
}
...
...
cat-home/src/main/java/com/dianping/cat/report/page/model/top/TopReportMerger.java
浏览文件 @
f4a0d288
...
...
@@ -19,6 +19,8 @@ public class TopReportMerger extends DefaultMerger {
@Override
protected
void
mergeSegment
(
Segment
old
,
Segment
segment
)
{
old
.
setError
(
old
.
getError
()
+
segment
.
getError
());
old
.
setCallError
(
old
.
getCallError
()
+
segment
.
getCallError
());
old
.
setCache
(
old
.
getCache
()
+
segment
.
getCache
());
old
.
setCacheSum
(
old
.
getCacheSum
()
+
segment
.
getCacheSum
());
if
(
old
.
getCache
()
>
0
)
{
...
...
cat-home/src/main/java/com/dianping/cat/report/page/query/Payload.java
浏览文件 @
f4a0d288
...
...
@@ -37,6 +37,10 @@ public class Payload extends AbstractReportPayload<Action> {
@FieldMeta
(
"end"
)
private
Date
m_end
;
private
String
m_startStr
;
private
String
m_endStr
;
private
SimpleDateFormat
m_sdf
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
);
...
...
@@ -92,6 +96,7 @@ public class Payload extends AbstractReportPayload<Action> {
public
void
setEnd
(
String
end
)
{
try
{
m_endStr
=
end
;
m_end
=
m_sdf
.
parse
(
end
);
}
catch
(
ParseException
e
)
{
Cat
.
logError
(
e
);
...
...
@@ -121,6 +126,7 @@ public class Payload extends AbstractReportPayload<Action> {
public
void
setStart
(
String
start
)
{
try
{
m_startStr
=
start
;
m_start
=
m_sdf
.
parse
(
start
);
}
catch
(
ParseException
e
)
{
Cat
.
logError
(
e
);
...
...
@@ -131,6 +137,14 @@ public class Payload extends AbstractReportPayload<Action> {
m_type
=
type
;
}
public
String
getStartStr
()
{
return
m_startStr
;
}
public
String
getEndStr
()
{
return
m_endStr
;
}
@Override
public
void
validate
(
ActionContext
<?>
ctx
)
{
if
(
m_action
==
null
)
{
...
...
cat-home/src/main/webapp/css/body.css
浏览文件 @
f4a0d288
...
...
@@ -193,4 +193,12 @@ a.heartbeat {
white-space
:
normal
;
word-wrap
:
break-word
;
word-break
:
break-all
;
}
.lable
{
font-weight
:
bold
;
}
.required
{
color
:
red
;
}
\ No newline at end of file
cat-home/src/main/webapp/css/bootstrap.css
浏览文件 @
f4a0d288
...
...
@@ -222,7 +222,6 @@ textarea {
}
body
{
margin
:
0
;
font-family
:
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
font-size
:
14px
;
line-height
:
20px
;
...
...
cat-home/src/main/webapp/js/query.js
0 → 100644
浏览文件 @
f4a0d288
function
init
(){
$
(
"
#start
"
).
datepicker
();
$
(
"
#end
"
).
datepicker
();
$
(
'
#contents
'
).
dataTable
({
"
sPaginationType
"
:
"
full_numbers
"
,
'
iDisplayLength
'
:
100
,
"
oLanguage
"
:
{
"
sProcessing
"
:
"
正在加载中......
"
,
"
sLengthMenu
"
:
"
每页显示 _MENU_ 条记录
"
,
"
sZeroRecords
"
:
"
对不起,查询不到相关数据!
"
,
"
sEmptyTable
"
:
"
表中无数据存在!
"
,
"
sInfo
"
:
"
当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录
"
,
"
sInfoFiltered
"
:
"
数据表中共为 _MAX_ 条记录
"
,
"
sSearch
"
:
"
搜索
"
,
"
oPaginate
"
:
{
"
sFirst
"
:
"
首页
"
,
"
sPrevious
"
:
"
上一页
"
,
"
sNext
"
:
"
下一页
"
,
"
sLast
"
:
"
末页
"
}
}
});
}
function
query
(){
var
queryDomain
=
$
(
"
#domain
"
).
val
();
var
queryType
=
$
(
"
#reportType
"
).
val
();
var
reportLevel
=
$
(
"
#reportLevel
"
).
val
();
var
type
=
$
(
"
#type
"
).
val
();
var
name
=
$
(
"
#name
"
).
val
();
var
start
=
$
(
"
#start
"
).
val
();
var
end
=
$
(
"
#end
"
).
val
();
if
(
queryDomain
==
null
||
queryDomain
.
trim
().
length
==
0
){
alert
(
"
请输入domain名称
"
);
return
;
}
if
(
type
==
null
||
type
.
trim
().
length
==
0
){
alert
(
"
请输入查询的Type内容
"
);
return
;
}
if
(
start
==
null
||
start
.
trim
().
length
==
0
){
alert
(
"
请输入查询的开始时间
"
);
return
;
}
if
(
end
==
null
||
end
.
trim
().
length
==
0
){
alert
(
"
请输入查询的结束时间
"
);
return
;
}
window
.
location
.
href
=
"
?queryDomain=
"
+
queryDomain
+
"
&queryType=
"
+
queryType
+
"
&reportLevel=
"
+
reportLevel
+
"
&type=
"
+
type
+
"
&name=
"
+
name
+
'
&start=
'
+
start
+
"
&end=
"
+
end
;
}
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/crossMethodQuery.jsp
浏览文件 @
f4a0d288
...
...
@@ -17,10 +17,27 @@
<res:useCss
value=
'
${
res
.
css
.
local
.
table_css
}
'
target=
"head-css"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'jquery-1.7.1.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'jquery.dataTables.min.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'tableInit.js'
]
}
"
target=
"head-js"
/>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
init
();
$
(
'
#contents
'
).
dataTable
({
"
sPaginationType
"
:
"
full_numbers
"
,
'
iDisplayLength
'
:
100
,
"
oLanguage
"
:
{
"
sProcessing
"
:
"
正在加载中......
"
,
"
sLengthMenu
"
:
"
每页显示 _MENU_ 条记录
"
,
"
sZeroRecords
"
:
"
对不起,查询不到相关数据!
"
,
"
sEmptyTable
"
:
"
表中无数据存在!
"
,
"
sInfo
"
:
"
当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录
"
,
"
sInfoFiltered
"
:
"
数据表中共为 _MAX_ 条记录
"
,
"
sSearch
"
:
"
搜索
"
,
"
oPaginate
"
:
{
"
sFirst
"
:
"
首页
"
,
"
sPrevious
"
:
"
上一页
"
,
"
sNext
"
:
"
下一页
"
,
"
sLast
"
:
"
末页
"
}
}
});
});
</script>
<%@ include
file=
"crossQuery.jsp"
%>
...
...
cat-home/src/main/webapp/jsp/report/query.jsp
浏览文件 @
f4a0d288
...
...
@@ -9,79 +9,83 @@
<link
rel=
"stylesheet"
href=
"http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css"
/>
<script
src=
"http://code.jquery.com/jquery-1.8.3.js"
></script>
<script
src=
"http://code.jquery.com/ui/1.10.0/jquery-ui.js"
></script>
<res:useCss
value=
"
${
res
.
css
.
local
.
transaction_css
}
"
target=
"head-css"
/>
<script>
$
(
function
()
{
$
(
"
#start
"
).
datepicker
();
$
(
"
#end
"
).
datepicker
();
});
function
query
(){
var
queryDomain
=
$
(
"
#domain
"
).
val
();
var
queryType
=
$
(
"
#reportType
"
).
val
();
var
reportLevel
=
$
(
"
#reportLevel
"
).
val
();
var
type
=
$
(
"
#type
"
).
val
();
var
name
=
$
(
"
#name
"
).
val
();
var
start
=
$
(
"
#start
"
).
val
();
var
end
=
$
(
"
#end
"
).
val
();
window
.
location
.
href
=
"
?queryDomain=
"
+
queryDomain
+
"
&queryType=
"
+
queryType
+
"
&reportLevel=
"
+
reportLevel
+
"
&type=
"
+
type
+
"
&name=
"
+
name
+
'
&start=
'
+
start
+
"
&end=
"
+
end
;
}
$
(
document
).
ready
(
function
()
{
$
(
'
#contents
'
).
dataTable
({
"
sPaginationType
"
:
"
full_numbers
"
,
'
iDisplayLength
'
:
100
,
"
oLanguage
"
:
{
"
sProcessing
"
:
"
正在加载中......
"
,
"
sLengthMenu
"
:
"
每页显示 _MENU_ 条记录
"
,
"
sZeroRecords
"
:
"
对不起,查询不到相关数据!
"
,
"
sEmptyTable
"
:
"
表中无数据存在!
"
,
"
sInfo
"
:
"
当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录
"
,
"
sInfoFiltered
"
:
"
数据表中共为 _MAX_ 条记录
"
,
"
sSearch
"
:
"
搜索
"
,
"
oPaginate
"
:
{
"
sFirst
"
:
"
首页
"
,
"
sPrevious
"
:
"
上一页
"
,
"
sNext
"
:
"
下一页
"
,
"
sLast
"
:
"
末页
"
}
}
});
});
</script>
<a:body>
<res:useCss
value=
'
${
res
.
css
.
local
.
report_css
}
'
target=
"head-css"
/>
<res:useCss
value=
'
${
res
.
css
.
local
.
table_css
}
'
target=
"head-css"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'query.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'jquery.dataTables.min.js'
]
}
"
target=
"head-js"
/>
<script>
$
(
document
).
ready
(
function
()
{
init
();
});
</script>
<div
class=
"report"
>
<table
class=
"header"
>
<tr>
<td
class=
"title"
>
Query
Transaction\Event\Problem Data By Day
</td>
<td
class=
"title"
>
Query
Data
</td>
</table>
<table>
</br>
<table
align=
"center"
width=
"60%"
rules=
"all"
border=
1
>
<thead>
<tr>
<th
colspan=
"3"
>
查询一段时间内的综合数据
</th>
</tr>
</thead>
<tbody>
<tr>
<th>
Report:
<select
id=
"reportType"
>
<td>
<span
class=
"required"
>
*
</span><span
class=
"lable"
>
查询报表
</span>
</td>
<td><select
id=
"reportType"
style=
"width:150px"
>
<option
value=
"transaction"
>
transaction
</option>
<option
value=
"event"
>
event
</option>
<option
value=
"problem"
>
problem
</option>
</select>
ReportType:
<select
id=
"reportLevel"
>
</select></td>
<td>
报表支持Transaction\Event\Problem报表
</td>
</tr>
<tr>
<td><span
class=
"required"
>
*
</span><span
class=
"lable"
>
报表类型
</span>
<td><select
id=
"reportLevel"
style=
"width:150px"
>
<option
value=
"day"
>
day
</option>
<option
value=
"hour"
>
hour
</option>
</select>
Domain:
<input
type=
"text"
size=
"30"
id=
"domain"
></inpupt>
Type:
<input
type=
"text"
size=
"30"
id=
"type"
></inpupt>
Name:
<input
type=
"text"
size=
"30"
id=
"name"
></inpupt>
StartTime:
<input
type=
"text"
size=
"20"
id=
"start"
></inpupt>
EndTime:
<input
type=
"text"
size=
"20"
id=
"end"
></inpupt>
<input
type=
"submit"
onclick=
"query()"
></input>
</th>
</select></td>
<td>
报表类型支持小时、天
</td>
</tr>
<tr>
<td><span
class=
"required"
>
*
</span><span
class=
"lable"
>
项目名称
</span>
<td><input
type=
"text"
size=
"30"
id=
"domain"
value=
"${payload.queryDomain}"
></inpupt></td>
<td
class=
"required"
>
大小写敏感
</td>
</tr>
<tr>
<td><span
class=
"required"
>
*
</span><span
class=
"lable"
>
Type
</span>
<td><input
type=
"text"
size=
"30"
id=
"type"
value=
"${payload.type}"
></inpupt></td>
<td>
查询的第一级
</td>
</tr>
<tr>
<td><span
class=
"required"
>
</span><span
class=
"lable"
>
Name
</span>
<td><input
type=
"text"
size=
"30"
id=
"name"
value=
"${payload.name}"
></inpupt></td>
<td>
查询的第二级(有此项即查询第二级的数据)
</td>
</tr>
<tr>
<td><span
class=
"required"
>
*
</span><span
class=
"lable"
>
开始时间
</span>
<td><input
type=
"text"
size=
"30"
id=
"start"
value=
"${payload.startStr}"
></inpupt></td>
<td>
查询开始时间
</td>
</tr>
<tr>
<td><span
class=
"required"
>
*
</span><span
class=
"lable"
>
结束时间
</span>
<td><input
type=
"text"
size=
"30"
id=
"end"
value=
"${payload.endStr}"
></inpupt></td>
<td>
查询结束时间
<span
class=
"required"
>
(时间间隔不允许超过一个月)
</span></td>
</tr>
<tr>
<th
colspan=
"3"
>
<input
type=
"submit"
onclick=
"query()"
style=
"width:100px;"
>
</th>
</tr>
</tbody>
</table>
</br></br>
<table
class=
"project"
id=
"contents"
width=
"100%"
>
<thead>
<tr
class=
"odd"
>
...
...
@@ -90,17 +94,17 @@ $(document).ready(function() {
<td>
TotalCount
</td>
<td>
FailureCount
</td>
<td>
Failure%
</td>
<td>
Min
</td>
<td>
Max
</td>
<td>
Avg
</td>
<td>
Line95
</td>
<td>
Min
(ms)
</td>
<td>
Max
(ms)
</td>
<td>
Avg
(ms)
</td>
<td>
Line95
(ms)
</td>
</tr></thead><tbody>
<c:forEach
var=
"e"
items=
"
${
model
.
transactionItems
}
"
varStatus=
"status"
>
<tr
class=
"${status.index mod 2 != 0 ? 'odd' : 'even'}"
>
<td>
${w:format(e.date,'yyyy-MM-dd HH:mm:ss')}
</td>
<td>
${e.type}
</td>
<td>
${
w:format(e.totalCount,'#,###,###,###,##0')
}
</td>
<td>
${
e.totalCount
}
</td>
<td>
${e.failCount}
</td>
<td>
${w:format(e.failPercent/100,'0.0000%')}
</td>
<td>
${w:format(e.min,'0.#')}
</td>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录