Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
bcf7164a
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,体验更适合开发者的 AI 搜索 >>
提交
bcf7164a
编写于
10月 31, 2013
作者:
A
ainilife
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add merge test for ProblemReport and StateReport
上级
a34735f9
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
690 addition
and
39 deletion
+690
-39
cat-consumer/src/test/java/com/dianping/cat/consumer/AllTests.java
...mer/src/test/java/com/dianping/cat/consumer/AllTests.java
+6
-0
cat-consumer/src/test/java/com/dianping/cat/consumer/problem/ProblemReportMergerTest.java
...ianping/cat/consumer/problem/ProblemReportMergerTest.java
+27
-0
cat-consumer/src/test/java/com/dianping/cat/consumer/state/StateReportMergerTest.java
...om/dianping/cat/consumer/state/StateReportMergerTest.java
+28
-0
cat-consumer/src/test/resources/com/dianping/cat/consumer/problem/ProblemReportMergeResult.xml
...ianping/cat/consumer/problem/ProblemReportMergeResult.xml
+0
-0
cat-consumer/src/test/resources/com/dianping/cat/consumer/problem/ProblemReportNew.xml
...es/com/dianping/cat/consumer/problem/ProblemReportNew.xml
+272
-0
cat-consumer/src/test/resources/com/dianping/cat/consumer/problem/ProblemReportOld.xml
...es/com/dianping/cat/consumer/problem/ProblemReportOld.xml
+274
-0
cat-consumer/src/test/resources/com/dianping/cat/consumer/state/new.xml
...rc/test/resources/com/dianping/cat/consumer/state/new.xml
+55
-0
cat-consumer/src/test/resources/com/dianping/cat/consumer/state/old.xml
...rc/test/resources/com/dianping/cat/consumer/state/old.xml
+28
-0
cat-consumer/src/test/resources/com/dianping/cat/consumer/state/result.xml
...test/resources/com/dianping/cat/consumer/state/result.xml
+0
-1
cat-home/src/test/java/com/dianping/cat/report/page/problem/ProblemReportMergerTest.java
...ping/cat/report/page/problem/ProblemReportMergerTest.java
+0
-16
cat-home/src/test/java/com/dianping/cat/report/page/state/StateReportMergerTest.java
...dianping/cat/report/page/state/StateReportMergerTest.java
+0
-22
未找到文件。
cat-consumer/src/test/java/com/dianping/cat/consumer/AllTests.java
浏览文件 @
bcf7164a
...
...
@@ -15,8 +15,10 @@ import com.dianping.cat.consumer.heartbeat.HeartbeatAnalyzerTest;
import
com.dianping.cat.consumer.problem.ProblemAnalyzerTest
;
import
com.dianping.cat.consumer.problem.ProblemHandlerTest
;
import
com.dianping.cat.consumer.problem.ProblemReportAggregationTest
;
import
com.dianping.cat.consumer.problem.ProblemReportMergerTest
;
import
com.dianping.cat.consumer.problem.ProblemReportTest
;
import
com.dianping.cat.consumer.state.StateAnalyzerTest
;
import
com.dianping.cat.consumer.state.StateReportMergerTest
;
import
com.dianping.cat.consumer.top.TopAnalyzerTest
;
import
com.dianping.cat.consumer.transaction.TransactionAnalyzerTest
;
import
com.dianping.cat.consumer.transaction.TransactionReportFilterTest
;
...
...
@@ -57,6 +59,8 @@ HeartbeatAnalyzerTest.class,
/* state */
StateAnalyzerTest
.
class
,
StateReportMergerTest
.
class
,
/* top */
TopAnalyzerTest
.
class
,
...
...
@@ -69,6 +73,8 @@ ProblemReportTest.class,
ProblemAnalyzerTest
.
class
,
ProblemReportMergerTest
.
class
,
CompositeFormatTest
.
class
,
DefaultFormatTest
.
class
...
...
cat-consumer/src/test/java/com/dianping/cat/consumer/problem/ProblemReportMergerTest.java
0 → 100644
浏览文件 @
bcf7164a
package
com.dianping.cat.consumer.problem
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
org.unidal.webres.helper.Files
;
import
com.dianping.cat.consumer.problem.model.entity.ProblemReport
;
import
com.dianping.cat.consumer.problem.model.transform.DefaultSaxParser
;
public
class
ProblemReportMergerTest
{
@Test
public
void
testProblemReportMerge
()
throws
Exception
{
String
oldXml
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"ProblemReportOld.xml"
),
"utf-8"
);
String
newXml
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"ProblemReportNew.xml"
),
"utf-8"
);
ProblemReport
reportOld
=
DefaultSaxParser
.
parse
(
oldXml
);
ProblemReport
reportNew
=
DefaultSaxParser
.
parse
(
newXml
);
String
expected
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"ProblemReportMergeResult.xml"
),
"utf-8"
);
ProblemReportMerger
merger
=
new
ProblemReportMerger
(
new
ProblemReport
(
reportOld
.
getDomain
()));
reportOld
.
accept
(
merger
);
reportNew
.
accept
(
merger
);
Assert
.
assertEquals
(
"Check the merge result!"
,
expected
.
replace
(
"\r"
,
""
),
merger
.
getProblemReport
().
toString
()
.
replace
(
"\r"
,
""
));
Assert
.
assertEquals
(
"Source report is changed!"
,
newXml
.
replace
(
"\r"
,
""
),
reportNew
.
toString
().
replace
(
"\r"
,
""
));
}
}
cat-consumer/src/test/java/com/dianping/cat/consumer/state/StateReportMergerTest.java
0 → 100644
浏览文件 @
bcf7164a
package
com.dianping.cat.consumer.state
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
org.unidal.webres.helper.Files
;
import
com.dianping.cat.consumer.state.model.entity.StateReport
;
import
com.dianping.cat.consumer.state.model.transform.DefaultSaxParser
;
public
class
StateReportMergerTest
{
@Test
public
void
testStateReportMerge
()
throws
Exception
{
String
oldXml
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"old.xml"
),
"utf-8"
);
String
newXml
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"new.xml"
),
"utf-8"
);
StateReport
reportOld
=
DefaultSaxParser
.
parse
(
oldXml
);
StateReport
reportNew
=
DefaultSaxParser
.
parse
(
newXml
);
String
expected
=
Files
.
forIO
()
.
readFrom
(
getClass
().
getResourceAsStream
(
"result.xml"
),
"utf-8"
);
StateReportMerger
merger
=
new
StateReportMerger
(
new
StateReport
(
reportOld
.
getDomain
()));
reportOld
.
accept
(
merger
);
reportNew
.
accept
(
merger
);
Assert
.
assertEquals
(
"Check the merge result!"
,
expected
.
replaceAll
(
"\r"
,
""
),
merger
.
getStateReport
()
.
toString
().
replaceAll
(
"\r"
,
""
));
}
}
cat-
home/src/test/resources/com/dianping/cat/report/page
/problem/ProblemReportMergeResult.xml
→
cat-
consumer/src/test/resources/com/dianping/cat/consumer
/problem/ProblemReportMergeResult.xml
浏览文件 @
bcf7164a
文件已移动
cat-consumer/src/test/resources/com/dianping/cat/consumer/problem/ProblemReportNew.xml
0 → 100755
浏览文件 @
bcf7164a
<?xml version="1.0" encoding="utf-8"?>
<problem-report
domain=
"Cat"
startTime=
"2012-06-26 16:00:00"
endTime=
"2012-06-26 16:59:59"
>
<domain>
Cat
</domain>
<ip>
192.168.165.1
</ip>
<machine
ip=
"192.168.165.1"
>
<entry
type=
"heartbeat"
status=
"192.168.165.1"
>
<duration
value=
"0"
count=
"1"
>
<message>
Cat-c0a8a501-1340700793104-0
</message>
</duration>
<thread
group-name=
"Cat"
name=
"Cat-StatusUpdateTask"
id=
"27"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700793104-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"long-url"
status=
"home"
>
<duration
value=
"50"
count=
"1"
>
<message>
Cat-c0a8a501-1340700793743-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-1"
id=
"33"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700793743-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"long-url"
status=
"p"
>
<duration
value=
"50"
count=
"8"
>
<message>
Cat-c0a8a501-1340700795112-0
</message>
<message>
Cat-c0a8a501-1340700799623-0
</message>
<message>
Cat-c0a8a501-1340700799739-0
</message>
<message>
Cat-c0a8a501-1340700799941-0
</message>
<message>
Cat-c0a8a501-1340700799949-0
</message>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700800040-0
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-1"
id=
"33"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700795112-0
</message>
<message>
Cat-c0a8a501-1340700799623-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-3"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799739-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-6"
id=
"38"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799941-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-4"
id=
"36"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799949-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-5"
id=
"37"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799945-1
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-9"
id=
"86"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700800040-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700800046-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"url"
status=
"p"
>
<duration
value=
"0"
count=
"10"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700799623-0
</message>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700799739-0
</message>
<message>
Cat-c0a8a501-1340700799941-0
</message>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
<message>
Cat-c0a8a501-1340700802937-0
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-1"
id=
"33"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799623-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-4"
id=
"36"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-3"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799739-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-6"
id=
"38"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799941-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-5"
id=
"37"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-9"
id=
"86"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700802937-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"failure"
status=
"MVC:OutboundPhase"
>
<duration
value=
"0"
count=
"10"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700799623-0
</message>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700799739-0
</message>
<message>
Cat-c0a8a501-1340700799941-0
</message>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
<message>
Cat-c0a8a501-1340700802937-0
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-1"
id=
"33"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799623-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-4"
id=
"36"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-3"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799739-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-6"
id=
"38"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799941-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-5"
id=
"37"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-9"
id=
"86"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700802937-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"error"
status=
"java.lang.RuntimeException"
>
<duration
value=
"0"
count=
"10"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700799623-0
</message>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700799739-0
</message>
<message>
Cat-c0a8a501-1340700799941-0
</message>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
<message>
Cat-c0a8a501-1340700802937-0
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-1"
id=
"33"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799623-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-4"
id=
"36"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-3"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799739-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-6"
id=
"38"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799941-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-5"
id=
"37"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-9"
id=
"86"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700802937-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"long-url"
status=
"t"
>
<duration
value=
"50"
count=
"2"
>
<message>
Cat-c0a8a501-1340700805433-0
</message>
<message>
Cat-c0a8a501-1340700808403-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700805433-0
</message>
<message>
Cat-c0a8a501-1340700808403-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"long-url"
status=
"model"
>
<duration
value=
"50"
count=
"2"
>
<message>
Cat-c0a8a501-1340700810278-0
</message>
<message>
Cat-c0a8a501-1340700810277-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-3"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700810278-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-7"
id=
"41"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700810277-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"long-url"
status=
"m"
>
<duration
value=
"50"
count=
"1"
>
<message>
Cat-c0a8a501-1340700810268-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700810268-0
</message>
</segment>
<segment
id=
"54"
count=
"1"
>
<message>
Cat-c0a8a501-1340700810268-0
</message>
</segment>
</thread>
</entry>
</machine>
</problem-report>
cat-consumer/src/test/resources/com/dianping/cat/consumer/problem/ProblemReportOld.xml
0 → 100755
浏览文件 @
bcf7164a
<?xml version="1.0" encoding="utf-8"?>
<problem-report
domain=
"Cat"
startTime=
"2012-06-26 16:00:00"
endTime=
"2012-06-26 16:59:59"
>
<domain>
Cat
</domain>
<ip>
192.168.165.1
</ip>
<machine
ip=
"192.168.165.1"
>
<entry
type=
"heartbeat"
status=
"192.168.165.1"
>
<duration
value=
"0"
count=
"1"
>
<message>
Cat-c0a8a501-1340700793104-0
</message>
</duration>
<thread
group-name=
"Cat"
name=
"Cat-StatusUpdateTask"
id=
"27"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700793104-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"long-url"
status=
"home"
>
<duration
value=
"50"
count=
"1"
>
<message>
Cat-c0a8a501-1340700793743-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-1"
id=
"33"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700793743-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"long-url"
status=
"p"
>
<duration
value=
"50"
count=
"8"
>
<message>
Cat-c0a8a501-1340700795112-0
</message>
<message>
Cat-c0a8a501-1340700799623-0
</message>
<message>
Cat-c0a8a501-1340700799739-0
</message>
<message>
Cat-c0a8a501-1340700799941-0
</message>
<message>
Cat-c0a8a501-1340700799949-0
</message>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700800040-0
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-1"
id=
"33"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700795112-0
</message>
<message>
Cat-c0a8a501-1340700799623-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-3"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799739-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-6"
id=
"38"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799941-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-4"
id=
"36"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799949-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-5"
id=
"37"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799945-1
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-9"
id=
"86"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700800040-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700800046-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"url"
status=
"p"
>
<duration
value=
"0"
count=
"10"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700799623-0
</message>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700799739-0
</message>
<message>
Cat-c0a8a501-1340700799941-0
</message>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
<message>
Cat-c0a8a501-1340700802937-0
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-1"
id=
"33"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799623-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-4"
id=
"36"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-3"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799739-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-6"
id=
"38"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799941-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-5"
id=
"37"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-9"
id=
"86"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700802937-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"failure"
status=
"MVC:OutboundPhase"
>
<duration
value=
"0"
count=
"10"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700799623-0
</message>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700799739-0
</message>
<message>
Cat-c0a8a501-1340700799941-0
</message>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
<message>
Cat-c0a8a501-1340700802937-0
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-1"
id=
"33"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799623-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-4"
id=
"36"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-3"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799739-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-6"
id=
"38"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799941-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-5"
id=
"37"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-9"
id=
"86"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700802937-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"error"
status=
"java.lang.RuntimeException"
>
<duration
value=
"0"
count=
"10"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700799623-0
</message>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700799739-0
</message>
<message>
Cat-c0a8a501-1340700799941-0
</message>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
<message>
Cat-c0a8a501-1340700802937-0
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799568-0
</message>
<message>
Cat-c0a8a501-1340700800046-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-1"
id=
"33"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799623-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-4"
id=
"36"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799710-0
</message>
<message>
Cat-c0a8a501-1340700802944-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-3"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799739-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-6"
id=
"38"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700799941-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-5"
id=
"37"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700799945-1
</message>
<message>
Cat-c0a8a501-1340700803230-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-9"
id=
"86"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700802937-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"long-url"
status=
"t"
>
<duration
value=
"50"
count=
"2"
>
<message>
Cat-c0a8a501-1340700805433-0
</message>
<message>
Cat-c0a8a501-1340700808403-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"2"
>
<message>
Cat-c0a8a501-1340700805433-0
</message>
<message>
Cat-c0a8a501-1340700808403-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"long-url"
status=
"model"
>
<duration
value=
"50"
count=
"2"
>
<message>
Cat-c0a8a501-1340700810278-0
</message>
<message>
Cat-c0a8a501-1340700810277-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-3"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700810278-0
</message>
</segment>
</thread>
<thread
group-name=
"main"
name=
"btpool0-7"
id=
"41"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700810277-0
</message>
</segment>
</thread>
</entry>
<entry
type=
"long-url"
status=
"m"
>
<duration
value=
"50"
count=
"1"
>
<message>
Cat-c0a8a501-1340700810268-0
</message>
</duration>
<thread
group-name=
"main"
name=
"btpool0-2"
id=
"34"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700810268-0
</message>
</segment>
</thread>
<thread
group-name=
"main1"
name=
"btpool0-2"
id=
"35"
>
<segment
id=
"53"
count=
"1"
>
<message>
Cat-c0a8a501-1340700810268-0
</message>
</segment>
</thread>
</entry>
</machine>
</problem-report>
cat-consumer/src/test/resources/com/dianping/cat/consumer/state/new.xml
0 → 100644
浏览文件 @
bcf7164a
<?xml version="1.0" encoding="utf-8"?>
<state-report
domain=
"Cat"
startTime=
"2012-11-22 23:00:00"
endTime=
"2012-11-22 23:59:59"
>
<machine
ip=
"192.168.66.125"
total=
"240"
totalLoss=
"10"
maxTps=
"60.0"
avgTps=
"4.0"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
pigeonTimeError=
"4"
networkTimeError=
"3"
dump=
"240"
dumpLoss=
"10"
size=
"100.0"
delaySum=
"100.0"
delayAvg=
"50.0"
delayCount=
"2"
>
<processDomains>
<processDomain
name=
"Cat"
total=
"0"
totalLoss=
"0"
size=
"0.0"
>
<ip>
192.168.66.125
</ip>
<ip>
192.168.66.126
</ip>
</processDomain>
<processDomain
name=
"Cat1"
total=
"0"
totalLoss=
"0"
size=
"0.0"
>
<ip>
192.168.66.125
</ip>
<ip>
192.168.66.126
</ip>
</processDomain>
</processDomains>
<message
id=
"1353596880000"
time=
"2012-11-22 23:08:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596940000"
time=
"2012-11-22 23:09:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597000000"
time=
"2012-11-22 23:10:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597060000"
time=
"2012-11-22 23:11:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597120000"
time=
"2012-11-22 23:12:00"
total=
"280"
totalLoss=
"0"
dump=
"280"
dumpLoss=
"0"
size=
"334590.0"
delaySum=
"21530533.0"
delayCount=
"28"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597180000"
time=
"2012-11-22 23:13:00"
total=
"140"
totalLoss=
"0"
dump=
"140"
dumpLoss=
"0"
size=
"207310.0"
delaySum=
"11034322.0"
delayCount=
"14"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597240000"
time=
"2012-11-22 23:14:00"
total=
"10"
totalLoss=
"0"
dump=
"10"
dumpLoss=
"0"
size=
"87638.0"
delaySum=
"874987.0"
delayCount=
"1"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597300000"
time=
"2012-11-22 23:15:00"
total=
"40"
totalLoss=
"0"
dump=
"40"
dumpLoss=
"0"
size=
"114908.0"
delaySum=
"3670934.0"
delayCount=
"4"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597360000"
time=
"2012-11-22 23:16:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597420000"
time=
"2012-11-22 23:16:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597480000"
time=
"2012-11-22 23:16:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
</machine>
<machine
ip=
"192.168.66.126"
total=
"240"
totalLoss=
"0"
maxTps=
"60.0"
avgTps=
"4.0"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
pigeonTimeError=
"4"
networkTimeError=
"3"
dump=
"240"
dumpLoss=
"0"
size=
"100.0"
delaySum=
"100.0"
delayAvg=
"50.0"
delayCount=
"2"
>
<processDomains>
<processDomain
name=
"Cat"
total=
"0"
totalLoss=
"0"
size=
"0.0"
>
<ip>
192.168.66.125
</ip>
<ip>
192.168.66.126
</ip>
</processDomain>
<processDomain
name=
"Cat2"
total=
"0"
totalLoss=
"0"
size=
"0.0"
>
<ip>
192.168.66.125
</ip>
<ip>
192.168.66.126
</ip>
</processDomain>
</processDomains>
<message
id=
"1353596400000"
time=
"2012-11-22 23:00:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596460000"
time=
"2012-11-22 23:01:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596520000"
time=
"2012-11-22 23:02:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596580000"
time=
"2012-11-22 23:03:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596640000"
time=
"2012-11-22 23:04:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596700000"
time=
"2012-11-22 23:05:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596760000"
time=
"2012-11-22 23:06:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596820000"
time=
"2012-11-22 23:07:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596880000"
time=
"2012-11-22 23:08:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596940000"
time=
"2012-11-22 23:09:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597000000"
time=
"2012-11-22 23:10:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597060000"
time=
"2012-11-22 23:11:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597120000"
time=
"2012-11-22 23:12:00"
total=
"280"
totalLoss=
"0"
dump=
"280"
dumpLoss=
"0"
size=
"334590.0"
delaySum=
"21530533.0"
delayCount=
"28"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597180000"
time=
"2012-11-22 23:13:00"
total=
"140"
totalLoss=
"0"
dump=
"140"
dumpLoss=
"0"
size=
"207310.0"
delaySum=
"11034322.0"
delayCount=
"14"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597240000"
time=
"2012-11-22 23:14:00"
total=
"10"
totalLoss=
"0"
dump=
"10"
dumpLoss=
"0"
size=
"87638.0"
delaySum=
"874987.0"
delayCount=
"1"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597300000"
time=
"2012-11-22 23:15:00"
total=
"40"
totalLoss=
"0"
dump=
"40"
dumpLoss=
"0"
size=
"114908.0"
delaySum=
"3670934.0"
delayCount=
"4"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597360000"
time=
"2012-11-22 23:16:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
</machine>
</state-report>
\ No newline at end of file
cat-consumer/src/test/resources/com/dianping/cat/consumer/state/old.xml
0 → 100644
浏览文件 @
bcf7164a
<?xml version="1.0" encoding="utf-8"?>
<state-report
domain=
"Cat"
startTime=
"2012-11-22 23:00:00"
endTime=
"2012-11-22 23:59:59"
>
<machine
ip=
"192.168.66.125"
total=
"240"
totalLoss=
"0"
maxTps=
"50.0"
avgTps=
"4.0"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
pigeonTimeError=
"4"
networkTimeError=
"3"
dump=
"240"
dumpLoss=
"0"
size=
"100.0"
delaySum=
"100.0"
delayAvg=
"50.0"
delayCount=
"2"
>
<processDomains>
<processDomain
name=
"Cat"
total=
"0"
totalLoss=
"0"
size=
"0.0"
>
<ip>
192.168.66.125
</ip>
</processDomain>
</processDomains>
<message
id=
"1353596400000"
time=
"2012-11-22 23:00:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596460000"
time=
"2012-11-22 23:01:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596520000"
time=
"2012-11-22 23:02:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596580000"
time=
"2012-11-22 23:03:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596640000"
time=
"2012-11-22 23:04:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596700000"
time=
"2012-11-22 23:05:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596760000"
time=
"2012-11-22 23:06:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596820000"
time=
"2012-11-22 23:07:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596880000"
time=
"2012-11-22 23:08:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353596940000"
time=
"2012-11-22 23:09:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597000000"
time=
"2012-11-22 23:10:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597060000"
time=
"2012-11-22 23:11:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597120000"
time=
"2012-11-22 23:12:00"
total=
"280"
totalLoss=
"0"
dump=
"280"
dumpLoss=
"0"
size=
"334590.0"
delaySum=
"21530533.0"
delayCount=
"28"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597180000"
time=
"2012-11-22 23:13:00"
total=
"140"
totalLoss=
"0"
dump=
"140"
dumpLoss=
"0"
size=
"207310.0"
delaySum=
"11034322.0"
delayCount=
"14"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597240000"
time=
"2012-11-22 23:14:00"
total=
"10"
totalLoss=
"0"
dump=
"10"
dumpLoss=
"0"
size=
"87638.0"
delaySum=
"874987.0"
delayCount=
"1"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597300000"
time=
"2012-11-22 23:15:00"
total=
"40"
totalLoss=
"0"
dump=
"40"
dumpLoss=
"0"
size=
"114908.0"
delaySum=
"3670934.0"
delayCount=
"4"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
<message
id=
"1353597360000"
time=
"2012-11-22 23:16:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
</machine>
</state-report>
cat-
home/src/test/resources/com/dianping/cat/report/page
/state/result.xml
→
cat-
consumer/src/test/resources/com/dianping/cat/consumer
/state/result.xml
浏览文件 @
bcf7164a
...
...
@@ -61,4 +61,3 @@
<message
id=
"1353597360000"
time=
"2012-11-22 23:16:00"
total=
"0"
totalLoss=
"0"
dump=
"0"
dumpLoss=
"0"
size=
"0.0"
delaySum=
"0.0"
delayCount=
"0"
pigeonTimeError=
"4"
networkTimeError=
"3"
blockTotal=
"2"
blockLoss=
"1"
blockTime=
"1"
/>
</machine>
</state-report>
cat-home/src/test/java/com/dianping/cat/report/page/problem/ProblemReportMergerTest.java
浏览文件 @
bcf7164a
...
...
@@ -14,22 +14,6 @@ import com.dianping.cat.consumer.problem.model.transform.DefaultSaxParser;
import
com.dianping.cat.report.task.problem.HistoryProblemReportMerger
;
public
class
ProblemReportMergerTest
{
@Test
public
void
testProblemReportMerge
()
throws
Exception
{
String
oldXml
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"ProblemReportOld.xml"
),
"utf-8"
);
String
newXml
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"ProblemReportNew.xml"
),
"utf-8"
);
ProblemReport
reportOld
=
DefaultSaxParser
.
parse
(
oldXml
);
ProblemReport
reportNew
=
DefaultSaxParser
.
parse
(
newXml
);
String
expected
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"ProblemReportMergeResult.xml"
),
"utf-8"
);
ProblemReportMerger
merger
=
new
ProblemReportMerger
(
new
ProblemReport
(
reportOld
.
getDomain
()));
reportOld
.
accept
(
merger
);
reportNew
.
accept
(
merger
);
Assert
.
assertEquals
(
"Check the merge result!"
,
expected
.
replace
(
"\r"
,
""
),
merger
.
getProblemReport
().
toString
()
.
replace
(
"\r"
,
""
));
Assert
.
assertEquals
(
"Source report is changed!"
,
newXml
.
replace
(
"\r"
,
""
),
reportNew
.
toString
().
replace
(
"\r"
,
""
));
}
@Test
public
void
testProblemReportMergeAll
()
throws
Exception
{
...
...
cat-home/src/test/java/com/dianping/cat/report/page/state/StateReportMergerTest.java
浏览文件 @
bcf7164a
...
...
@@ -4,33 +4,11 @@ import org.junit.Assert;
import
org.junit.Test
;
import
org.unidal.webres.helper.Files
;
import
com.dianping.cat.consumer.state.StateReportMerger
;
import
com.dianping.cat.consumer.state.model.entity.StateReport
;
import
com.dianping.cat.consumer.state.model.transform.DefaultSaxParser
;
import
com.dianping.cat.report.task.state.HistoryStateReportMerger
;
public
class
StateReportMergerTest
{
@Test
public
void
testStateReportMerge
()
throws
Exception
{
String
oldXml
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"old.xml"
),
"utf-8"
);
String
newXml
=
Files
.
forIO
().
readFrom
(
getClass
().
getResourceAsStream
(
"new.xml"
),
"utf-8"
);
StateReport
reportOld
=
DefaultSaxParser
.
parse
(
oldXml
);
StateReport
reportNew
=
DefaultSaxParser
.
parse
(
newXml
);
String
expected
=
Files
.
forIO
()
.
readFrom
(
getClass
().
getResourceAsStream
(
"result.xml"
),
"utf-8"
);
StateReportMerger
merger
=
new
StateReportMerger
(
new
StateReport
(
reportOld
.
getDomain
()));
reportOld
.
accept
(
merger
);
reportNew
.
accept
(
merger
);
Assert
.
assertEquals
(
"Check the merge result!"
,
expected
.
replaceAll
(
"\\s*"
,
""
),
merger
.
getStateReport
()
.
toString
().
replaceAll
(
"\\s*"
,
""
));
Assert
.
assertEquals
(
"Source report is changed!"
,
newXml
.
replaceAll
(
"\\s*"
,
""
),
reportNew
.
toString
().
replaceAll
(
"\\s*"
,
""
));
Assert
.
assertEquals
(
"Source report is changed!"
,
oldXml
.
replaceAll
(
"\\s*"
,
""
),
reportOld
.
toString
().
replaceAll
(
"\\s*"
,
""
));
}
@Test
public
void
testHistoryStateReportMerge
()
throws
Exception
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录