Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
2d65df5e
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,发现更多精彩内容 >>
提交
2d65df5e
编写于
7月 29, 2014
作者:
Y
youyong205
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #424 from youyong205/master
refactor alert module
上级
cb81ef0f
be92d5e6
变更
34
隐藏空白更改
内联
并排
Showing
34 changed file
with
80 addition
and
126 deletion
+80
-126
.gitignore
.gitignore
+0
-1
cat-client/src/main/java/com/dianping/cat/CatClientModule.java
...lient/src/main/java/com/dianping/cat/CatClientModule.java
+0
-3
cat-consumer-advanced/src/test/java/com/dianping/cat/consumer/AllTests.java
...ced/src/test/java/com/dianping/cat/consumer/AllTests.java
+0
-1
cat-home/src/main/java/com/dianping/cat/build/ComponentsConfigurator.java
...n/java/com/dianping/cat/build/ComponentsConfigurator.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/AlertConstants.java
...va/com/dianping/cat/report/task/alert/AlertConstants.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/BaseAlert.java
...in/java/com/dianping/cat/report/task/alert/BaseAlert.java
+4
-14
cat-home/src/main/java/com/dianping/cat/report/task/alert/business/BusinessAlert.java
...ianping/cat/report/task/alert/business/BusinessAlert.java
+6
-10
cat-home/src/main/java/com/dianping/cat/report/task/alert/exception/ExceptionAlert.java
...nping/cat/report/task/alert/exception/ExceptionAlert.java
+6
-8
cat-home/src/main/java/com/dianping/cat/report/task/alert/network/NetworkAlert.java
.../dianping/cat/report/task/alert/network/NetworkAlert.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/AlertChannel.java
...m/dianping/cat/report/task/alert/sender/AlertChannel.java
+2
-0
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/AlertEntity.java
...om/dianping/cat/report/task/alert/sender/AlertEntity.java
+14
-45
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/AlertManager.java
...m/dianping/cat/report/task/alert/sender/AlertManager.java
+4
-4
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/BusinessDecorator.java
...report/task/alert/sender/decorator/BusinessDecorator.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/DecoratorManager.java
.../report/task/alert/sender/decorator/DecoratorManager.java
+10
-4
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/ExceptionDecorator.java
...eport/task/alert/sender/decorator/ExceptionDecorator.java
+2
-2
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/NetworkDecorator.java
.../report/task/alert/sender/decorator/NetworkDecorator.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/SystemDecorator.java
...t/report/task/alert/sender/decorator/SystemDecorator.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/ThirdpartyDecorator.java
...port/task/alert/sender/decorator/ThirdpartyDecorator.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/BusinessContactor.java
.../report/task/alert/sender/receiver/BusinessContactor.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/ContactorManager.java
...t/report/task/alert/sender/receiver/ContactorManager.java
+3
-3
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/ExceptionContactor.java
...report/task/alert/sender/receiver/ExceptionContactor.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/NetworkContactor.java
...t/report/task/alert/sender/receiver/NetworkContactor.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/SystemContactor.java
...at/report/task/alert/sender/receiver/SystemContactor.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/ThirdpartyContactor.java
...eport/task/alert/sender/receiver/ThirdpartyContactor.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/sender/MailSender.java
...nping/cat/report/task/alert/sender/sender/MailSender.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/sender/SmsSender.java
...anping/cat/report/task/alert/sender/sender/SmsSender.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/sender/WeixinSender.java
...ing/cat/report/task/alert/sender/sender/WeixinSender.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/spliter/MailSpliter.java
...ing/cat/report/task/alert/sender/spliter/MailSpliter.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/spliter/SmsSpliter.java
...ping/cat/report/task/alert/sender/spliter/SmsSpliter.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/spliter/WeixinSpliter.java
...g/cat/report/task/alert/sender/spliter/WeixinSpliter.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/service/AlertEntityService.java
...ing/cat/report/task/alert/service/AlertEntityService.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/system/SystemAlert.java
...om/dianping/cat/report/task/alert/system/SystemAlert.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/thirdParty/ThirdPartyAlert.java
...ing/cat/report/task/alert/thirdParty/ThirdPartyAlert.java
+6
-8
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+3
-3
未找到文件。
.gitignore
浏览文件 @
2d65df5e
...
@@ -12,4 +12,3 @@ cat-client/src/main/resources/com/dianping/cat/configuration/client/config.xsd
...
@@ -12,4 +12,3 @@ cat-client/src/main/resources/com/dianping/cat/configuration/client/config.xsd
cat-client/src/main/resources/com/dianping/cat/status/model/status.xsd
cat-client/src/main/resources/com/dianping/cat/status/model/status.xsd
cat-client/src/test/java/com/dianping/cat/message/io/ChannelManagerTest.java
cat-client/src/main/java/com/dianping/cat/CatClientModule.java
浏览文件 @
2d65df5e
...
@@ -14,7 +14,6 @@ import org.unidal.initialization.Module;
...
@@ -14,7 +14,6 @@ import org.unidal.initialization.Module;
import
org.unidal.initialization.ModuleContext
;
import
org.unidal.initialization.ModuleContext
;
import
com.dianping.cat.configuration.ClientConfigManager
;
import
com.dianping.cat.configuration.ClientConfigManager
;
import
com.dianping.cat.configuration.client.entity.ClientConfig
;
import
com.dianping.cat.message.internal.MilliSecondTimer
;
import
com.dianping.cat.message.internal.MilliSecondTimer
;
import
com.dianping.cat.message.io.TransportManager
;
import
com.dianping.cat.message.io.TransportManager
;
import
com.dianping.cat.status.StatusUpdateTask
;
import
com.dianping.cat.status.StatusUpdateTask
;
...
@@ -53,8 +52,6 @@ public class CatClientModule extends AbstractModule {
...
@@ -53,8 +52,6 @@ public class CatClientModule extends AbstractModule {
Threads
.
forGroup
(
"Cat"
).
start
(
statusUpdateTask
);
Threads
.
forGroup
(
"Cat"
).
start
(
statusUpdateTask
);
LockSupport
.
parkNanos
(
10
*
1000
*
1000L
);
// wait 10 ms
LockSupport
.
parkNanos
(
10
*
1000
*
1000L
);
// wait 10 ms
ClientConfig
config
=
clientConfigManager
.
getClientConfig
();
// MmapConsumerTask mmapReaderTask = ctx.lookup(MmapConsumerTask.class);
// MmapConsumerTask mmapReaderTask = ctx.lookup(MmapConsumerTask.class);
// Threads.forGroup("Cat").start(mmapReaderTask);
// Threads.forGroup("Cat").start(mmapReaderTask);
}
}
...
...
cat-consumer-advanced/src/test/java/com/dianping/cat/consumer/AllTests.java
浏览文件 @
2d65df5e
...
@@ -13,7 +13,6 @@ import com.dianping.cat.consumer.matrix.MatrixAnalyzerTest;
...
@@ -13,7 +13,6 @@ import com.dianping.cat.consumer.matrix.MatrixAnalyzerTest;
import
com.dianping.cat.consumer.matrix.MatrixModelTest
;
import
com.dianping.cat.consumer.matrix.MatrixModelTest
;
import
com.dianping.cat.consumer.matrix.MatrixReportMergerTest
;
import
com.dianping.cat.consumer.matrix.MatrixReportMergerTest
;
import
com.dianping.cat.consumer.metric.MetricAnalyzerTest
;
import
com.dianping.cat.consumer.metric.MetricAnalyzerTest
;
import
com.dianping.cat.consumer.metric.MetricConfigManagerTest
;
import
com.dianping.cat.consumer.metric.ProductLineConfigManagerTest
;
import
com.dianping.cat.consumer.metric.ProductLineConfigManagerTest
;
@RunWith
(
Suite
.
class
)
@RunWith
(
Suite
.
class
)
...
...
cat-home/src/main/java/com/dianping/cat/build/ComponentsConfigurator.java
浏览文件 @
2d65df5e
...
@@ -64,7 +64,6 @@ import com.dianping.cat.report.task.alert.RemoteMetricReportService;
...
@@ -64,7 +64,6 @@ import com.dianping.cat.report.task.alert.RemoteMetricReportService;
import
com.dianping.cat.report.task.alert.business.BusinessAlert
;
import
com.dianping.cat.report.task.alert.business.BusinessAlert
;
import
com.dianping.cat.report.task.alert.exception.AlertExceptionBuilder
;
import
com.dianping.cat.report.task.alert.exception.AlertExceptionBuilder
;
import
com.dianping.cat.report.task.alert.exception.ExceptionAlert
;
import
com.dianping.cat.report.task.alert.exception.ExceptionAlert
;
import
com.dianping.cat.report.task.alert.manager.AlertEntityService
;
import
com.dianping.cat.report.task.alert.network.NetworkAlert
;
import
com.dianping.cat.report.task.alert.network.NetworkAlert
;
import
com.dianping.cat.report.task.alert.sender.AlertManager
;
import
com.dianping.cat.report.task.alert.sender.AlertManager
;
import
com.dianping.cat.report.task.alert.sender.decorator.BusinessDecorator
;
import
com.dianping.cat.report.task.alert.sender.decorator.BusinessDecorator
;
...
@@ -91,6 +90,7 @@ import com.dianping.cat.report.task.alert.sender.spliter.SmsSpliter;
...
@@ -91,6 +90,7 @@ import com.dianping.cat.report.task.alert.sender.spliter.SmsSpliter;
import
com.dianping.cat.report.task.alert.sender.spliter.Spliter
;
import
com.dianping.cat.report.task.alert.sender.spliter.Spliter
;
import
com.dianping.cat.report.task.alert.sender.spliter.SpliterManager
;
import
com.dianping.cat.report.task.alert.sender.spliter.SpliterManager
;
import
com.dianping.cat.report.task.alert.sender.spliter.WeixinSpliter
;
import
com.dianping.cat.report.task.alert.sender.spliter.WeixinSpliter
;
import
com.dianping.cat.report.task.alert.service.AlertEntityService
;
import
com.dianping.cat.report.task.alert.summary.AlertSummaryDecorator
;
import
com.dianping.cat.report.task.alert.summary.AlertSummaryDecorator
;
import
com.dianping.cat.report.task.alert.summary.AlertSummaryExecutor
;
import
com.dianping.cat.report.task.alert.summary.AlertSummaryExecutor
;
import
com.dianping.cat.report.task.alert.summary.AlertSummaryFTLDecorator
;
import
com.dianping.cat.report.task.alert.summary.AlertSummaryFTLDecorator
;
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/
sender/
AlertConstants.java
→
cat-home/src/main/java/com/dianping/cat/report/task/alert/AlertConstants.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert
.sender
;
package
com.dianping.cat.report.task.alert
;
public
class
AlertConstants
{
public
class
AlertConstants
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/BaseAlert.java
浏览文件 @
2d65df5e
...
@@ -25,7 +25,6 @@ import com.dianping.cat.home.rule.entity.Condition;
...
@@ -25,7 +25,6 @@ import com.dianping.cat.home.rule.entity.Condition;
import
com.dianping.cat.home.rule.entity.Config
;
import
com.dianping.cat.home.rule.entity.Config
;
import
com.dianping.cat.report.baseline.BaselineService
;
import
com.dianping.cat.report.baseline.BaselineService
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity.AlertEntityBuilder
;
import
com.dianping.cat.report.task.alert.sender.AlertManager
;
import
com.dianping.cat.report.task.alert.sender.AlertManager
;
import
com.dianping.cat.service.ModelPeriod
;
import
com.dianping.cat.service.ModelPeriod
;
import
com.dianping.cat.service.ModelRequest
;
import
com.dianping.cat.service.ModelRequest
;
...
@@ -233,21 +232,12 @@ public abstract class BaseAlert {
...
@@ -233,21 +232,12 @@ public abstract class BaseAlert {
m_alertInfo
.
addAlertInfo
(
productlineName
,
metricKey
,
new
Date
().
getTime
());
m_alertInfo
.
addAlertInfo
(
productlineName
,
metricKey
,
new
Date
().
getTime
());
String
metricName
=
buildMetricName
(
metricKey
);
String
metricName
=
buildMetricName
(
metricKey
);
AlertEntity
entity
=
new
AlertEntity
();
AlertEntityBuilder
builder
=
new
AlertEntity
().
new
AlertEntityBuilder
();
builder
.
buildDate
(
alertResult
.
getAlertTime
()).
buildContent
(
alertResult
.
getContent
())
.
buildLevel
(
alertResult
.
getAlertLevel
());
builder
.
buildMetric
(
metricName
).
buildType
(
getName
());
if
(
"network"
.
equals
(
getName
()))
{
entity
.
setDate
(
alertResult
.
getAlertTime
()).
setContent
(
alertResult
.
getContent
()).
setLevel
(
alertResult
.
getAlertLevel
());
builder
.
buildGroup
(
productlineName
);
entity
.
setMetric
(
metricName
).
setType
(
getName
()).
setGroup
(
productlineName
);
}
else
{
String
domain
=
extractDomain
(
metricKey
);
builder
.
buildGroup
(
domain
);
}
AlertEntity
alertEntity
=
builder
.
getAlertEntity
();
m_sendManager
.
addAlert
(
alertE
ntity
);
m_sendManager
.
addAlert
(
e
ntity
);
}
}
}
}
}
}
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/business/BusinessAlert.java
浏览文件 @
2d65df5e
...
@@ -15,12 +15,11 @@ import com.dianping.cat.advanced.metric.config.entity.MetricItemConfig;
...
@@ -15,12 +15,11 @@ import com.dianping.cat.advanced.metric.config.entity.MetricItemConfig;
import
com.dianping.cat.consumer.company.model.entity.ProductLine
;
import
com.dianping.cat.consumer.company.model.entity.ProductLine
;
import
com.dianping.cat.consumer.metric.MetricConfigManager
;
import
com.dianping.cat.consumer.metric.MetricConfigManager
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertResultEntity
;
import
com.dianping.cat.report.task.alert.AlertResultEntity
;
import
com.dianping.cat.report.task.alert.BaseAlert
;
import
com.dianping.cat.report.task.alert.BaseAlert
;
import
com.dianping.cat.report.task.alert.MetricType
;
import
com.dianping.cat.report.task.alert.MetricType
;
import
com.dianping.cat.report.task.alert.sender.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity.AlertEntityBuilder
;
public
class
BusinessAlert
extends
BaseAlert
implements
Task
,
LogEnabled
{
public
class
BusinessAlert
extends
BaseAlert
implements
Task
,
LogEnabled
{
...
@@ -70,15 +69,12 @@ public class BusinessAlert extends BaseAlert implements Task, LogEnabled {
...
@@ -70,15 +69,12 @@ public class BusinessAlert extends BaseAlert implements Task, LogEnabled {
m_alertInfo
.
addAlertInfo
(
product
,
metricKey
,
new
Date
().
getTime
());
m_alertInfo
.
addAlertInfo
(
product
,
metricKey
,
new
Date
().
getTime
());
String
metricName
=
buildMetricName
(
metricKey
);
String
metricName
=
buildMetricName
(
metricKey
);
AlertEntity
Builder
builder
=
new
AlertEntity
().
new
AlertEntityBuilder
();
AlertEntity
entity
=
new
AlertEntity
();
builder
.
buildDate
(
alertResult
.
getAlertTime
()).
buildContent
(
alertResult
.
getContent
())
.
build
Level
(
alertResult
.
getAlertLevel
());
entity
.
setDate
(
alertResult
.
getAlertTime
()).
setContent
(
alertResult
.
getContent
()).
set
Level
(
alertResult
.
getAlertLevel
());
builder
.
buildMetric
(
metricName
).
buildType
(
getName
()
);
entity
.
setMetric
(
metricName
).
setType
(
getName
()).
setGroup
(
product
);
builder
.
buildGroup
(
domain
);
m_sendManager
.
addAlert
(
entity
);
AlertEntity
alertEntity
=
builder
.
getAlertEntity
();
m_sendManager
.
addAlert
(
alertEntity
);
}
}
}
}
}
}
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/exception/ExceptionAlert.java
浏览文件 @
2d65df5e
...
@@ -20,10 +20,9 @@ import com.dianping.cat.message.Transaction;
...
@@ -20,10 +20,9 @@ import com.dianping.cat.message.Transaction;
import
com.dianping.cat.report.page.model.spi.ModelService
;
import
com.dianping.cat.report.page.model.spi.ModelService
;
import
com.dianping.cat.report.page.top.TopMetric
;
import
com.dianping.cat.report.page.top.TopMetric
;
import
com.dianping.cat.report.page.top.TopMetric.Item
;
import
com.dianping.cat.report.page.top.TopMetric.Item
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.exception.AlertExceptionBuilder.AlertException
;
import
com.dianping.cat.report.task.alert.exception.AlertExceptionBuilder.AlertException
;
import
com.dianping.cat.report.task.alert.sender.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity.AlertEntityBuilder
;
import
com.dianping.cat.report.task.alert.sender.AlertManager
;
import
com.dianping.cat.report.task.alert.sender.AlertManager
;
import
com.dianping.cat.service.ModelRequest
;
import
com.dianping.cat.service.ModelRequest
;
import
com.dianping.cat.service.ModelResponse
;
import
com.dianping.cat.service.ModelResponse
;
...
@@ -110,13 +109,12 @@ public class ExceptionAlert implements Task {
...
@@ -110,13 +109,12 @@ public class ExceptionAlert implements Task {
for
(
AlertException
exception
:
exceptions
)
{
for
(
AlertException
exception
:
exceptions
)
{
String
metricName
=
exception
.
getName
();
String
metricName
=
exception
.
getName
();
AlertEntity
entity
=
new
AlertEntity
();
entity
.
setDate
(
new
Date
()).
setContent
(
exception
.
toString
()).
setLevel
(
exception
.
getType
());
entity
.
setMetric
(
metricName
).
setType
(
getName
()).
setGroup
(
domain
);
AlertEntityBuilder
builder
=
new
AlertEntity
().
new
AlertEntityBuilder
();
m_sendManager
.
addAlert
(
entity
);
builder
.
buildDate
(
new
Date
()).
buildLevel
(
exception
.
getType
()).
buildContent
(
exception
.
toString
());
builder
.
buildMetric
(
metricName
).
buildType
(
getName
()).
buildGroup
(
domain
);
AlertEntity
alertEntity
=
builder
.
getAlertEntity
();
m_sendManager
.
addAlert
(
alertEntity
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
Cat
.
logError
(
e
);
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/network/NetworkAlert.java
浏览文件 @
2d65df5e
...
@@ -10,8 +10,8 @@ import org.unidal.helper.Threads.Task;
...
@@ -10,8 +10,8 @@ import org.unidal.helper.Threads.Task;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.consumer.company.model.entity.ProductLine
;
import
com.dianping.cat.consumer.company.model.entity.ProductLine
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.BaseAlert
;
import
com.dianping.cat.report.task.alert.BaseAlert
;
import
com.dianping.cat.report.task.alert.sender.AlertConstants
;
public
class
NetworkAlert
extends
BaseAlert
implements
Task
,
LogEnabled
{
public
class
NetworkAlert
extends
BaseAlert
implements
Task
,
LogEnabled
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/AlertChannel.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender
;
package
com.dianping.cat.report.task.alert.sender
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
public
enum
AlertChannel
{
public
enum
AlertChannel
{
MAIL
(
AlertConstants
.
MAIL
),
MAIL
(
AlertConstants
.
MAIL
),
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/AlertEntity.java
浏览文件 @
2d65df5e
...
@@ -48,71 +48,40 @@ public class AlertEntity {
...
@@ -48,71 +48,40 @@ public class AlertEntity {
return
m_type
;
return
m_type
;
}
}
public
void
setDate
(
Date
alertDate
)
{
public
AlertEntity
setDate
(
Date
alertDate
)
{
m_date
=
alertDate
;
m_date
=
alertDate
;
return
this
;
}
}
public
void
setContent
(
String
content
)
{
public
AlertEntity
setContent
(
String
content
)
{
m_content
=
content
;
m_content
=
content
;
return
this
;
}
}
public
void
setGroup
(
String
group
)
{
public
AlertEntity
setGroup
(
String
group
)
{
m_group
=
group
;
m_group
=
group
;
return
this
;
}
}
public
void
setLevel
(
String
level
)
{
public
AlertEntity
setLevel
(
String
level
)
{
m_level
=
level
;
m_level
=
level
;
return
this
;
}
}
public
void
setMetric
(
String
metricName
)
{
public
AlertEntity
setMetric
(
String
metricName
)
{
m_metric
=
metricName
;
m_metric
=
metricName
;
return
this
;
}
}
public
void
setParas
(
Map
<
String
,
Object
>
paras
)
{
public
AlertEntity
setParas
(
Map
<
String
,
Object
>
paras
)
{
m_paras
=
paras
;
m_paras
=
paras
;
return
this
;
}
}
public
void
setType
(
String
type
)
{
public
AlertEntity
setType
(
String
type
)
{
m_type
=
type
;
m_type
=
type
;
return
this
;
}
}
public
class
AlertEntityBuilder
{
private
AlertEntity
m_alertEntity
=
new
AlertEntity
();
public
AlertEntityBuilder
buildDate
(
Date
date
)
{
m_alertEntity
.
setDate
(
date
);
return
this
;
}
public
AlertEntityBuilder
buildType
(
String
type
)
{
m_alertEntity
.
setType
(
type
);
return
this
;
}
public
AlertEntityBuilder
buildGroup
(
String
group
)
{
m_alertEntity
.
setGroup
(
group
);
return
this
;
}
public
AlertEntityBuilder
buildLevel
(
String
level
)
{
m_alertEntity
.
setLevel
(
level
);
return
this
;
}
public
AlertEntityBuilder
buildMetric
(
String
metric
)
{
m_alertEntity
.
setMetric
(
metric
);
return
this
;
}
public
AlertEntityBuilder
buildContent
(
String
content
)
{
m_alertEntity
.
setContent
(
content
);
return
this
;
}
public
AlertEntity
getAlertEntity
(){
return
m_alertEntity
;
}
}
}
}
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/AlertManager.java
浏览文件 @
2d65df5e
...
@@ -13,11 +13,11 @@ import org.unidal.lookup.annotation.Inject;
...
@@ -13,11 +13,11 @@ import org.unidal.lookup.annotation.Inject;
import
org.unidal.tuple.Pair
;
import
org.unidal.tuple.Pair
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.report.task.alert.manager.AlertEntityService
;
import
com.dianping.cat.report.task.alert.sender.decorator.DecoratorManager
;
import
com.dianping.cat.report.task.alert.sender.decorator.DecoratorManager
;
import
com.dianping.cat.report.task.alert.sender.receiver.ContactorManager
;
import
com.dianping.cat.report.task.alert.sender.receiver.ContactorManager
;
import
com.dianping.cat.report.task.alert.sender.sender.SenderManager
;
import
com.dianping.cat.report.task.alert.sender.sender.SenderManager
;
import
com.dianping.cat.report.task.alert.sender.spliter.SpliterManager
;
import
com.dianping.cat.report.task.alert.sender.spliter.SpliterManager
;
import
com.dianping.cat.report.task.alert.service.AlertEntityService
;
import
com.dianping.cat.system.config.AlertPolicyManager
;
import
com.dianping.cat.system.config.AlertPolicyManager
;
public
class
AlertManager
implements
Initializable
{
public
class
AlertManager
implements
Initializable
{
...
@@ -31,14 +31,14 @@ public class AlertManager implements Initializable {
...
@@ -31,14 +31,14 @@ public class AlertManager implements Initializable {
@Inject
@Inject
private
ContactorManager
m_contactorManager
;
private
ContactorManager
m_contactorManager
;
@Inject
protected
AlertEntityService
m_alertEntityService
;
@Inject
@Inject
protected
SpliterManager
m_splitterManager
;
protected
SpliterManager
m_splitterManager
;
@Inject
@Inject
protected
SenderManager
m_senderManager
;
protected
SenderManager
m_senderManager
;
@Inject
protected
AlertEntityService
m_alertEntityService
;
private
BlockingQueue
<
AlertEntity
>
m_alerts
=
new
LinkedBlockingDeque
<
AlertEntity
>(
10000
);
private
BlockingQueue
<
AlertEntity
>
m_alerts
=
new
LinkedBlockingDeque
<
AlertEntity
>(
10000
);
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/BusinessDecorator.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.decorator
;
package
com.dianping.cat.report.task.alert.sender.decorator
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
public
class
BusinessDecorator
extends
DefaultDecorator
{
public
class
BusinessDecorator
extends
DefaultDecorator
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/DecoratorManager.java
浏览文件 @
2d65df5e
...
@@ -30,11 +30,17 @@ public class DecoratorManager implements Initializable {
...
@@ -30,11 +30,17 @@ public class DecoratorManager implements Initializable {
private
Map
<
String
,
Decorator
>
m_decorators
=
new
HashMap
<
String
,
Decorator
>();
private
Map
<
String
,
Decorator
>
m_decorators
=
new
HashMap
<
String
,
Decorator
>();
public
Pair
<
String
,
String
>
generateTitleAndContent
(
AlertEntity
alert
)
{
public
Pair
<
String
,
String
>
generateTitleAndContent
(
AlertEntity
alert
)
{
Decorator
decorator
=
m_decorators
.
get
(
alert
.
getType
());
String
alertType
=
alert
.
getType
();
String
title
=
decorator
.
generateTitle
(
alert
);
Decorator
decorator
=
m_decorators
.
get
(
alertType
);
String
content
=
decorator
.
generateContent
(
alert
);
return
new
Pair
<
String
,
String
>(
title
,
content
);
if
(
decorator
!=
null
)
{
String
title
=
decorator
.
generateTitle
(
alert
);
String
content
=
decorator
.
generateContent
(
alert
);
return
new
Pair
<
String
,
String
>(
title
,
content
);
}
else
{
throw
new
RuntimeException
(
"error alert type:"
+
alert
.
getType
());
}
}
}
@Override
@Override
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/ExceptionDecorator.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.decorator
;
package
com.dianping.cat.report.task.alert.sender.decorator
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
public
class
ExceptionDecorator
extends
DefaultDecorator
{
public
class
ExceptionDecorator
extends
DefaultDecorator
{
...
@@ -30,7 +30,7 @@ public class ExceptionDecorator extends DefaultDecorator {
...
@@ -30,7 +30,7 @@ public class ExceptionDecorator extends DefaultDecorator {
sb
.
append
(
"[CAT异常告警] [项目: "
).
append
(
domain
).
append
(
"] : "
);
sb
.
append
(
"[CAT异常告警] [项目: "
).
append
(
domain
).
append
(
"] : "
);
sb
.
append
(
alert
.
getContent
()).
append
(
"[时间: "
).
append
(
date
).
append
(
"]"
);
sb
.
append
(
alert
.
getContent
()).
append
(
"[时间: "
).
append
(
date
).
append
(
"]"
);
sb
.
append
(
" <a href='"
).
append
(
"http://cat.dianpingoa.com/cat/r/p?domain="
).
append
(
domain
).
append
(
"&date="
)
sb
.
append
(
" <a href='"
).
append
(
"http://cat.dianpingoa.com/cat/r/p?domain="
).
append
(
domain
).
append
(
"&date="
)
.
append
(
date
).
append
(
"'>点击此处查看详情</a>"
).
append
(
"<br/>"
);
.
append
(
date
).
append
(
"'>点击此处查看详情
[联系人修改请联系黄永,修改CMDB]
</a>"
).
append
(
"<br/>"
);
sb
.
append
(
buildContactInfo
(
domain
));
sb
.
append
(
buildContactInfo
(
domain
));
return
sb
.
toString
();
return
sb
.
toString
();
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/NetworkDecorator.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.decorator
;
package
com.dianping.cat.report.task.alert.sender.decorator
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
public
class
NetworkDecorator
extends
DefaultDecorator
{
public
class
NetworkDecorator
extends
DefaultDecorator
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/SystemDecorator.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.decorator
;
package
com.dianping.cat.report.task.alert.sender.decorator
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
public
class
SystemDecorator
extends
DefaultDecorator
{
public
class
SystemDecorator
extends
DefaultDecorator
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/decorator/ThirdpartyDecorator.java
浏览文件 @
2d65df5e
...
@@ -3,7 +3,7 @@ package com.dianping.cat.report.task.alert.sender.decorator;
...
@@ -3,7 +3,7 @@ package com.dianping.cat.report.task.alert.sender.decorator;
import
java.util.Date
;
import
java.util.Date
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
public
class
ThirdpartyDecorator
extends
DefaultDecorator
{
public
class
ThirdpartyDecorator
extends
DefaultDecorator
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/BusinessContactor.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.receiver
;
package
com.dianping.cat.report.task.alert.sender.receiver
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
public
class
BusinessContactor
extends
ProductlineContactor
{
public
class
BusinessContactor
extends
ProductlineContactor
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/ContactorManager.java
浏览文件 @
2d65df5e
...
@@ -9,7 +9,7 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
...
@@ -9,7 +9,7 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
;
import
org.unidal.lookup.annotation.Inject
;
import
org.unidal.lookup.annotation.Inject
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
public
class
ContactorManager
implements
Initializable
{
public
class
ContactorManager
implements
Initializable
{
...
@@ -40,9 +40,9 @@ public class ContactorManager implements Initializable {
...
@@ -40,9 +40,9 @@ public class ContactorManager implements Initializable {
return
contactor
.
querySmsContactors
();
return
contactor
.
querySmsContactors
();
}
else
if
(
AlertConstants
.
WEIXIN
.
equals
(
channel
))
{
}
else
if
(
AlertConstants
.
WEIXIN
.
equals
(
channel
))
{
return
contactor
.
queryWeiXinContactors
();
return
contactor
.
queryWeiXinContactors
();
}
else
{
return
new
ArrayList
<
String
>();
}
}
return
new
ArrayList
<
String
>();
}
}
@Override
@Override
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/ExceptionContactor.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.receiver
;
package
com.dianping.cat.report.task.alert.sender.receiver
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
public
class
ExceptionContactor
extends
ProjectContactor
{
public
class
ExceptionContactor
extends
ProjectContactor
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/NetworkContactor.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.receiver
;
package
com.dianping.cat.report.task.alert.sender.receiver
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
public
class
NetworkContactor
extends
ProductlineContactor
{
public
class
NetworkContactor
extends
ProductlineContactor
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/SystemContactor.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.receiver
;
package
com.dianping.cat.report.task.alert.sender.receiver
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
public
class
SystemContactor
extends
ProductlineContactor
{
public
class
SystemContactor
extends
ProductlineContactor
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/receiver/ThirdpartyContactor.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.receiver
;
package
com.dianping.cat.report.task.alert.sender.receiver
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
public
class
ThirdpartyContactor
extends
ProjectContactor
{
public
class
ThirdpartyContactor
extends
ProjectContactor
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/sender/MailSender.java
浏览文件 @
2d65df5e
...
@@ -21,7 +21,7 @@ import org.unidal.lookup.annotation.Inject;
...
@@ -21,7 +21,7 @@ import org.unidal.lookup.annotation.Inject;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.ServerConfigManager
;
import
com.dianping.cat.ServerConfigManager
;
import
com.dianping.cat.message.Event
;
import
com.dianping.cat.message.Event
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertMessageEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertMessageEntity
;
public
class
MailSender
implements
Initializable
,
Sender
,
LogEnabled
{
public
class
MailSender
implements
Initializable
,
Sender
,
LogEnabled
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/sender/SmsSender.java
浏览文件 @
2d65df5e
...
@@ -13,7 +13,7 @@ import org.unidal.helper.Files;
...
@@ -13,7 +13,7 @@ import org.unidal.helper.Files;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.message.Event
;
import
com.dianping.cat.message.Event
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertMessageEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertMessageEntity
;
public
class
SmsSender
implements
Sender
,
LogEnabled
{
public
class
SmsSender
implements
Sender
,
LogEnabled
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/sender/WeixinSender.java
浏览文件 @
2d65df5e
...
@@ -13,7 +13,7 @@ import org.codehaus.plexus.logging.Logger;
...
@@ -13,7 +13,7 @@ import org.codehaus.plexus.logging.Logger;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.message.Event
;
import
com.dianping.cat.message.Event
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertMessageEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertMessageEntity
;
public
class
WeixinSender
implements
Sender
,
LogEnabled
{
public
class
WeixinSender
implements
Sender
,
LogEnabled
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/spliter/MailSpliter.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.spliter
;
package
com.dianping.cat.report.task.alert.sender.spliter
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
public
class
MailSpliter
implements
Spliter
{
public
class
MailSpliter
implements
Spliter
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/spliter/SmsSpliter.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.spliter
;
package
com.dianping.cat.report.task.alert.sender.spliter
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
public
class
SmsSpliter
implements
Spliter
{
public
class
SmsSpliter
implements
Spliter
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/sender/spliter/WeixinSpliter.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.sender.spliter
;
package
com.dianping.cat.report.task.alert.sender.spliter
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
public
class
WeixinSpliter
implements
Spliter
{
public
class
WeixinSpliter
implements
Spliter
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/
manager
/AlertEntityService.java
→
cat-home/src/main/java/com/dianping/cat/report/task/alert/
service
/AlertEntityService.java
浏览文件 @
2d65df5e
package
com.dianping.cat.report.task.alert.
manager
;
package
com.dianping.cat.report.task.alert.
service
;
import
org.unidal.dal.jdbc.DalException
;
import
org.unidal.dal.jdbc.DalException
;
import
org.unidal.lookup.annotation.Inject
;
import
org.unidal.lookup.annotation.Inject
;
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/system/SystemAlert.java
浏览文件 @
2d65df5e
...
@@ -10,8 +10,8 @@ import org.unidal.helper.Threads.Task;
...
@@ -10,8 +10,8 @@ import org.unidal.helper.Threads.Task;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.consumer.company.model.entity.ProductLine
;
import
com.dianping.cat.consumer.company.model.entity.ProductLine
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.BaseAlert
;
import
com.dianping.cat.report.task.alert.BaseAlert
;
import
com.dianping.cat.report.task.alert.sender.AlertConstants
;
public
class
SystemAlert
extends
BaseAlert
implements
Task
,
LogEnabled
{
public
class
SystemAlert
extends
BaseAlert
implements
Task
,
LogEnabled
{
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/thirdParty/ThirdPartyAlert.java
浏览文件 @
2d65df5e
...
@@ -17,9 +17,8 @@ import org.unidal.lookup.annotation.Inject;
...
@@ -17,9 +17,8 @@ import org.unidal.lookup.annotation.Inject;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.helper.TimeUtil
;
import
com.dianping.cat.helper.TimeUtil
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.report.task.alert.
sender.
AlertConstants
;
import
com.dianping.cat.report.task.alert.AlertConstants
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity
;
import
com.dianping.cat.report.task.alert.sender.AlertEntity.AlertEntityBuilder
;
import
com.dianping.cat.report.task.alert.sender.AlertManager
;
import
com.dianping.cat.report.task.alert.sender.AlertManager
;
public
class
ThirdPartyAlert
implements
Task
{
public
class
ThirdPartyAlert
implements
Task
{
...
@@ -78,13 +77,12 @@ public class ThirdPartyAlert implements Task {
...
@@ -78,13 +77,12 @@ public class ThirdPartyAlert implements Task {
for
(
Entry
<
String
,
List
<
ThirdPartyAlertEntity
>>
entry
:
domain2AlertMap
.
entrySet
())
{
for
(
Entry
<
String
,
List
<
ThirdPartyAlertEntity
>>
entry
:
domain2AlertMap
.
entrySet
())
{
String
domain
=
entry
.
getKey
();
String
domain
=
entry
.
getKey
();
List
<
ThirdPartyAlertEntity
>
thirdPartyAlerts
=
entry
.
getValue
();
List
<
ThirdPartyAlertEntity
>
thirdPartyAlerts
=
entry
.
getValue
();
AlertEntity
entity
=
new
AlertEntity
();
entity
.
setDate
(
new
Date
()).
setContent
(
thirdPartyAlerts
.
toString
()).
setLevel
(
"warning"
);
entity
.
setMetric
(
getName
()).
setType
(
getName
()).
setGroup
(
domain
);
AlertEntityBuilder
builder
=
new
AlertEntity
().
new
AlertEntityBuilder
();
m_sendManager
.
addAlert
(
entity
);
builder
.
buildDate
(
new
Date
()).
buildLevel
(
"warning"
).
buildContent
(
thirdPartyAlerts
.
toString
());
builder
.
buildMetric
(
getName
()).
buildType
(
getName
()).
buildGroup
(
domain
);
AlertEntity
alertEntity
=
builder
.
getAlertEntity
();
m_sendManager
.
addAlert
(
alertEntity
);
}
}
t
.
setStatus
(
Transaction
.
SUCCESS
);
t
.
setStatus
(
Transaction
.
SUCCESS
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
2d65df5e
...
@@ -471,8 +471,8 @@
...
@@ -471,8 +471,8 @@
</requirements>
</requirements>
</component>
</component>
<component>
<component>
<role>
com.dianping.cat.report.task.alert.
manager
.AlertEntityService
</role>
<role>
com.dianping.cat.report.task.alert.
service
.AlertEntityService
</role>
<implementation>
com.dianping.cat.report.task.alert.
manager
.AlertEntityService
</implementation>
<implementation>
com.dianping.cat.report.task.alert.
service
.AlertEntityService
</implementation>
<requirements>
<requirements>
<requirement>
<requirement>
<role>
com.dianping.cat.home.dal.report.AlertDao
</role>
<role>
com.dianping.cat.home.dal.report.AlertDao
</role>
...
@@ -840,7 +840,7 @@
...
@@ -840,7 +840,7 @@
<role>
com.dianping.cat.report.task.alert.sender.receiver.ContactorManager
</role>
<role>
com.dianping.cat.report.task.alert.sender.receiver.ContactorManager
</role>
</requirement>
</requirement>
<requirement>
<requirement>
<role>
com.dianping.cat.report.task.alert.
manager
.AlertEntityService
</role>
<role>
com.dianping.cat.report.task.alert.
service
.AlertEntityService
</role>
</requirement>
</requirement>
<requirement>
<requirement>
<role>
com.dianping.cat.report.task.alert.sender.spliter.SpliterManager
</role>
<role>
com.dianping.cat.report.task.alert.sender.spliter.SpliterManager
</role>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录