Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
99cd9155
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,发现更多精彩内容 >>
提交
99cd9155
编写于
1月 31, 2012
作者:
S
sean.wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
findbug fix
上级
43242b99
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
15 addition
and
13 deletion
+15
-13
cat-consumer/src/main/java/com/dianping/cat/consumer/DefaultAnalyzerFactory.java
...ava/com/dianping/cat/consumer/DefaultAnalyzerFactory.java
+1
-1
cat-consumer/src/test/java/com/dianping/cat/consumer/failure/FailureAnalyzerStoreTest.java
...anping/cat/consumer/failure/FailureAnalyzerStoreTest.java
+2
-2
cat-consumer/src/test/java/com/dianping/cat/consumer/failure/FailureAnalyzerTest.java
...om/dianping/cat/consumer/failure/FailureAnalyzerTest.java
+4
-3
cat-core/src/main/java/com/dianping/cat/configuration/model/ClientConfigValidator.java
...anping/cat/configuration/model/ClientConfigValidator.java
+1
-1
cat-core/src/main/java/com/dianping/cat/message/io/TcpSocketReceiver.java
...n/java/com/dianping/cat/message/io/TcpSocketReceiver.java
+1
-1
cat-core/src/main/java/com/dianping/cat/message/spi/codec/HtmlMessageCodec.java
.../com/dianping/cat/message/spi/codec/HtmlMessageCodec.java
+1
-1
cat-home/src/test/java/com/dianping/cat/demo/Demo.java
cat-home/src/test/java/com/dianping/cat/demo/Demo.java
+5
-4
未找到文件。
cat-consumer/src/main/java/com/dianping/cat/consumer/DefaultAnalyzerFactory.java
浏览文件 @
99cd9155
...
...
@@ -29,6 +29,6 @@ public class DefaultAnalyzerFactory extends ContainerHolder implements AnalyzerF
@Override
public
void
release
(
Object
component
)
{
release
(
component
);
super
.
release
(
component
);
}
}
cat-consumer/src/test/java/com/dianping/cat/consumer/failure/FailureAnalyzerStoreTest.java
浏览文件 @
99cd9155
...
...
@@ -55,7 +55,7 @@ public class FailureAnalyzerStoreTest extends ComponentTestCase {
tree
.
setMessage
(
t
);
tree
.
setIpAddress
(
"192.168.8."
+
i
%
4
);
t
.
setDuration
(
3
*
1000
);
t
.
setTimestamp
(
start
+
1000
*
60
*
i
);
t
.
setTimestamp
(
start
+
1000
L
*
60
*
i
);
analyzer
.
process
(
tree
);
analyzer
.
process
(
tree
);
analyzer
.
process
(
tree
);
...
...
@@ -95,7 +95,7 @@ public class FailureAnalyzerStoreTest extends ComponentTestCase {
tree
.
setHostName
(
"middleware"
);
tree
.
setMessage
(
t
);
t
.
setDuration
(
3
*
1000
);
t
.
setTimestamp
(
start
+
1000
*
60
*
i
);
t
.
setTimestamp
(
start
+
1000
L
*
60
*
i
);
analyzer
.
process
(
tree
);
}
...
...
cat-consumer/src/test/java/com/dianping/cat/consumer/failure/FailureAnalyzerTest.java
浏览文件 @
99cd9155
...
...
@@ -112,9 +112,10 @@ public class FailureAnalyzerTest extends ComponentTestCase {
if
(
entries
==
null
)
{
System
.
out
.
println
(
minuteStr
);
}
else
{
assertEquals
(
"Check the segment size "
,
50
,
entries
.
size
());
}
assertEquals
(
"Check the segment size "
,
50
,
entries
.
size
());
startDate
.
setTime
(
startDate
.
getTime
()
+
1000
*
60
);
}
}
...
...
@@ -139,7 +140,7 @@ public class FailureAnalyzerTest extends ComponentTestCase {
tree
.
setIpAddress
(
"127.0.0."
+
i
);
tree
.
setMessage
(
t
);
t
.
setDuration
(
3
*
1000
);
t
.
setTimestamp
(
start
+
1000
*
60
*
i
);
t
.
setTimestamp
(
start
+
1000
L
*
60
*
i
);
analyzer
.
process
(
tree
);
// analyzer.process(tree);
}
...
...
cat-core/src/main/java/com/dianping/cat/configuration/model/ClientConfigValidator.java
浏览文件 @
99cd9155
...
...
@@ -7,7 +7,7 @@ public class ClientConfigValidator extends DefaultValidator {
@Override
public
void
visitConfig
(
Config
config
)
{
if
(!
"client"
.
equals
(
config
.
getMode
()))
{
throw
new
RuntimeException
(
String
.
format
(
"Attribute(%
)s
at path(%s) is required!"
,
"mode"
,
"/config"
));
throw
new
RuntimeException
(
String
.
format
(
"Attribute(%
s)
at path(%s) is required!"
,
"mode"
,
"/config"
));
}
else
if
(
config
.
getApp
()
==
null
)
{
throw
new
RuntimeException
(
String
.
format
(
"Element(%s) at path(%s) is required!"
,
"app"
,
"/config"
));
}
else
if
(
config
.
getServers
().
size
()
==
0
)
{
...
...
cat-core/src/main/java/com/dianping/cat/message/io/TcpSocketReceiver.java
浏览文件 @
99cd9155
...
...
@@ -105,7 +105,7 @@ public class TcpSocketReceiver implements MessageReceiver, LogEnabled {
m_factory
.
releaseExternalResources
();
}
public
class
MyDecoder
extends
FrameDecoder
{
public
static
class
MyDecoder
extends
FrameDecoder
{
@Override
/**
* return null means not all data is ready, so waiting for next network package.
...
...
cat-core/src/main/java/com/dianping/cat/message/spi/codec/HtmlMessageCodec.java
浏览文件 @
99cd9155
...
...
@@ -80,7 +80,7 @@ public class HtmlMessageCodec implements MessageCodec {
if
(
counter
!=
null
)
{
counter
.
inc
();
count
+=
helper
.
tr1
(
buf
,
counter
.
getCount
()
%
2
==
1
?
"odd"
:
"even"
);
count
+=
helper
.
tr1
(
buf
,
counter
.
getCount
()
%
2
!=
0
?
"odd"
:
"even"
);
}
else
{
count
+=
helper
.
tr1
(
buf
,
null
);
}
...
...
cat-home/src/test/java/com/dianping/cat/demo/Demo.java
浏览文件 @
99cd9155
package
com.dianping.cat.demo
;
import
java.io.File
;
import
java.util.Random
;
import
org.junit.After
;
import
org.junit.Before
;
...
...
@@ -44,16 +45,16 @@ public class Demo extends ComponentTestCase {
cat
.
logEvent
(
"RuntimeException"
,
RuntimeException
.
class
.
getName
(),
"ERROR"
,
null
);
cat
.
logEvent
(
"Exception"
,
Exception
.
class
.
getName
(),
"ERROR"
,
null
);
cat
.
logEvent
(
"RuntimeException"
,
NullPointerException
.
class
.
getName
(),
"ERROR"
,
null
);
t
.
setStatus
(
"
0
"
);
Thread
.
sleep
(
new
Random
().
nextInt
(
10
)
*
new
Random
().
nextInt
(
3
));
t
.
setStatus
(
"
error
"
);
t
.
complete
();
}
@Test
public
void
demo2
()
throws
Exception
{
MessageProducer
cat
=
lookup
(
MessageProducer
.
class
);
Transaction
t
=
cat
.
newTransaction
(
"SQL"
,
"update-user"
);
Transaction
t
=
cat
.
newTransaction
(
"SQL
3
"
,
"update-user"
);
Thread
.
sleep
(
10
);
t
.
setStatus
(
"error"
);
t
.
complete
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录