Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
0819827d
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,发现更多精彩内容 >>
提交
0819827d
编写于
3月 27, 2012
作者:
Y
You Yong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the database
上级
152dab38
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
46 addition
and
36 deletion
+46
-36
cat-home/src/main/java/com/dianping/cat/report/page/sql/SqlReportModel.java
...java/com/dianping/cat/report/page/sql/SqlReportModel.java
+1
-1
cat-job/src/main/java/com/dianping/cat/job/sql/database/SqlRecordJobReducer.java
...om/dianping/cat/job/sql/database/SqlRecordJobReducer.java
+1
-1
cat-job/src/main/java/com/dianping/cat/job/storage/RemoteMessageBucket.java
...ava/com/dianping/cat/job/storage/RemoteMessageBucket.java
+1
-1
cat-job/src/main/resources/META-INF/dal/jdbc/codegen.xml
cat-job/src/main/resources/META-INF/dal/jdbc/codegen.xml
+35
-33
cat-job/src/main/resources/META-INF/dal/jdbc/dal-report.xml
cat-job/src/main/resources/META-INF/dal/jdbc/dal-report.xml
+8
-0
未找到文件。
cat-home/src/main/java/com/dianping/cat/report/page/sql/SqlReportModel.java
浏览文件 @
0819827d
...
...
@@ -11,7 +11,7 @@ public class SqlReportModel {
}
public
double
getFailurePercent
()
{
return
(
double
)
m_record
.
getFailure
s
()
/
(
double
)
m_record
.
getTotalCount
();
return
(
double
)
m_record
.
getFailure
Count
()
/
(
double
)
m_record
.
getTotalCount
();
}
public
double
getLongPercent
()
{
...
...
cat-job/src/main/java/com/dianping/cat/job/sql/database/SqlRecordJobReducer.java
浏览文件 @
0819827d
...
...
@@ -21,7 +21,7 @@ public class SqlRecordJobReducer extends Reducer<Text, Text, Text, Text> {
SqlReportRecord
row
=
dao
.
createLocal
();
row
.
setDomain
(
sql
.
getDomain
());
row
.
setTotalCount
(
sql
.
getTotalCount
());
row
.
setFailure
s
(
sql
.
getFailureCount
());
row
.
setFailure
Count
(
sql
.
getFailureCount
());
row
.
setLongSqls
(
sql
.
getLongCount
());
row
.
setAvg2Value
(
sql
.
getAvg2
());
row
.
setSumValue
(
sql
.
getSum
());
...
...
cat-job/src/main/java/com/dianping/cat/job/storage/RemoteMessageBucket.java
浏览文件 @
0819827d
...
...
@@ -73,7 +73,7 @@ public class RemoteMessageBucket implements Bucket<MessageTree>, LogEnabled {
@Override
public
MessageTree
findById
(
String
id
)
throws
IOException
{
try
{
Logview
logview
=
m_logviewDao
.
findBy
PK
(
id
,
LogviewEntity
.
READSET_FULL
);
Logview
logview
=
m_logviewDao
.
findBy
MessageId
(
id
,
LogviewEntity
.
READSET_FULL
);
MessageTree
tree
=
readMessageTree
(
logview
);
return
tree
;
...
...
cat-job/src/main/resources/META-INF/dal/jdbc/codegen.xml
浏览文件 @
0819827d
<?xml version="1.0" encoding="UTF-8"?>
<entities>
<entity
name=
"logview"
table=
"logview"
alias=
"l"
>
<member
name=
"message-id"
field=
"message_id"
value-type=
"String"
length=
"64"
nullable=
"false"
key=
"true"
/>
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"message-id"
field=
"message_id"
value-type=
"String"
length=
"64"
nullable=
"false"
/>
<member
name=
"data-path"
field=
"data_path"
value-type=
"String"
length=
"200"
nullable=
"false"
/>
<member
name=
"data-offset"
field=
"data_offset"
value-type=
"long"
length=
"19"
nullable=
"false"
/>
<member
name=
"data-length"
field=
"data_length"
value-type=
"int"
length=
"10"
nullable=
"false"
/>
<member
name=
"tag-thread"
field=
"tag_thread"
value-type=
"String"
length=
"
32
"
/>
<member
name=
"tag-session"
field=
"tag_session"
value-type=
"String"
length=
"
32
"
/>
<member
name=
"tag-request"
field=
"tag_request"
value-type=
"String"
length=
"
64
"
/>
<member
name=
"tag-thread"
field=
"tag_thread"
value-type=
"String"
length=
"
128
"
/>
<member
name=
"tag-session"
field=
"tag_session"
value-type=
"String"
length=
"
128
"
/>
<member
name=
"tag-request"
field=
"tag_request"
value-type=
"String"
length=
"
128
"
/>
<member
name=
"creation-date"
field=
"creation_date"
value-type=
"Date"
nullable=
"false"
/>
<var
name=
"key-message-id"
value-type=
"String"
key-member=
"message-id"
/>
<primary-key
name=
"PRIMARY"
members=
"message_id"
/>
<var
name=
"key-id"
value-type=
"int"
key-member=
"id"
/>
<primary-key
name=
"PRIMARY"
members=
"id"
/>
<index
name=
"message_id"
members=
"message_id ASC"
/>
<index
name=
"tag_thread"
members=
"tag_thread ASC"
/>
<index
name=
"tag_session"
members=
"tag_session ASC"
/>
<index
name=
"tag_request"
members=
"tag_request ASC"
/>
...
...
@@ -22,19 +24,19 @@
</updatesets>
<query-defs>
<query
name=
"find-by-PK"
type=
"SELECT"
>
<param
name=
"key-
message-
id"
/>
<statement>
<![CDATA[SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='
message-id'/> = ${key-message
-id}]]>
</statement>
<param
name=
"key-id"
/>
<statement>
<![CDATA[SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='
id'/> = ${key
-id}]]>
</statement>
</query>
<query
name=
"insert"
type=
"INSERT"
>
<statement>
<![CDATA[INSERT INTO <TABLE/>(<FIELDS/>) VALUES(<VALUES/>)]]>
</statement>
</query>
<query
name=
"update-by-PK"
type=
"UPDATE"
>
<param
name=
"key-
message-
id"
/>
<statement>
<![CDATA[UPDATE <TABLE/> SET <FIELDS/> WHERE <FIELD name='
message-id'/> = ${key-message
-id}]]>
</statement>
<param
name=
"key-id"
/>
<statement>
<![CDATA[UPDATE <TABLE/> SET <FIELDS/> WHERE <FIELD name='
id'/> = ${key
-id}]]>
</statement>
</query>
<query
name=
"delete-by-PK"
type=
"DELETE"
>
<param
name=
"key-
message-
id"
/>
<statement>
<![CDATA[DELETE FROM <TABLE/> WHERE <FIELD name='
message-id'/> = ${key-message
-id}]]>
</statement>
<param
name=
"key-id"
/>
<statement>
<![CDATA[DELETE FROM <TABLE/> WHERE <FIELD name='
id'/> = ${key
-id}]]>
</statement>
</query>
</query-defs>
</entity>
...
...
@@ -42,13 +44,13 @@
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"type"
field=
"type"
value-type=
"int"
length=
"3"
nullable=
"false"
/>
<member
name=
"name"
field=
"name"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"ip"
field=
"ip"
value-type=
"String"
length=
"20"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"content"
field=
"content"
value-type=
"String"
length=
"16777215"
nullable=
"false"
/>
<member
name=
"creation-date"
field=
"creation_date"
value-type=
"Date"
nullable=
"false"
/>
<var
name=
"key-id"
value-type=
"int"
key-member=
"id"
/>
<primary-key
name=
"PRIMARY"
members=
"id"
/>
<index
name=
"period_domain_name_type"
unique=
"true"
members=
"period ASC, domain ASC, name ASC, type ASC"
/>
<readsets>
<readset
name=
"FULL"
all=
"true"
/>
</readsets>
...
...
@@ -74,27 +76,27 @@
</query-defs>
</entity>
<entity
name=
"sqlreport"
table=
"sqlreport"
alias=
"s"
>
<member
name=
"id"
field=
"
I
d"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"domain"
field=
"
D
omain"
value-type=
"String"
length=
"50"
nullable=
"false"
/>
<member
name=
"name"
field=
"
N
ame"
value-type=
"String"
length=
"100"
nullable=
"false"
/>
<member
name=
"statement"
field=
"
S
tatement"
value-type=
"String"
length=
"500"
nullable=
"false"
/>
<member
name=
"total-count"
field=
"
TotalC
ount"
value-type=
"int"
length=
"10"
nullable=
"false"
/>
<member
name=
"failure
s"
field=
"Failures
"
value-type=
"int"
length=
"10"
nullable=
"false"
/>
<member
name=
"long-sqls"
field=
"
LongS
qls"
value-type=
"int"
length=
"10"
nullable=
"false"
/>
<member
name=
"min-value"
field=
"
MinV
alue"
value-type=
"double"
length=
"22"
nullable=
"false"
/>
<member
name=
"max-value"
field=
"
MaxV
alue"
value-type=
"double"
length=
"22"
nullable=
"false"
/>
<member
name=
"avg2-value"
field=
"
Avg2V
alue"
value-type=
"double"
length=
"22"
nullable=
"false"
/>
<member
name=
"sum-value"
field=
"
SumV
alue"
value-type=
"double"
length=
"22"
nullable=
"false"
/>
<member
name=
"sum2-value"
field=
"
Sum2V
alue"
value-type=
"double"
length=
"22"
nullable=
"false"
/>
<member
name=
"sample-link"
field=
"
SampleL
ink"
value-type=
"String"
length=
"64"
nullable=
"false"
/>
<member
name=
"transaction-date"
field=
"
TransactionD
ate"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"creation-date"
field=
"
CreationD
ate"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"duration-distribution"
field=
"
DurationDistribution"
value-type=
"String"
length=
"500
"
nullable=
"false"
/>
<member
name=
"hits-over-time"
field=
"
HitsOverTime"
value-type=
"String"
length=
"500
"
nullable=
"false"
/>
<member
name=
"duration-over-time"
field=
"
DurationOverTime"
value-type=
"String"
length=
"500
"
nullable=
"false"
/>
<member
name=
"failure-over-time"
field=
"
FailureOverTime"
value-type=
"String"
length=
"500
"
nullable=
"false"
/>
<member
name=
"id"
field=
"
i
d"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"domain"
field=
"
d
omain"
value-type=
"String"
length=
"50"
nullable=
"false"
/>
<member
name=
"name"
field=
"
n
ame"
value-type=
"String"
length=
"100"
nullable=
"false"
/>
<member
name=
"statement"
field=
"
s
tatement"
value-type=
"String"
length=
"500"
nullable=
"false"
/>
<member
name=
"total-count"
field=
"
total_c
ount"
value-type=
"int"
length=
"10"
nullable=
"false"
/>
<member
name=
"failure
-count"
field=
"failure_count
"
value-type=
"int"
length=
"10"
nullable=
"false"
/>
<member
name=
"long-sqls"
field=
"
long_s
qls"
value-type=
"int"
length=
"10"
nullable=
"false"
/>
<member
name=
"min-value"
field=
"
min_v
alue"
value-type=
"double"
length=
"22"
nullable=
"false"
/>
<member
name=
"max-value"
field=
"
max_v
alue"
value-type=
"double"
length=
"22"
nullable=
"false"
/>
<member
name=
"avg2-value"
field=
"
avg2_v
alue"
value-type=
"double"
length=
"22"
nullable=
"false"
/>
<member
name=
"sum-value"
field=
"
sum_v
alue"
value-type=
"double"
length=
"22"
nullable=
"false"
/>
<member
name=
"sum2-value"
field=
"
sum2_v
alue"
value-type=
"double"
length=
"22"
nullable=
"false"
/>
<member
name=
"sample-link"
field=
"
sample_l
ink"
value-type=
"String"
length=
"64"
nullable=
"false"
/>
<member
name=
"transaction-date"
field=
"
transaction_d
ate"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"creation-date"
field=
"
creation_d
ate"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"duration-distribution"
field=
"
duration_distribution"
value-type=
"String"
length=
"512
"
nullable=
"false"
/>
<member
name=
"hits-over-time"
field=
"
hits_over_time"
value-type=
"String"
length=
"512
"
nullable=
"false"
/>
<member
name=
"duration-over-time"
field=
"
duration_over_time"
value-type=
"String"
length=
"512
"
nullable=
"false"
/>
<member
name=
"failure-over-time"
field=
"
failure_over_time"
value-type=
"String"
length=
"512
"
nullable=
"false"
/>
<var
name=
"key-id"
value-type=
"int"
key-member=
"id"
/>
<primary-key
name=
"PRIMARY"
members=
"
I
d"
/>
<primary-key
name=
"PRIMARY"
members=
"
i
d"
/>
<readsets>
<readset
name=
"FULL"
all=
"true"
/>
</readsets>
...
...
cat-job/src/main/resources/META-INF/dal/jdbc/dal-report.xml
浏览文件 @
0819827d
...
...
@@ -42,6 +42,14 @@
WHERE
<FIELD
name=
'message-id'
/>
<IN>
${message-ids}
</IN>
]]>
</statement>
</query>
<query
name=
"find-by-message-id"
type=
"SELECT"
multiple=
"false"
>
<param
name=
"message-id"
/>
<statement>
<![CDATA[
SELECT <FIELDS/>
FROM
<TABLE/>
WHERE
<FIELD
name=
'message-id'
/>
= ${message-id}
</IN>
]]>
</statement>
</query>
</query-defs>
</entity>
<entity
name=
"report"
table=
"report"
alias=
"r"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录