Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
3f3d94cb
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,发现更多精彩内容 >>
提交
3f3d94cb
编写于
11月 11, 2014
作者:
Y
youyong205
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the server config manager
上级
2ea4d385
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
9 deletion
+27
-9
cat-consumer/src/main/java/com/dianping/cat/consumer/build/ComponentsConfigurator.java
...m/dianping/cat/consumer/build/ComponentsConfigurator.java
+1
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventDelegate.java
...n/java/com/dianping/cat/consumer/event/EventDelegate.java
+11
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/top/TopAnalyzer.java
.../main/java/com/dianping/cat/consumer/top/TopAnalyzer.java
+2
-2
cat-consumer/src/main/resources/META-INF/plexus/components.xml
...onsumer/src/main/resources/META-INF/plexus/components.xml
+3
-0
cat-core/src/main/java/com/dianping/cat/ServerConfigManager.java
...e/src/main/java/com/dianping/cat/ServerConfigManager.java
+10
-5
未找到文件。
cat-consumer/src/main/java/com/dianping/cat/consumer/build/ComponentsConfigurator.java
浏览文件 @
3f3d94cb
...
@@ -86,7 +86,7 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
...
@@ -86,7 +86,7 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
.
req
(
ReportDelegate
.
class
,
ID
)
//
.
req
(
ReportDelegate
.
class
,
ID
)
//
.
req
(
BucketManager
.
class
,
HourlyReportDao
.
class
,
HourlyReportContentDao
.
class
)
//
.
req
(
BucketManager
.
class
,
HourlyReportDao
.
class
,
HourlyReportContentDao
.
class
)
//
.
config
(
E
(
"name"
).
value
(
ID
)));
.
config
(
E
(
"name"
).
value
(
ID
)));
all
.
add
(
C
(
ReportDelegate
.
class
,
ID
,
EventDelegate
.
class
).
req
(
TaskManager
.
class
));
all
.
add
(
C
(
ReportDelegate
.
class
,
ID
,
EventDelegate
.
class
).
req
(
TaskManager
.
class
,
ServerConfigManager
.
class
));
return
all
;
return
all
;
}
}
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/event/EventDelegate.java
浏览文件 @
3f3d94cb
...
@@ -6,6 +6,7 @@ import java.util.Set;
...
@@ -6,6 +6,7 @@ import java.util.Set;
import
org.unidal.lookup.annotation.Inject
;
import
org.unidal.lookup.annotation.Inject
;
import
com.dianping.cat.ServerConfigManager
;
import
com.dianping.cat.consumer.event.model.entity.EventReport
;
import
com.dianping.cat.consumer.event.model.entity.EventReport
;
import
com.dianping.cat.consumer.event.model.transform.DefaultNativeBuilder
;
import
com.dianping.cat.consumer.event.model.transform.DefaultNativeBuilder
;
import
com.dianping.cat.consumer.event.model.transform.DefaultNativeParser
;
import
com.dianping.cat.consumer.event.model.transform.DefaultNativeParser
;
...
@@ -19,6 +20,9 @@ public class EventDelegate implements ReportDelegate<EventReport> {
...
@@ -19,6 +20,9 @@ public class EventDelegate implements ReportDelegate<EventReport> {
@Inject
@Inject
private
TaskManager
m_taskManager
;
private
TaskManager
m_taskManager
;
@Inject
private
ServerConfigManager
m_manager
;
@Override
@Override
public
void
afterLoad
(
Map
<
String
,
EventReport
>
reports
)
{
public
void
afterLoad
(
Map
<
String
,
EventReport
>
reports
)
{
}
}
...
@@ -47,7 +51,13 @@ public class EventDelegate implements ReportDelegate<EventReport> {
...
@@ -47,7 +51,13 @@ public class EventDelegate implements ReportDelegate<EventReport> {
@Override
@Override
public
boolean
createHourlyTask
(
EventReport
report
)
{
public
boolean
createHourlyTask
(
EventReport
report
)
{
return
m_taskManager
.
createTask
(
report
.
getStartTime
(),
report
.
getDomain
(),
EventAnalyzer
.
ID
,
TaskProlicy
.
ALL
);
String
domain
=
report
.
getDomain
();
if
(
m_manager
.
validateDomain
(
domain
))
{
return
m_taskManager
.
createTask
(
report
.
getStartTime
(),
report
.
getDomain
(),
EventAnalyzer
.
ID
,
TaskProlicy
.
ALL
);
}
else
{
return
true
;
}
}
}
@Override
@Override
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/top/TopAnalyzer.java
浏览文件 @
3f3d94cb
...
@@ -72,7 +72,7 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
...
@@ -72,7 +72,7 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
for
(
String
name
:
domains
)
{
for
(
String
name
:
domains
)
{
try
{
try
{
if
(
m_serverConfigManager
.
filterDomain
(
name
)
&&
!
name
.
equals
(
Constants
.
ALL
))
{
if
(
m_serverConfigManager
.
validateDomain
(
name
)
||
Constants
.
FRONT_END
.
equals
(
domain
))
{
TransactionReport
report
=
m_transactionAnalyzer
.
getRawReport
(
name
);
TransactionReport
report
=
m_transactionAnalyzer
.
getRawReport
(
name
);
transactionReportVisitor
.
visitTransactionReport
(
report
);
transactionReportVisitor
.
visitTransactionReport
(
report
);
...
@@ -94,7 +94,7 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
...
@@ -94,7 +94,7 @@ public class TopAnalyzer extends AbstractMessageAnalyzer<TopReport> implements L
for
(
String
name
:
domains
)
{
for
(
String
name
:
domains
)
{
try
{
try
{
if
(
m_serverConfigManager
.
filterDomain
(
name
)
&&
!
name
.
equals
(
Constants
.
ALL
))
{
if
(
m_serverConfigManager
.
validateDomain
(
name
)
||
Constants
.
FRONT_END
.
equals
(
domain
))
{
ProblemReport
report
=
m_problemAnalyzer
.
getReport
(
name
);
ProblemReport
report
=
m_problemAnalyzer
.
getReport
(
name
);
problemReportVisitor
.
visitProblemReport
(
report
);
problemReportVisitor
.
visitProblemReport
(
report
);
...
...
cat-consumer/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
3f3d94cb
...
@@ -110,6 +110,9 @@
...
@@ -110,6 +110,9 @@
<requirement>
<requirement>
<role>
com.dianping.cat.task.TaskManager
</role>
<role>
com.dianping.cat.task.TaskManager
</role>
</requirement>
</requirement>
<requirement>
<role>
com.dianping.cat.ServerConfigManager
</role>
</requirement>
</requirements>
</requirements>
</component>
</component>
<component>
<component>
...
...
cat-core/src/main/java/com/dianping/cat/ServerConfigManager.java
浏览文件 @
3f3d94cb
...
@@ -39,6 +39,8 @@ public class ServerConfigManager implements Initializable, LogEnabled {
...
@@ -39,6 +39,8 @@ public class ServerConfigManager implements Initializable, LogEnabled {
private
Set
<
String
>
m_unusedNames
=
new
HashSet
<
String
>();
private
Set
<
String
>
m_unusedNames
=
new
HashSet
<
String
>();
private
Set
<
String
>
m_invalidateDomains
=
new
HashSet
<
String
>();
public
boolean
discardTransaction
(
Transaction
t
)
{
public
boolean
discardTransaction
(
Transaction
t
)
{
// pigeon default heartbeat is no use
// pigeon default heartbeat is no use
String
type
=
t
.
getType
();
String
type
=
t
.
getType
();
...
@@ -249,6 +251,13 @@ public class ServerConfigManager implements Initializable, LogEnabled {
...
@@ -249,6 +251,13 @@ public class ServerConfigManager implements Initializable, LogEnabled {
m_unusedNames
.
add
(
"/inspect/healthcheck"
);
m_unusedNames
.
add
(
"/inspect/healthcheck"
);
m_unusedNames
.
add
(
"/MonitorServlet"
);
m_unusedNames
.
add
(
"/MonitorServlet"
);
m_unusedNames
.
add
(
"/monitorServlet?client=f5"
);
m_unusedNames
.
add
(
"/monitorServlet?client=f5"
);
m_invalidateDomains
.
add
(
"PhoenixAgent"
);
m_invalidateDomains
.
add
(
"cat-agent"
);
m_invalidateDomains
.
add
(
"AndroidCrashLog"
);
m_invalidateDomains
.
add
(
"iOSCrashLog"
);
m_invalidateDomains
.
add
(
Constants
.
ALL
);
m_invalidateDomains
.
add
(
Constants
.
FRONT_END
);
}
}
public
void
initialize
(
File
configFile
)
throws
Exception
{
public
void
initialize
(
File
configFile
)
throws
Exception
{
...
@@ -349,12 +358,8 @@ public class ServerConfigManager implements Initializable, LogEnabled {
...
@@ -349,12 +358,8 @@ public class ServerConfigManager implements Initializable, LogEnabled {
}
}
}
}
public
boolean
filterDomain
(
String
domain
)
{
return
!
domain
.
equals
(
"PhoenixAgent"
)
&&
!
domain
.
equals
(
"cat-agent"
)
&&
!
domain
.
equals
(
Constants
.
ALL
);
}
public
boolean
validateDomain
(
String
domain
)
{
public
boolean
validateDomain
(
String
domain
)
{
return
!
domain
.
equals
(
Constants
.
FRONT_END
)
&&
filterDomain
(
domain
);
return
!
m_invalidateDomains
.
contains
(
domain
);
}
}
public
boolean
isOffline
()
{
public
boolean
isOffline
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录