Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
adce6854
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 搜索 >>
提交
adce6854
编写于
2月 25, 2015
作者:
Y
youyong205
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor code
上级
fd405a66
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
18 addition
and
58 deletion
+18
-58
cat-client/src/main/java/com/dianping/cat/configuration/DefaultClientConfigManager.java
...ianping/cat/configuration/DefaultClientConfigManager.java
+1
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/build/ComponentsConfigurator.java
...m/dianping/cat/consumer/build/ComponentsConfigurator.java
+0
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/cross/CrossAnalyzer.java
...n/java/com/dianping/cat/consumer/cross/CrossAnalyzer.java
+6
-10
cat-consumer/src/main/java/com/dianping/cat/consumer/matrix/MatrixAnalyzer.java
...java/com/dianping/cat/consumer/matrix/MatrixAnalyzer.java
+0
-3
cat-consumer/src/main/java/com/dianping/cat/consumer/problem/DefaultProblemHandler.java
.../dianping/cat/consumer/problem/DefaultProblemHandler.java
+2
-16
cat-consumer/src/main/java/com/dianping/cat/consumer/problem/LongExecutionProblemHandler.java
...ing/cat/consumer/problem/LongExecutionProblemHandler.java
+1
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/storage/StorageAnalyzer.java
...va/com/dianping/cat/consumer/storage/StorageAnalyzer.java
+6
-9
cat-consumer/src/main/resources/META-INF/plexus/components.xml
...onsumer/src/main/resources/META-INF/plexus/components.xml
+0
-1
cat-core/src/main/java/com/dianping/cat/configuration/ServerConfigManager.java
...a/com/dianping/cat/configuration/ServerConfigManager.java
+0
-11
cat-core/src/test/java/com/dianping/cat/ServerConfigManagerTest.java
...c/test/java/com/dianping/cat/ServerConfigManagerTest.java
+1
-4
cat-home/src/main/java/com/dianping/cat/report/page/state/Payload.java
...main/java/com/dianping/cat/report/page/state/Payload.java
+1
-1
未找到文件。
cat-client/src/main/java/com/dianping/cat/configuration/DefaultClientConfigManager.java
浏览文件 @
adce6854
...
...
@@ -61,7 +61,7 @@ public class DefaultClientConfigManager implements LogEnabled, ClientConfigManag
@Override
public
int
getMaxMessageLength
()
{
if
(
m_config
==
null
)
{
return
2
000
;
return
5
000
;
}
else
{
return
getDomain
().
getMaxMessageSize
();
}
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/build/ComponentsConfigurator.java
浏览文件 @
adce6854
...
...
@@ -202,7 +202,6 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
final
String
ID
=
ProblemAnalyzer
.
ID
;
all
.
add
(
C
(
ProblemHandler
.
class
,
DefaultProblemHandler
.
ID
,
DefaultProblemHandler
.
class
)
//
.
config
(
E
(
"failureType"
).
value
(
"URL,SQL,Call,PigeonCall,Cache"
))
//
.
config
(
E
(
"errorType"
).
value
(
"Error,RuntimeException,Exception"
))
//
.
req
(
ServerConfigManager
.
class
));
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/cross/CrossAnalyzer.java
浏览文件 @
adce6854
...
...
@@ -93,18 +93,14 @@ public class CrossAnalyzer extends AbstractMessageAnalyzer<CrossReport> implemen
}
public
CrossInfo
parseCorssTransaction
(
Transaction
t
,
MessageTree
tree
)
{
if
(
m_serverConfigManager
.
discardTransaction
(
t
))
{
return
null
;
}
else
{
String
type
=
t
.
getType
();
String
type
=
t
.
getType
();
if
(
m_serverConfigManager
.
isRpcClient
(
type
))
{
return
parsePigeonClientTransaction
(
t
,
tree
);
}
else
if
(
m_serverConfigManager
.
isRpcServer
(
type
))
{
return
parsePigeonServerTransaction
(
t
,
tree
);
}
return
null
;
if
(
m_serverConfigManager
.
isRpcClient
(
type
))
{
return
parsePigeonClientTransaction
(
t
,
tree
);
}
else
if
(
m_serverConfigManager
.
isRpcServer
(
type
))
{
return
parsePigeonServerTransaction
(
t
,
tree
);
}
return
null
;
}
private
CrossInfo
parsePigeonClientTransaction
(
Transaction
t
,
MessageTree
tree
)
{
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/matrix/MatrixAnalyzer.java
浏览文件 @
adce6854
...
...
@@ -61,9 +61,6 @@ public class MatrixAnalyzer extends AbstractMessageAnalyzer<MatrixReport> implem
if
(
message
instanceof
Transaction
)
{
String
messageType
=
message
.
getType
();
if
(
m_serverConfigManager
.
discardTransaction
((
Transaction
)
message
))
{
return
;
}
if
(
messageType
.
equals
(
"URL"
)
||
messageType
.
equals
(
"Service"
)
||
messageType
.
equals
(
"PigeonService"
))
{
Matrix
matrix
=
report
.
findOrCreateMatrix
(
message
.
getName
());
matrix
.
setType
(
message
.
getType
());
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/problem/DefaultProblemHandler.java
浏览文件 @
adce6854
...
...
@@ -25,9 +25,6 @@ public class DefaultProblemHandler extends ProblemHandler {
@Inject
private
Set
<
String
>
m_errorTypes
;
@Inject
private
Set
<
String
>
m_failureTypes
;
@Override
public
void
handle
(
Machine
machine
,
MessageTree
tree
)
{
Message
message
=
tree
.
getMessage
();
...
...
@@ -68,16 +65,8 @@ public class DefaultProblemHandler extends ProblemHandler {
if
(!
transactionStatus
.
equals
(
Transaction
.
SUCCESS
))
{
String
type
=
transaction
.
getType
();
String
name
=
transaction
.
getName
();
String
status
=
""
;
if
(
m_failureTypes
.
contains
(
type
))
{
status
=
name
;
}
else
{
status
=
type
+
":"
+
name
;
type
=
ProblemType
.
FAILURE
.
getName
();
}
Entity
entity
=
findOrCreateEntity
(
machine
,
type
,
status
);
Entity
entity
=
findOrCreateEntity
(
machine
,
type
,
name
);
updateEntity
(
tree
,
entity
,
0
);
}
...
...
@@ -98,7 +87,4 @@ public class DefaultProblemHandler extends ProblemHandler {
m_errorTypes
=
new
HashSet
<
String
>(
Splitters
.
by
(
','
).
noEmptyItem
().
split
(
type
));
}
public
void
setFailureType
(
String
type
)
{
m_failureTypes
=
new
HashSet
<
String
>(
Splitters
.
by
(
','
).
noEmptyItem
().
split
(
type
));
}
}
\ No newline at end of file
cat-consumer/src/main/java/com/dianping/cat/consumer/problem/LongExecutionProblemHandler.java
浏览文件 @
adce6854
...
...
@@ -173,7 +173,7 @@ public class LongExecutionProblemHandler extends ProblemHandler implements Initi
processLongSql
(
machine
,
transaction
,
tree
);
}
else
if
(
m_configManager
.
isRpcClient
(
type
))
{
processLongCall
(
machine
,
transaction
,
tree
);
}
else
if
(
"Service"
.
equals
(
type
)
||
"PigeonService"
.
equals
(
type
))
{
}
else
if
(
m_configManager
.
isRpcServer
(
type
))
{
processLongService
(
machine
,
transaction
,
tree
);
}
else
if
(
"URL"
.
equals
(
type
))
{
processLongUrl
(
machine
,
transaction
,
tree
);
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/storage/StorageAnalyzer.java
浏览文件 @
adce6854
...
...
@@ -141,17 +141,14 @@ public class StorageAnalyzer extends AbstractMessageAnalyzer<StorageReport> impl
}
private
void
processTransaction
(
MessageTree
tree
,
Transaction
t
)
{
if
(
m_serverConfigManager
.
discardTransaction
(
t
))
{
return
;
}
else
{
String
type
=
t
.
getType
();
String
type
=
t
.
getType
();
if
(
m_serverConfigManager
.
isSQLTransaction
(
type
))
{
processSQLTransaction
(
tree
,
t
);
}
else
if
(
m_serverConfigManager
.
isCacheTransaction
(
type
))
{
processCacheTransaction
(
tree
,
t
);
}
if
(
m_serverConfigManager
.
isSQLTransaction
(
type
))
{
processSQLTransaction
(
tree
,
t
);
}
else
if
(
m_serverConfigManager
.
isCacheTransaction
(
type
))
{
processCacheTransaction
(
tree
,
t
);
}
List
<
Message
>
children
=
t
.
getChildren
();
for
(
Message
child
:
children
)
{
...
...
cat-consumer/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
adce6854
...
...
@@ -126,7 +126,6 @@
<role-hint>
default-problem
</role-hint>
<implementation>
com.dianping.cat.consumer.problem.DefaultProblemHandler
</implementation>
<configuration>
<failureType>
URL,SQL,Call,PigeonCall,Cache
</failureType>
<errorType>
Error,RuntimeException,Exception
</errorType>
</configuration>
<requirements>
...
...
cat-core/src/main/java/com/dianping/cat/configuration/ServerConfigManager.java
浏览文件 @
adce6854
...
...
@@ -29,7 +29,6 @@ import com.dianping.cat.configuration.server.entity.Property;
import
com.dianping.cat.configuration.server.entity.ServerConfig
;
import
com.dianping.cat.configuration.server.entity.StorageConfig
;
import
com.dianping.cat.configuration.server.transform.DefaultSaxParser
;
import
com.dianping.cat.message.Transaction
;
public
class
ServerConfigManager
implements
Initializable
,
LogEnabled
{
private
static
final
long
DEFAULT_HDFS_FILE_MAX_SIZE
=
128
*
1024
*
1024L
;
// 128M
...
...
@@ -48,16 +47,6 @@ public class ServerConfigManager implements Initializable, LogEnabled {
public
static
final
String
DUMP_DIR
=
"dump"
;
public
boolean
discardTransaction
(
Transaction
t
)
{
String
type
=
t
.
getType
();
String
name
=
t
.
getName
();
if
(
m_unusedTypes
.
contains
(
type
)
&&
m_unusedNames
.
contains
(
name
))
{
return
true
;
}
return
false
;
}
public
boolean
discardTransaction
(
String
type
,
String
name
){
if
(
m_unusedTypes
.
contains
(
type
)
&&
m_unusedNames
.
contains
(
name
))
{
return
true
;
...
...
cat-core/src/test/java/com/dianping/cat/ServerConfigManagerTest.java
浏览文件 @
adce6854
...
...
@@ -8,8 +8,6 @@ import org.junit.Test;
import
org.unidal.lookup.ComponentTestCase
;
import
com.dianping.cat.configuration.ServerConfigManager
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.message.internal.DefaultTransaction
;
public
class
ServerConfigManagerTest
extends
ComponentTestCase
{
...
...
@@ -40,8 +38,7 @@ public class ServerConfigManagerTest extends ComponentTestCase {
Assert
.
assertEquals
(
true
,
manager
.
isRpcServer
(
"PigeonService"
));
Assert
.
assertEquals
(
false
,
manager
.
validateDomain
(
"All"
));
Transaction
t
=
new
DefaultTransaction
(
"Service"
,
"piegonService:heartTaskService:heartBeat"
,
null
);
Assert
.
assertEquals
(
true
,
manager
.
discardTransaction
(
t
));
Assert
.
assertEquals
(
true
,
manager
.
discardTransaction
(
"Service"
,
"piegonService:heartTaskService:heartBeat"
));
manager
.
initialize
(
null
);
...
...
cat-home/src/main/java/com/dianping/cat/report/page/state/Payload.java
浏览文件 @
adce6854
...
...
@@ -20,7 +20,7 @@ public class Payload extends AbstractReportPayload<Action> {
private
String
m_sort
;
@FieldMeta
(
"show"
)
private
boolean
m_show
=
fals
e
;
private
boolean
m_show
=
tru
e
;
public
Payload
()
{
super
(
ReportPage
.
STATE
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录