Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
596b95ad
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,发现更多精彩内容 >>
提交
596b95ad
编写于
7月 22, 2014
作者:
L
leon.li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add new model: AlertType
上级
1ae23391
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
100 addition
and
18 deletion
+100
-18
cat-home/pom.xml
cat-home/pom.xml
+17
-16
cat-home/src/main/java/com/dianping/cat/report/task/alert/exception/AlertExceptionBuilder.java
...at/report/task/alert/exception/AlertExceptionBuilder.java
+2
-2
cat-home/src/main/resources/META-INF/dal/model/alert-type-codegen.xml
.../main/resources/META-INF/dal/model/alert-type-codegen.xml
+21
-0
cat-home/src/main/resources/META-INF/dal/model/alert-type-manifest.xml
...main/resources/META-INF/dal/model/alert-type-manifest.xml
+6
-0
cat-home/src/main/resources/META-INF/dal/model/alert-type-model.xml
...rc/main/resources/META-INF/dal/model/alert-type-model.xml
+25
-0
cat-home/src/main/resources/META-INF/wizard/model/wizard.xml
cat-home/src/main/resources/META-INF/wizard/model/wizard.xml
+3
-0
cat-home/src/test/resources/config/alert-type.xml
cat-home/src/test/resources/config/alert-type.xml
+26
-0
未找到文件。
cat-home/pom.xml
浏览文件 @
596b95ad
...
...
@@ -154,14 +154,15 @@
${basedir}/src/main/resources/META-INF/dal/model/heavy-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/utilization-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/domainGroup-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/metric-group-config-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/metric-group-config-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/metric-aggregation-config-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/netgraph-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/alert-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/monitor-rules-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/alertconfig-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/alertsummary-manifest.xml,
</manifest>
${basedir}/src/main/resources/META-INF/dal/model/alert-type-manifest.xml,
</manifest>
</configuration>
</execution>
<execution>
...
...
@@ -202,20 +203,20 @@
</configuration>
</plugin>
<plugin>
<groupId>
org.mortbay.jetty
</groupId>
<artifactId>
maven-jetty-plugin
</artifactId>
<version>
6.1.26
</version>
<configuration>
<scanIntervalSeconds>
10
</scanIntervalSeconds>
<contextPath>
/cat
</contextPath>
<defaultsDescriptor>
src/main/webapp/WEB-INF/web.xml
</defaultsDescriptor>
<connectors>
<connector
implementation=
"org.mortbay.jetty.nio.SelectChannelConnector"
>
<port>
2281
</port>
<maxIdleTime>
500000
</maxIdleTime>
</connector>
</connectors>
</configuration>
<groupId>
org.mortbay.jetty
</groupId>
<artifactId>
maven-jetty-plugin
</artifactId>
<version>
6.1.26
</version>
<configuration>
<scanIntervalSeconds>
10
</scanIntervalSeconds>
<contextPath>
/cat
</contextPath>
<defaultsDescriptor>
src/main/webapp/WEB-INF/web.xml
</defaultsDescriptor>
<connectors>
<connector
implementation=
"org.mortbay.jetty.nio.SelectChannelConnector"
>
<port>
2281
</port>
<maxIdleTime>
500000
</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/exception/AlertExceptionBuilder.java
浏览文件 @
596b95ad
...
...
@@ -41,7 +41,7 @@ public class AlertExceptionBuilder {
double
totalWarnLimit
=
totalLimitPair
.
getKey
();
double
totalErrorLimit
=
totalLimitPair
.
getValue
();
double
totalException
=
0
;
for
(
Entry
<
String
,
Double
>
entry
:
item
.
getException
().
entrySet
())
{
String
exceptionName
=
entry
.
getKey
();
...
...
@@ -138,7 +138,7 @@ public class AlertExceptionBuilder {
String
time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
new
Date
());
sb
.
append
(
"[CAT异常告警] [项目: "
).
append
(
domain
).
append
(
"] : "
);
sb
.
append
(
exceptions
).
append
(
"[时间: "
).
append
(
time
).
append
(
"]"
);
sb
.
append
(
exceptions
).
append
(
"[时间: "
).
append
(
time
).
append
(
"]"
)
.
append
(
"\n"
)
;
sb
.
append
(
contactInfo
);
return
sb
.
toString
();
...
...
cat-home/src/main/resources/META-INF/dal/model/alert-type-codegen.xml
0 → 100644
浏览文件 @
596b95ad
<?xml version="1.0" encoding="UTF-8"?>
<model>
<entity
name=
"alert-type"
root=
"true"
>
<entity-ref
name=
"category"
type=
"list"
names=
"categories"
/>
</entity>
<entity
name=
"category"
>
<attribute
name=
"id"
value-type=
"String"
/>
<entity-ref
name=
"domain"
type=
"list"
names=
"domains"
/>
</entity>
<entity
name=
"domain"
>
<attribute
name=
"id"
value-type=
"String"
/>
<entity-ref
name=
"type"
type=
"list"
names=
"types"
/>
</entity>
<entity
name=
"type"
>
<attribute
name=
"id"
value-type=
"String"
/>
<attribute
name=
"sendSms"
value-type=
"boolean"
/>
<attribute
name=
"sendMail"
value-type=
"boolean"
/>
<attribute
name=
"sendWeixin"
value-type=
"boolean"
/>
</entity>
</model>
cat-home/src/main/resources/META-INF/dal/model/alert-type-manifest.xml
0 → 100644
浏览文件 @
596b95ad
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<file
path=
"alert-type-codegen.xml"
/>
<file
path=
"alert-type-model.xml"
/>
</manifest>
cat-home/src/main/resources/META-INF/dal/model/alert-type-model.xml
0 → 100644
浏览文件 @
596b95ad
<?xml version="1.0" encoding="UTF-8"?>
<model
model-package=
"com.dianping.cat.home.alert.type"
enable-sax-parser=
"true"
enable-xml-parser=
"true"
enable-xml-builder=
"true"
>
<entity
name=
"alert-type"
root=
"true"
>
<entity-ref
name=
"category"
type=
"map"
names=
"categories"
method-find-or-create=
'true'
/>
</entity>
<entity
name=
"category"
>
<attribute
name=
"id"
value-type=
"String"
key=
"true"
/>
<entity-ref
name=
"domain"
type=
"map"
names=
"domains"
method-find-or-create=
'true'
/>
</entity>
<entity
name=
"domain"
>
<attribute
name=
"id"
value-type=
"String"
key=
"true"
/>
<entity-ref
name=
"type"
type=
"map"
names=
"types"
method-find-or-create=
'true'
/>
</entity>
<entity
name=
"type"
>
<attribute
name=
"id"
value-type=
"String"
key=
"true"
/>
<attribute
name=
"sendSms"
value-type=
"boolean"
/>
<attribute
name=
"sendMail"
value-type=
"boolean"
/>
<attribute
name=
"sendWeixin"
value-type=
"boolean"
/>
</entity>
</model>
cat-home/src/main/resources/META-INF/wizard/model/wizard.xml
浏览文件 @
596b95ad
...
...
@@ -54,4 +54,7 @@
<model
package=
"com.dianping.cat.home.alertsummary"
name=
"alertsummary"
>
<sample-model>
/Users/leon/Desktop/AlertSummary.xml
</sample-model>
</model>
<model
package=
"com.dianping.cat.home.alert.type"
name=
"alert-type"
>
<sample-model>
/Users/leon/Documents/GitRepo/cat/cat-home/src/test/resources/config/alert-type.xml
</sample-model>
</model>
</wizard>
cat-home/src/test/resources/config/alert-type.xml
0 → 100644
浏览文件 @
596b95ad
<alert-type>
<category
id=
"network"
>
<domain
id=
"cat"
>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
<type
id=
"warning"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
</domain>
<domain
id=
"cat"
>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
</domain>
<domain
id=
"cat"
>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
</domain>
</category>
<category
id=
"exception"
>
<domain
id=
"cat"
>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
<type
id=
"error"
sendSms=
"true"
sendMail=
"true"
sendWeixin=
"true"
/>
</domain>
</category>
</alert-type>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录