Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
ca602e17
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,发现更多精彩内容 >>
提交
ca602e17
编写于
2月 13, 2015
作者:
J
jialinsun
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of code.dianpingoa.com:arch/cat
上级
0e2e1d23
41ea2ae4
变更
40
隐藏空白更改
内联
并排
Showing
40 changed file
with
132 addition
and
517 deletion
+132
-517
cat-core/src/main/java/com/dianping/cat/service/DefaultReportManager.java
...n/java/com/dianping/cat/service/DefaultReportManager.java
+0
-1
cat-core/src/main/resources/META-INF/dal/jdbc/report-codegen.xml
...e/src/main/resources/META-INF/dal/jdbc/report-codegen.xml
+0
-4
cat-core/src/main/resources/META-INF/dal/jdbc/report-dal.xml
cat-core/src/main/resources/META-INF/dal/jdbc/report-dal.xml
+0
-3
cat-home/src/main/java/com/dianping/cat/report/alert/exception/AlertReportBuilder.java
...anping/cat/report/alert/exception/AlertReportBuilder.java
+0
-4
cat-home/src/main/java/com/dianping/cat/report/service/DefaultReportServiceManager.java
...nping/cat/report/service/DefaultReportServiceManager.java
+0
-2
cat-home/src/main/java/com/dianping/cat/report/service/impl/AlertReportService.java
.../dianping/cat/report/service/impl/AlertReportService.java
+13
-35
cat-home/src/main/java/com/dianping/cat/report/service/impl/BugReportService.java
...om/dianping/cat/report/service/impl/BugReportService.java
+12
-35
cat-home/src/main/java/com/dianping/cat/report/service/impl/CrossReportService.java
.../dianping/cat/report/service/impl/CrossReportService.java
+12
-38
cat-home/src/main/java/com/dianping/cat/report/service/impl/DependencyReportService.java
...ping/cat/report/service/impl/DependencyReportService.java
+3
-11
cat-home/src/main/java/com/dianping/cat/report/service/impl/EventReportService.java
.../dianping/cat/report/service/impl/EventReportService.java
+8
-33
cat-home/src/main/java/com/dianping/cat/report/service/impl/HeartbeatReportService.java
...nping/cat/report/service/impl/HeartbeatReportService.java
+5
-22
cat-home/src/main/java/com/dianping/cat/report/service/impl/HeavyReportService.java
.../dianping/cat/report/service/impl/HeavyReportService.java
+11
-36
cat-home/src/main/java/com/dianping/cat/report/service/impl/MatrixReportService.java
...dianping/cat/report/service/impl/MatrixReportService.java
+11
-38
cat-home/src/main/java/com/dianping/cat/report/service/impl/NetTopologyReportService.java
...ing/cat/report/service/impl/NetTopologyReportService.java
+7
-17
cat-home/src/main/java/com/dianping/cat/report/service/impl/ProblemReportService.java
...ianping/cat/report/service/impl/ProblemReportService.java
+7
-34
cat-home/src/main/java/com/dianping/cat/report/service/impl/ServiceReportService.java
...ianping/cat/report/service/impl/ServiceReportService.java
+11
-35
cat-home/src/main/java/com/dianping/cat/report/service/impl/StateReportService.java
.../dianping/cat/report/service/impl/StateReportService.java
+11
-36
cat-home/src/main/java/com/dianping/cat/report/service/impl/TopReportService.java
...om/dianping/cat/report/service/impl/TopReportService.java
+3
-10
cat-home/src/main/java/com/dianping/cat/report/service/impl/TransactionReportService.java
...ing/cat/report/service/impl/TransactionReportService.java
+7
-35
cat-home/src/main/java/com/dianping/cat/report/service/impl/UtilizationReportService.java
...ing/cat/report/service/impl/UtilizationReportService.java
+10
-37
cat-home/src/main/java/com/dianping/cat/report/task/bug/BugReportBuilder.java
...va/com/dianping/cat/report/task/bug/BugReportBuilder.java
+0
-4
cat-home/src/main/java/com/dianping/cat/report/task/cached/CachedReportTask.java
...com/dianping/cat/report/task/cached/CachedReportTask.java
+0
-2
cat-home/src/main/java/com/dianping/cat/report/task/cross/CrossReportBuilder.java
...om/dianping/cat/report/task/cross/CrossReportBuilder.java
+0
-3
cat-home/src/main/java/com/dianping/cat/report/task/event/EventReportBuilder.java
...om/dianping/cat/report/task/event/EventReportBuilder.java
+0
-3
cat-home/src/main/java/com/dianping/cat/report/task/heartbeat/HeartbeatReportBuilder.java
...ing/cat/report/task/heartbeat/HeartbeatReportBuilder.java
+0
-1
cat-home/src/main/java/com/dianping/cat/report/task/heavy/HeavyReportBuilder.java
...om/dianping/cat/report/task/heavy/HeavyReportBuilder.java
+0
-4
cat-home/src/main/java/com/dianping/cat/report/task/highload/HighLoadReportBuilder.java
...nping/cat/report/task/highload/HighLoadReportBuilder.java
+0
-1
cat-home/src/main/java/com/dianping/cat/report/task/jar/JarReportBuilder.java
...va/com/dianping/cat/report/task/jar/JarReportBuilder.java
+0
-1
cat-home/src/main/java/com/dianping/cat/report/task/matrix/MatrixReportBuilder.java
.../dianping/cat/report/task/matrix/MatrixReportBuilder.java
+0
-3
cat-home/src/main/java/com/dianping/cat/report/task/network/NetTopologyReportBuilder.java
...ing/cat/report/task/network/NetTopologyReportBuilder.java
+0
-1
cat-home/src/main/java/com/dianping/cat/report/task/problem/ProblemReportBuilder.java
...ianping/cat/report/task/problem/ProblemReportBuilder.java
+0
-3
cat-home/src/main/java/com/dianping/cat/report/task/router/RouterConfigBuilder.java
.../dianping/cat/report/task/router/RouterConfigBuilder.java
+0
-1
cat-home/src/main/java/com/dianping/cat/report/task/service/ServiceReportBuilder.java
...ianping/cat/report/task/service/ServiceReportBuilder.java
+0
-4
cat-home/src/main/java/com/dianping/cat/report/task/state/StateReportBuilder.java
...om/dianping/cat/report/task/state/StateReportBuilder.java
+0
-3
cat-home/src/main/java/com/dianping/cat/report/task/system/SystemReportBuilder.java
.../dianping/cat/report/task/system/SystemReportBuilder.java
+0
-1
cat-home/src/main/java/com/dianping/cat/report/task/transaction/TransactionReportBuilder.java
...cat/report/task/transaction/TransactionReportBuilder.java
+0
-3
cat-home/src/main/java/com/dianping/cat/report/task/utilization/UtilizationReportBuilder.java
...cat/report/task/utilization/UtilizationReportBuilder.java
+0
-4
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+1
-1
cat-maven-plugin/src/main/resources/com/dianping/cat/plugin/Cat.sql
...plugin/src/main/resources/com/dianping/cat/plugin/Cat.sql
+0
-4
script/Cat.sql
script/Cat.sql
+0
-4
未找到文件。
cat-core/src/main/java/com/dianping/cat/service/DefaultReportManager.java
浏览文件 @
ca602e17
...
...
@@ -234,7 +234,6 @@ public class DefaultReportManager<T> implements ReportManager<T>, LogEnabled {
r
.
setPeriod
(
period
);
r
.
setIp
(
ip
);
r
.
setType
(
1
);
r
.
setContent
(
""
);
m_reportDao
.
insert
(
r
);
...
...
cat-core/src/main/resources/META-INF/dal/jdbc/report-codegen.xml
浏览文件 @
ca602e17
...
...
@@ -50,7 +50,6 @@
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"type"
field=
"type"
value-type=
"int"
length=
"3"
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"
/>
...
...
@@ -176,7 +175,6 @@
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"type"
field=
"type"
value-type=
"int"
length=
"3"
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"
/>
...
...
@@ -262,7 +260,6 @@
<member
name=
"ip"
field=
"ip"
value-type=
"String"
length=
"20"
/>
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"50"
nullable=
"false"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"content"
field=
"content"
value-type=
"String"
length=
"2147483647"
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"
/>
...
...
@@ -388,7 +385,6 @@
<member
name=
"domain"
field=
"domain"
value-type=
"String"
length=
"20"
nullable=
"false"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"type"
field=
"type"
value-type=
"int"
length=
"3"
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"
/>
...
...
cat-core/src/main/resources/META-INF/dal/jdbc/report-dal.xml
浏览文件 @
ca602e17
...
...
@@ -189,9 +189,6 @@
<member
name=
"domain"
/>
<member
name=
"name"
/>
</readset>
<readset
name=
"CONTENT"
>
<member
name=
"content"
/>
</readset>
</readsets>
<query-defs>
<query
name=
"find-all-by-domain-name-period"
type=
"SELECT"
multiple=
"true"
>
...
...
cat-home/src/main/java/com/dianping/cat/report/alert/exception/AlertReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -39,7 +39,6 @@ public class AlertReportBuilder implements TaskBuilder {
AlertReport
alertReport
=
queryHourlyReportsByDuration
(
name
,
domain
,
period
,
TaskHelper
.
tomorrowZero
(
period
));
DailyReport
report
=
new
DailyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -64,7 +63,6 @@ public class AlertReportBuilder implements TaskBuilder {
visitor
.
visitTopReport
(
topReport
);
HourlyReport
report
=
new
HourlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -82,7 +80,6 @@ public class AlertReportBuilder implements TaskBuilder {
AlertReport
alertReport
=
queryDailyReportsByDuration
(
domain
,
period
,
TaskHelper
.
nextMonthStart
(
period
));
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -101,7 +98,6 @@ public class AlertReportBuilder implements TaskBuilder {
+
TimeHelper
.
ONE_WEEK
));
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/service/DefaultReportServiceManager.java
浏览文件 @
ca602e17
...
...
@@ -101,7 +101,6 @@ public class DefaultReportServiceManager extends ContainerHolder implements Repo
@Override
public
boolean
insertDailyReport
(
DailyReport
report
,
byte
[]
content
)
{
try
{
report
.
setContent
(
""
);
m_dailyReportDao
.
insert
(
report
);
int
id
=
report
.
getId
();
...
...
@@ -120,7 +119,6 @@ public class DefaultReportServiceManager extends ContainerHolder implements Repo
@Override
public
boolean
insertHourlyReport
(
HourlyReport
report
,
byte
[]
content
)
{
try
{
report
.
setContent
(
""
);
m_hourlyReportDao
.
insert
(
report
);
int
id
=
report
.
getId
();
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/AlertReportService.java
浏览文件 @
ca602e17
...
...
@@ -52,17 +52,11 @@ public class AlertReportService extends AbstractReportService<AlertReport> {
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
();
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
AlertReport
reportModel
=
com
.
dianping
.
cat
.
home
.
alert
.
report
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
AlertReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
AlertReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -131,18 +125,12 @@ public class AlertReportService extends AbstractReportService<AlertReport> {
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
AlertReport
reportModel
=
com
.
dianping
.
cat
.
home
.
alert
.
report
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
AlertReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
AlertReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -153,7 +141,7 @@ public class AlertReportService extends AbstractReportService<AlertReport> {
alertReport
.
setStartTime
(
start
);
alertReport
.
setEndTime
(
new
Date
(
end
.
getTime
()
-
1
));
return
alertReport
;
}
...
...
@@ -162,15 +150,10 @@ public class AlertReportService extends AbstractReportService<AlertReport> {
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
Constants
.
REPORT_ALERT
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
home
.
alert
.
report
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -182,15 +165,10 @@ public class AlertReportService extends AbstractReportService<AlertReport> {
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
Constants
.
REPORT_ALERT
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
home
.
alert
.
report
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/BugReportService.java
浏览文件 @
ca602e17
...
...
@@ -52,17 +52,11 @@ public class BugReportService extends AbstractReportService<BugReport> {
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
();
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
BugReport
reportModel
=
com
.
dianping
.
cat
.
home
.
bug
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
BugReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
BugReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -131,18 +125,12 @@ public class BugReportService extends AbstractReportService<BugReport> {
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
BugReport
reportModel
=
com
.
dianping
.
cat
.
home
.
bug
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
BugReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
BugReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -162,15 +150,9 @@ public class BugReportService extends AbstractReportService<BugReport> {
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
Constants
.
REPORT_BUG
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
home
.
bug
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -182,15 +164,10 @@ public class BugReportService extends AbstractReportService<BugReport> {
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
Constants
.
REPORT_BUG
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
home
.
bug
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/CrossReportService.java
浏览文件 @
ca602e17
...
...
@@ -53,18 +53,11 @@ public class CrossReportService extends AbstractReportService<CrossReport> {
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
(
);
CrossReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
CrossReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
cross
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
CrossReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -133,20 +126,12 @@ public class CrossReportService extends AbstractReportService<CrossReport> {
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
// for old xml storage
CrossReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
cross
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
// for new binary storage, binary is same to report id
CrossReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
CrossReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -168,15 +153,9 @@ public class CrossReportService extends AbstractReportService<CrossReport> {
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
CrossAnalyzer
.
ID
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
consumer
.
cross
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -188,15 +167,10 @@ public class CrossReportService extends AbstractReportService<CrossReport> {
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
CrossAnalyzer
.
ID
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
consumer
.
cross
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/DependencyReportService.java
浏览文件 @
ca602e17
...
...
@@ -62,19 +62,11 @@ public class DependencyReportService extends AbstractReportService<DependencyRep
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
DependencyReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
dependency
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
DependencyReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
DependencyReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/EventReportService.java
浏览文件 @
ca602e17
...
...
@@ -59,16 +59,9 @@ public class EventReportService extends AbstractReportService<EventReport> {
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
(
);
EventReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
EventReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
event
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
EventReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
@@ -139,18 +132,10 @@ public class EventReportService extends AbstractReportService<EventReport> {
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
// for old xml storage
EventReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
event
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
// for new binary storage, binary is same to report id
EventReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
EventReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
@@ -176,13 +161,8 @@ public class EventReportService extends AbstractReportService<EventReport> {
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
EventAnalyzer
.
ID
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
eventReport
=
com
.
dianping
.
cat
.
consumer
.
event
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
eventReport
=
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
eventReport
=
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
@@ -198,13 +178,8 @@ public class EventReportService extends AbstractReportService<EventReport> {
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
EventAnalyzer
.
ID
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
eventReport
=
com
.
dianping
.
cat
.
consumer
.
event
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
eventReport
=
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
eventReport
=
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/HeartbeatReportService.java
浏览文件 @
ca602e17
...
...
@@ -16,7 +16,6 @@ import com.dianping.cat.consumer.heartbeat.model.entity.HeartbeatReport;
import
com.dianping.cat.consumer.heartbeat.model.entity.Period
;
import
com.dianping.cat.consumer.heartbeat.model.transform.BaseVisitor
;
import
com.dianping.cat.consumer.heartbeat.model.transform.DefaultNativeParser
;
import
com.dianping.cat.consumer.heartbeat.model.transform.DefaultSaxParser
;
import
com.dianping.cat.core.dal.DailyReport
;
import
com.dianping.cat.core.dal.DailyReportEntity
;
import
com.dianping.cat.core.dal.HourlyReport
;
...
...
@@ -50,17 +49,9 @@ public class HeartbeatReportService extends AbstractReportService<HeartbeatRepor
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
(
);
HeartbeatReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
HeartbeatReport
reportModel
=
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
HeartbeatReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
@@ -74,7 +65,7 @@ public class HeartbeatReportService extends AbstractReportService<HeartbeatRepor
Set
<
String
>
domains
=
queryAllDomainNames
(
start
,
end
,
HeartbeatAnalyzer
.
ID
);
heartbeatReport
.
getDomainNames
().
addAll
(
domains
);
new
HeartbeatConvertor
().
visitHeartbeatReport
(
heartbeatReport
);
return
heartbeatReport
;
}
...
...
@@ -116,17 +107,9 @@ public class HeartbeatReportService extends AbstractReportService<HeartbeatRepor
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
HeartbeatReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
heartbeat
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
HeartbeatReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
HeartbeatReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/HeavyReportService.java
浏览文件 @
ca602e17
...
...
@@ -52,17 +52,11 @@ public class HeavyReportService extends AbstractReportService<HeavyReport> {
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
();
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
HeavyReport
reportModel
=
com
.
dianping
.
cat
.
home
.
heavy
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
HeavyReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
HeavyReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -131,18 +125,11 @@ public class HeavyReportService extends AbstractReportService<HeavyReport> {
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
HeavyReport
reportModel
=
com
.
dianping
.
cat
.
home
.
heavy
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
HeavyReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
HeavyReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -162,15 +149,9 @@ public class HeavyReportService extends AbstractReportService<HeavyReport> {
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
Constants
.
REPORT_HEAVY
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
home
.
heavy
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -182,15 +163,9 @@ public class HeavyReportService extends AbstractReportService<HeavyReport> {
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
Constants
.
REPORT_HEAVY
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
home
.
heavy
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/MatrixReportService.java
浏览文件 @
ca602e17
...
...
@@ -53,18 +53,11 @@ public class MatrixReportService extends AbstractReportService<MatrixReport> {
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
(
);
MatrixReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
MatrixReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
matrix
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
MatrixReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -133,20 +126,12 @@ public class MatrixReportService extends AbstractReportService<MatrixReport> {
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
// for old xml storage
MatrixReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
matrix
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
// for new binary storage, binary is same to report id
MatrixReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
MatrixReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -168,15 +153,9 @@ public class MatrixReportService extends AbstractReportService<MatrixReport> {
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
MatrixAnalyzer
.
ID
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
consumer
.
matrix
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -188,15 +167,9 @@ public class MatrixReportService extends AbstractReportService<MatrixReport> {
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
MatrixAnalyzer
.
ID
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
consumer
.
matrix
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/NetTopologyReportService.java
浏览文件 @
ca602e17
...
...
@@ -28,7 +28,7 @@ public class NetTopologyReportService extends AbstractReportService<NetGraphSet>
public
NetGraphSet
queryDailyReport
(
String
domain
,
Date
start
,
Date
end
)
{
throw
new
RuntimeException
(
"net topology report don't support daily report"
);
}
private
NetGraphSet
queryFromHourlyBinary
(
int
id
)
throws
DalException
{
HourlyReportContent
content
=
m_hourlyReportContentDao
.
findByPK
(
id
,
HourlyReportContentEntity
.
READSET_FULL
);
...
...
@@ -43,7 +43,7 @@ public class NetTopologyReportService extends AbstractReportService<NetGraphSet>
public
NetGraphSet
queryHourlyReport
(
String
domain
,
Date
start
,
Date
end
)
{
long
startTime
=
start
.
getTime
();
String
name
=
Constants
.
REPORT_NET_TOPOLOGY
;
NetGraphSet
netGraph
Set
=
null
;
NetGraphSet
netGraph
s
=
null
;
List
<
HourlyReport
>
reports
=
null
;
try
{
...
...
@@ -54,24 +54,14 @@ public class NetTopologyReportService extends AbstractReportService<NetGraphSet>
}
if
(
reports
!=
null
&&
reports
.
size
()
>
0
)
{
String
xml
=
reports
.
get
(
0
).
getContent
();
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
try
{
netGraphSet
=
com
.
dianping
.
cat
.
home
.
network
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
}
else
{
try
{
netGraphSet
=
queryFromHourlyBinary
(
reports
.
get
(
0
).
getId
());
}
catch
(
DalException
e
)
{
Cat
.
logError
(
e
);
}
try
{
netGraphs
=
queryFromHourlyBinary
(
reports
.
get
(
0
).
getId
());
}
catch
(
DalException
e
)
{
Cat
.
logError
(
e
);
}
}
return
netGraph
Set
;
return
netGraph
s
;
}
@Override
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/ProblemReportService.java
浏览文件 @
ca602e17
...
...
@@ -54,17 +54,9 @@ public class ProblemReportService extends AbstractReportService<ProblemReport> {
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
(
);
ProblemReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
ProblemReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
problem
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
ProblemReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
@@ -137,18 +129,10 @@ public class ProblemReportService extends AbstractReportService<ProblemReport> {
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
// for old xml storage
ProblemReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
problem
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
// for new binary storage, binary is same to report id
ProblemReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
ProblemReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
@@ -177,13 +161,8 @@ public class ProblemReportService extends AbstractReportService<ProblemReport> {
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
ProblemAnalyzer
.
ID
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
problemReport
=
com
.
dianping
.
cat
.
consumer
.
problem
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
problemReport
=
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
problemReport
=
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
@@ -202,14 +181,8 @@ public class ProblemReportService extends AbstractReportService<ProblemReport> {
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
ProblemAnalyzer
.
ID
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
problemReport
=
com
.
dianping
.
cat
.
consumer
.
problem
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
problemReport
=
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
problemReport
=
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/ServiceReportService.java
浏览文件 @
ca602e17
...
...
@@ -52,17 +52,11 @@ public class ServiceReportService extends AbstractReportService<ServiceReport> {
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
();
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
ServiceReport
reportModel
=
com
.
dianping
.
cat
.
home
.
service
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
ServiceReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
ServiceReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -131,18 +125,11 @@ public class ServiceReportService extends AbstractReportService<ServiceReport> {
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
ServiceReport
reportModel
=
com
.
dianping
.
cat
.
home
.
service
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
ServiceReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
ServiceReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -162,15 +149,9 @@ public class ServiceReportService extends AbstractReportService<ServiceReport> {
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
Constants
.
REPORT_SERVICE
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
home
.
service
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -182,15 +163,10 @@ public class ServiceReportService extends AbstractReportService<ServiceReport> {
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
Constants
.
REPORT_SERVICE
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
home
.
service
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/StateReportService.java
浏览文件 @
ca602e17
...
...
@@ -52,18 +52,11 @@ public class StateReportService extends AbstractReportService<StateReport> {
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
St
ring
xml
=
report
.
getContent
(
);
St
ateReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
StateReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
state
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
StateReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -132,20 +125,12 @@ public class StateReportService extends AbstractReportService<StateReport> {
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
// for old xml storage
StateReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
state
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
// for new binary storage, binary is same to report id
StateReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
StateReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -164,15 +149,10 @@ public class StateReportService extends AbstractReportService<StateReport> {
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
StateAnalyzer
.
ID
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
consumer
.
state
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -184,15 +164,10 @@ public class StateReportService extends AbstractReportService<StateReport> {
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
StateAnalyzer
.
ID
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
consumer
.
state
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/TopReportService.java
浏览文件 @
ca602e17
...
...
@@ -61,18 +61,11 @@ public class TopReportService extends AbstractReportService<TopReport> {
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
TopReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
top
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
TopReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
TopReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/TransactionReportService.java
浏览文件 @
ca602e17
...
...
@@ -59,17 +59,9 @@ public class TransactionReportService extends AbstractReportService<TransactionR
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
(
);
TransactionReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
TransactionReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
transaction
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
TransactionReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
@@ -140,18 +132,10 @@ public class TransactionReportService extends AbstractReportService<TransactionR
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
// for old xml storage
TransactionReport
reportModel
=
com
.
dianping
.
cat
.
consumer
.
transaction
.
model
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
// for new binary storage, binary is same to report id
TransactionReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
TransactionReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
@@ -177,13 +161,7 @@ public class TransactionReportService extends AbstractReportService<TransactionR
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
TransactionAnalyzer
.
ID
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
transactionReport
=
com
.
dianping
.
cat
.
consumer
.
transaction
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
transactionReport
=
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
transactionReport
=
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
@@ -199,13 +177,7 @@ public class TransactionReportService extends AbstractReportService<TransactionR
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
TransactionAnalyzer
.
ID
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
transactionReport
=
com
.
dianping
.
cat
.
consumer
.
transaction
.
model
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
transactionReport
=
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
transactionReport
=
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
// ignore
}
catch
(
Exception
e
)
{
...
...
cat-home/src/main/java/com/dianping/cat/report/service/impl/UtilizationReportService.java
浏览文件 @
ca602e17
...
...
@@ -52,17 +52,10 @@ public class UtilizationReportService extends AbstractReportService<UtilizationR
try
{
DailyReport
report
=
m_dailyReportDao
.
findByDomainNamePeriod
(
domain
,
name
,
new
Date
(
startTime
),
DailyReportEntity
.
READSET_FULL
);
String
xml
=
report
.
getContent
();
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
UtilizationReport
reportModel
=
com
.
dianping
.
cat
.
home
.
utilization
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
UtilizationReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
UtilizationReport
reportModel
=
queryFromDailyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -131,19 +124,11 @@ public class UtilizationReportService extends AbstractReportService<UtilizationR
}
if
(
reports
!=
null
)
{
for
(
HourlyReport
report
:
reports
)
{
String
xml
=
report
.
getContent
();
try
{
if
(
xml
!=
null
&&
xml
.
length
()
>
0
)
{
UtilizationReport
reportModel
=
com
.
dianping
.
cat
.
home
.
utilization
.
transform
.
DefaultSaxParser
.
parse
(
xml
);
reportModel
.
accept
(
merger
);
}
else
{
UtilizationReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
UtilizationReport
reportModel
=
queryFromHourlyBinary
(
report
.
getId
(),
domain
);
reportModel
.
accept
(
merger
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -163,15 +148,9 @@ public class UtilizationReportService extends AbstractReportService<UtilizationR
try
{
MonthlyReport
entity
=
m_monthlyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
Constants
.
REPORT_UTILIZATION
,
MonthlyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
home
.
utilization
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromMonthlyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
@@ -183,15 +162,9 @@ public class UtilizationReportService extends AbstractReportService<UtilizationR
try
{
WeeklyReport
entity
=
m_weeklyReportDao
.
findReportByDomainNamePeriod
(
start
,
domain
,
Constants
.
REPORT_UTILIZATION
,
WeeklyReportEntity
.
READSET_FULL
);
String
content
=
entity
.
getContent
();
if
(
content
!=
null
&&
content
.
length
()
>
0
)
{
return
com
.
dianping
.
cat
.
home
.
utilization
.
transform
.
DefaultSaxParser
.
parse
(
content
);
}
else
{
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
return
queryFromWeeklyBinary
(
entity
.
getId
(),
domain
);
}
catch
(
DalNotFoundException
e
)
{
//ignore
//
ignore
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/task/bug/BugReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -48,7 +48,6 @@ public class BugReportBuilder implements TaskBuilder {
}
DailyReport
report
=
new
DailyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -80,7 +79,6 @@ public class BugReportBuilder implements TaskBuilder {
}
HourlyReport
report
=
new
HourlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -101,7 +99,6 @@ public class BugReportBuilder implements TaskBuilder {
}
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -122,7 +119,6 @@ public class BugReportBuilder implements TaskBuilder {
}
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/cached/CachedReportTask.java
浏览文件 @
ca602e17
...
...
@@ -54,7 +54,6 @@ public class CachedReportTask implements Task {
private
MonthlyReport
buildMonthlyReport
(
String
domain
,
Date
period
,
String
name
)
{
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -67,7 +66,6 @@ public class CachedReportTask implements Task {
private
WeeklyReport
buildWeeklyReport
(
String
domain
,
Date
period
,
String
name
)
{
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/cross/CrossReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -31,7 +31,6 @@ public class CrossReportBuilder implements TaskBuilder {
CrossReport
crossReport
=
queryHourlyReportsByDuration
(
name
,
domain
,
period
,
TaskHelper
.
tomorrowZero
(
period
));
DailyReport
report
=
new
DailyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -52,7 +51,6 @@ public class CrossReportBuilder implements TaskBuilder {
CrossReport
crossReport
=
queryDailyReportsByDuration
(
domain
,
period
,
TaskHelper
.
nextMonthStart
(
period
));
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -69,7 +67,6 @@ public class CrossReportBuilder implements TaskBuilder {
+
TimeHelper
.
ONE_WEEK
));
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/event/EventReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -54,7 +54,6 @@ public class EventReportBuilder implements TaskBuilder {
DailyReport
report
=
new
DailyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -119,7 +118,6 @@ public class EventReportBuilder implements TaskBuilder {
EventReport
eventReport
=
queryDailyReportsByDuration
(
domain
,
period
,
end
);
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -143,7 +141,6 @@ public class EventReportBuilder implements TaskBuilder {
EventReport
eventReport
=
queryDailyReportsByDuration
(
domain
,
period
,
end
);
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/heartbeat/HeartbeatReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -37,7 +37,6 @@ public class HeartbeatReportBuilder implements TaskBuilder {
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setContent
(
""
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
report
.
setName
(
name
);
report
.
setPeriod
(
period
);
...
...
cat-home/src/main/java/com/dianping/cat/report/task/heavy/HeavyReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -37,7 +37,6 @@ public class HeavyReportBuilder implements TaskBuilder {
HeavyReport
heavyReport
=
queryHourlyReportsByDuration
(
name
,
domain
,
period
,
TaskHelper
.
tomorrowZero
(
period
));
DailyReport
report
=
new
DailyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -67,7 +66,6 @@ public class HeavyReportBuilder implements TaskBuilder {
HourlyReport
report
=
new
HourlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -83,7 +81,6 @@ public class HeavyReportBuilder implements TaskBuilder {
HeavyReport
heavyReport
=
queryDailyReportsByDuration
(
domain
,
period
,
TaskHelper
.
nextMonthStart
(
period
));
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -100,7 +97,6 @@ public class HeavyReportBuilder implements TaskBuilder {
+
TimeHelper
.
ONE_WEEK
));
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/highload/HighLoadReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -52,7 +52,6 @@ public class HighLoadReportBuilder implements TaskBuilder {
HighloadReport
report
=
generateHighloadReport
(
period
);
DailyReport
dailyReport
=
new
DailyReport
();
dailyReport
.
setContent
(
""
);
dailyReport
.
setIp
(
""
);
dailyReport
.
setDomain
(
""
);
dailyReport
.
setCreationDate
(
new
Date
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/jar/JarReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -64,7 +64,6 @@ public class JarReportBuilder implements TaskBuilder {
HourlyReport
report
=
new
HourlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/matrix/MatrixReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -32,7 +32,6 @@ public class MatrixReportBuilder implements TaskBuilder {
MatrixReport
matrixReport
=
queryHourlyReportByDuration
(
name
,
domain
,
period
,
TaskHelper
.
tomorrowZero
(
period
));
DailyReport
report
=
new
DailyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -53,7 +52,6 @@ public class MatrixReportBuilder implements TaskBuilder {
MatrixReport
matrixReport
=
queryDailyReportsByDuration
(
domain
,
period
,
TaskHelper
.
nextMonthStart
(
period
));
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -70,7 +68,6 @@ public class MatrixReportBuilder implements TaskBuilder {
+
TimeHelper
.
ONE_WEEK
));
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/network/NetTopologyReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -75,7 +75,6 @@ public class NetTopologyReportBuilder implements TaskBuilder {
hourlyReport
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
hourlyReport
.
setDomain
(
domain
);
hourlyReport
.
setPeriod
(
period
);
hourlyReport
.
setContent
(
""
);
byte
[]
content
=
DefaultNativeBuilder
.
build
(
netGraphSet
);
return
m_reportService
.
insertHourlyReport
(
hourlyReport
,
content
);
}
...
...
cat-home/src/main/java/com/dianping/cat/report/task/problem/ProblemReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -56,7 +56,6 @@ public class ProblemReportBuilder implements TaskBuilder {
DailyReport
report
=
new
DailyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -105,7 +104,6 @@ public class ProblemReportBuilder implements TaskBuilder {
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -137,7 +135,6 @@ public class ProblemReportBuilder implements TaskBuilder {
+
TimeHelper
.
ONE_WEEK
));
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/router/RouterConfigBuilder.java
浏览文件 @
ca602e17
...
...
@@ -83,7 +83,6 @@ public class RouterConfigBuilder implements TaskBuilder, LogEnabled {
routerConfig
.
setEndTime
(
new
Date
(
end
.
getTime
()
+
TimeHelper
.
ONE_DAY
));
DailyReport
dailyReport
=
new
DailyReport
();
dailyReport
.
setContent
(
""
);
dailyReport
.
setCreationDate
(
new
Date
());
dailyReport
.
setDomain
(
domain
);
dailyReport
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/service/ServiceReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -45,7 +45,6 @@ public class ServiceReportBuilder implements TaskBuilder {
ServiceReport
serviceReport
=
queryHourlyReportsByDuration
(
name
,
domain
,
period
,
TaskHelper
.
tomorrowZero
(
period
));
DailyReport
report
=
new
DailyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -81,7 +80,6 @@ public class ServiceReportBuilder implements TaskBuilder {
}
HourlyReport
report
=
new
HourlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -97,7 +95,6 @@ public class ServiceReportBuilder implements TaskBuilder {
ServiceReport
serviceReport
=
queryDailyReportsByDuration
(
domain
,
period
,
TaskHelper
.
nextMonthStart
(
period
));
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -114,7 +111,6 @@ public class ServiceReportBuilder implements TaskBuilder {
+
TimeHelper
.
ONE_WEEK
));
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/state/StateReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -46,7 +46,6 @@ public class StateReportBuilder implements TaskBuilder {
StateReport
stateReport
=
queryHourlyReportsByDuration
(
domain
,
period
,
TaskHelper
.
tomorrowZero
(
period
));
DailyReport
report
=
new
DailyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -72,7 +71,6 @@ public class StateReportBuilder implements TaskBuilder {
StateReport
stateReport
=
queryDailyReportsByDuration
(
domain
,
period
,
TaskHelper
.
nextMonthStart
(
period
));
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -91,7 +89,6 @@ public class StateReportBuilder implements TaskBuilder {
StateReport
stateReport
=
queryDailyReportsByDuration
(
domain
,
start
,
end
);
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/system/SystemReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -39,7 +39,6 @@ public class SystemReportBuilder implements TaskBuilder {
SystemReport
report
=
buildSystemReport
(
period
);
DailyReport
dailyReport
=
new
DailyReport
();
dailyReport
.
setContent
(
""
);
dailyReport
.
setIp
(
""
);
dailyReport
.
setDomain
(
Constants
.
CAT
);
dailyReport
.
setCreationDate
(
new
Date
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/transaction/TransactionReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -61,7 +61,6 @@ public class TransactionReportBuilder implements TaskBuilder, LogEnabled {
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setContent
(
""
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
report
.
setName
(
name
);
report
.
setPeriod
(
period
);
...
...
@@ -125,7 +124,6 @@ public class TransactionReportBuilder implements TaskBuilder, LogEnabled {
TransactionReport
transactionReport
=
queryDailyReportsByDuration
(
domain
,
period
,
end
);
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -149,7 +147,6 @@ public class TransactionReportBuilder implements TaskBuilder, LogEnabled {
TransactionReport
transactionReport
=
queryDailyReportsByDuration
(
domain
,
period
,
end
);
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/utilization/UtilizationReportBuilder.java
浏览文件 @
ca602e17
...
...
@@ -49,7 +49,6 @@ public class UtilizationReportBuilder implements TaskBuilder {
TaskHelper
.
tomorrowZero
(
period
));
DailyReport
report
=
new
DailyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -124,7 +123,6 @@ public class UtilizationReportBuilder implements TaskBuilder {
HourlyReport
report
=
new
HourlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -142,7 +140,6 @@ public class UtilizationReportBuilder implements TaskBuilder {
TaskHelper
.
nextMonthStart
(
period
));
MonthlyReport
report
=
new
MonthlyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
@@ -160,7 +157,6 @@ public class UtilizationReportBuilder implements TaskBuilder {
+
TimeHelper
.
ONE_WEEK
));
WeeklyReport
report
=
new
WeeklyReport
();
report
.
setContent
(
""
);
report
.
setCreationDate
(
new
Date
());
report
.
setDomain
(
domain
);
report
.
setIp
(
NetworkInterfaceManager
.
INSTANCE
.
getLocalHostAddress
());
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
ca602e17
...
...
@@ -623,7 +623,7 @@
<component>
<role>
com.dianping.cat.report.service.ReportService
</role>
<role-hint>
storage
</role-hint>
<implementation>
com.dianping.cat.report.service.impl.
Cross
ReportService
</implementation>
<implementation>
com.dianping.cat.report.service.impl.
Storage
ReportService
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.core.dal.HourlyReportDao
</role>
...
...
cat-maven-plugin/src/main/resources/com/dianping/cat/plugin/Cat.sql
浏览文件 @
ca602e17
...
...
@@ -21,7 +21,6 @@ CREATE TABLE `dailyreport` (
`domain`
varchar
(
50
)
NOT
NULL
COMMENT
'报表处理的Domain信息'
,
`period`
datetime
NOT
NULL
COMMENT
'报表时间段'
,
`type`
tinyint
(
4
)
NOT
NULL
COMMENT
'报表数据格式, 1/xml, 2/json, 默认1'
,
`content`
mediumtext
NOT
NULL
COMMENT
'报表内容'
,
`creation_date`
datetime
NOT
NULL
COMMENT
'报表创建时间'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`period`
(
`period`
,
`domain`
,
`name`
)
...
...
@@ -34,7 +33,6 @@ CREATE TABLE `weeklyreport` (
`domain`
varchar
(
50
)
NOT
NULL
COMMENT
'报表处理的Domain信息'
,
`period`
datetime
NOT
NULL
COMMENT
'报表时间段'
,
`type`
tinyint
(
4
)
NOT
NULL
COMMENT
'报表数据格式, 1/xml, 2/json, 默认1'
,
`content`
mediumtext
NOT
NULL
COMMENT
'报表内容'
,
`creation_date`
datetime
NOT
NULL
COMMENT
'报表创建时间'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`period`
(
`period`
,
`domain`
,
`name`
)
...
...
@@ -47,7 +45,6 @@ CREATE TABLE `monthreport` (
`domain`
varchar
(
50
)
NOT
NULL
COMMENT
'报表处理的Domain信息'
,
`period`
datetime
NOT
NULL
COMMENT
'报表时间段'
,
`type`
tinyint
(
4
)
NOT
NULL
COMMENT
'报表数据格式, 1/xml, 2/json, 默认1'
,
`content`
mediumtext
NOT
NULL
COMMENT
'报表内容'
,
`creation_date`
datetime
NOT
NULL
COMMENT
'报表创建时间'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`period`
(
`period`
,
`domain`
,
`name`
)
...
...
@@ -85,7 +82,6 @@ CREATE TABLE `report` (
`ip`
varchar
(
50
)
DEFAULT
NULL
COMMENT
'报表来自于哪台机器'
,
`domain`
varchar
(
50
)
NOT
NULL
COMMENT
'报表项目'
,
`period`
timestamp
NOT
NULL
COMMENT
'报表时间段'
,
`content`
longtext
NULL
,
`creation_date`
timestamp
NOT
NULL
COMMENT
'报表创建时间'
,
PRIMARY
KEY
(
`id`
),
KEY
`IX_Domain_Name_Period`
(
`domain`
,
`name`
,
`period`
),
...
...
script/Cat.sql
浏览文件 @
ca602e17
...
...
@@ -19,7 +19,6 @@ CREATE TABLE `dailyreport` (
`domain`
varchar
(
50
)
NOT
NULL
COMMENT
'报表处理的Domain信息'
,
`period`
datetime
NOT
NULL
COMMENT
'报表时间段'
,
`type`
tinyint
(
4
)
NOT
NULL
COMMENT
'报表数据格式, 1/xml, 2/json, 默认1'
,
`content`
mediumtext
NOT
NULL
COMMENT
'报表内容'
,
`creation_date`
datetime
NOT
NULL
COMMENT
'报表创建时间'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`period`
(
`period`
,
`domain`
,
`name`
)
...
...
@@ -32,7 +31,6 @@ CREATE TABLE `weeklyreport` (
`domain`
varchar
(
50
)
NOT
NULL
COMMENT
'报表处理的Domain信息'
,
`period`
datetime
NOT
NULL
COMMENT
'报表时间段'
,
`type`
tinyint
(
4
)
NOT
NULL
COMMENT
'报表数据格式, 1/xml, 2/json, 默认1'
,
`content`
mediumtext
NOT
NULL
COMMENT
'报表内容'
,
`creation_date`
datetime
NOT
NULL
COMMENT
'报表创建时间'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`period`
(
`period`
,
`domain`
,
`name`
)
...
...
@@ -45,7 +43,6 @@ CREATE TABLE `monthreport` (
`domain`
varchar
(
50
)
NOT
NULL
COMMENT
'报表处理的Domain信息'
,
`period`
datetime
NOT
NULL
COMMENT
'报表时间段'
,
`type`
tinyint
(
4
)
NOT
NULL
COMMENT
'报表数据格式, 1/xml, 2/json, 默认1'
,
`content`
mediumtext
NOT
NULL
COMMENT
'报表内容'
,
`creation_date`
datetime
NOT
NULL
COMMENT
'报表创建时间'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`period`
(
`period`
,
`domain`
,
`name`
)
...
...
@@ -83,7 +80,6 @@ CREATE TABLE `report` (
`ip`
varchar
(
50
)
DEFAULT
NULL
COMMENT
'报表来自于哪台机器'
,
`domain`
varchar
(
50
)
NOT
NULL
COMMENT
'报表项目'
,
`period`
timestamp
NOT
NULL
COMMENT
'报表时间段'
,
`content`
longtext
NULL
,
`creation_date`
timestamp
NOT
NULL
COMMENT
'报表创建时间'
,
PRIMARY
KEY
(
`id`
),
KEY
`IX_Domain_Name_Period`
(
`domain`
,
`name`
,
`period`
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录