Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
9d4d022b
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,发现更多精彩内容 >>
提交
9d4d022b
编写于
7月 29, 2014
作者:
J
jialinsun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
reslove conflicts
上级
96ad7b97
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
49 addition
and
54 deletion
+49
-54
cat-client/src/main/java/com/dianping/cat/message/io/TcpSocketSender.java
...ain/java/com/dianping/cat/message/io/TcpSocketSender.java
+1
-0
cat-core/src/main/resources/META-INF/dal/model/aggreation-model.xml
...rc/main/resources/META-INF/dal/model/aggreation-model.xml
+3
-1
cat-home/src/main/java/com/dianping/cat/build/ComponentsConfigurator.java
...n/java/com/dianping/cat/build/ComponentsConfigurator.java
+2
-3
cat-home/src/main/java/com/dianping/cat/report/task/alert/exception/AlertExceptionBuilder.java
...at/report/task/alert/exception/AlertExceptionBuilder.java
+25
-4
cat-home/src/main/java/com/dianping/cat/report/task/alert/exception/ExceptionAlert.java
...nping/cat/report/task/alert/exception/ExceptionAlert.java
+1
-7
cat-home/src/main/resources/META-INF/dal/model/aggreation-codegen.xml
.../main/resources/META-INF/dal/model/aggreation-codegen.xml
+0
-15
cat-home/src/main/resources/META-INF/dal/model/aggreation-manifest.xml
...main/resources/META-INF/dal/model/aggreation-manifest.xml
+0
-6
cat-home/src/main/resources/META-INF/dal/model/aggreation-model.xml
...rc/main/resources/META-INF/dal/model/aggreation-model.xml
+0
-15
cat-home/src/main/resources/config/default-aggregation-config.xml
.../src/main/resources/config/default-aggregation-config.xml
+1
-1
cat-home/src/main/webapp/jsp/system/aggregation/aggregation.jsp
...me/src/main/webapp/jsp/system/aggregation/aggregation.jsp
+6
-2
cat-home/src/main/webapp/jsp/system/aggregation/aggregationUpdate.jsp
.../main/webapp/jsp/system/aggregation/aggregationUpdate.jsp
+9
-0
cat-home/src/test/java/com/dianping/cat/report/task/alert/ExceptionBuilder.java
.../com/dianping/cat/report/task/alert/ExceptionBuilder.java
+1
-0
未找到文件。
cat-client/src/main/java/com/dianping/cat/message/io/TcpSocketSender.java
浏览文件 @
9d4d022b
...
...
@@ -102,6 +102,7 @@ public class TcpSocketSender implements Task, MessageSender, LogEnabled {
m_logger
.
error
(
"Error when sending message over TCP socket!"
,
t
);
}
}
else
{
System
.
out
.
println
(
"check write false"
);
try
{
Thread
.
sleep
(
5
);
}
catch
(
Exception
e
)
{
...
...
cat-core/src/main/resources/META-INF/dal/model/aggreation-model.xml
浏览文件 @
9d4d022b
...
...
@@ -6,7 +6,9 @@
</entity>
<entity
name=
"aggregation-rule"
>
<attribute
name=
"pattern"
value-type=
"String"
key=
"true"
/>
<attribute
name=
"type"
value-type=
"int"
/>
<attribute
name=
"type"
value-type=
"int"
primitive=
"true"
/>
<attribute
name=
"warn"
value-type=
"int"
primitive=
"true"
/>
<attribute
name=
"mails"
value-type=
"String"
/>
<attribute
name=
"domain"
value-type=
"String"
/>
<attribute
name=
"sample"
value-type=
"String"
/>
<attribute
name=
"display-name"
value-type=
"String"
/>
...
...
cat-home/src/main/java/com/dianping/cat/build/ComponentsConfigurator.java
浏览文件 @
9d4d022b
...
...
@@ -13,6 +13,7 @@ import org.unidal.lookup.configuration.Component;
import
com.dianping.cat.CatHomeModule
;
import
com.dianping.cat.ServerConfigManager
;
import
com.dianping.cat.config.aggregation.AggregationConfigManager
;
import
com.dianping.cat.config.app.AppDataCommandTableProvider
;
import
com.dianping.cat.config.app.AppDataService
;
import
com.dianping.cat.consumer.dependency.DependencyAnalyzer
;
...
...
@@ -202,7 +203,7 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
all
.
add
(
C
(
SystemAlert
.
class
).
req
(
ProductLineConfigManager
.
class
,
BaselineService
.
class
,
AlertInfo
.
class
).
req
(
RemoteMetricReportService
.
class
,
SystemRuleConfigManager
.
class
,
DataChecker
.
class
,
AlertManager
.
class
));
all
.
add
(
C
(
AlertExceptionBuilder
.
class
).
req
(
ExceptionConfigManager
.
class
));
all
.
add
(
C
(
AlertExceptionBuilder
.
class
).
req
(
ExceptionConfigManager
.
class
,
AggregationConfigManager
.
class
));
all
.
add
(
C
(
ExceptionAlert
.
class
)
.
req
(
ExceptionConfigManager
.
class
,
AlertExceptionBuilder
.
class
,
AlertManager
.
class
).
req
(
ModelService
.
class
,
...
...
@@ -344,8 +345,6 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
all
.
add
(
C
(
AlertEntityService
.
class
).
req
(
AlertDao
.
class
));
all
.
add
(
C
(
AlertExceptionBuilder
.
class
).
req
(
ExceptionConfigManager
.
class
));
all
.
add
(
C
(
AlertSummaryExecutor
.
class
).
req
(
AlertSummaryGenerator
.
class
,
AlertSummaryManager
.
class
,
MailSMS
.
class
)
.
req
(
AlertSummaryDecorator
.
class
,
AlertSummaryFTLDecorator
.
ID
));
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/exception/AlertExceptionBuilder.java
浏览文件 @
9d4d022b
...
...
@@ -11,6 +11,8 @@ import java.util.Map.Entry;
import
org.unidal.lookup.annotation.Inject
;
import
org.unidal.tuple.Pair
;
import
com.dianping.cat.Constants
;
import
com.dianping.cat.config.aggregation.AggregationConfigManager
;
import
com.dianping.cat.home.dependency.exception.entity.ExceptionExclude
;
import
com.dianping.cat.home.dependency.exception.entity.ExceptionLimit
;
import
com.dianping.cat.report.page.top.TopMetric.Item
;
...
...
@@ -21,20 +23,39 @@ public class AlertExceptionBuilder {
@Inject
private
ExceptionConfigManager
m_exceptionConfigManager
;
@Inject
private
AggregationConfigManager
m_aggregationConfigManager
;
public
Map
<
String
,
List
<
AlertException
>>
buildAlertExceptions
(
List
<
Item
>
items
)
{
Map
<
String
,
List
<
AlertException
>>
alertExceptions
=
new
LinkedHashMap
<
String
,
List
<
AlertException
>>();
for
(
Item
item
:
items
)
{
List
<
AlertException
>
domainAlertExceptions
=
buildDomainAlertExceptionList
(
item
);
String
domain
=
item
.
getDomain
();
if
(
Constants
.
FRONT_END
.
equalsIgnoreCase
(
domain
))
{
List
<
AlertException
>
frontEndAlertExceptions
=
buildFrontEndAlertExceptions
(
item
);
if
(!
frontEndAlertExceptions
.
isEmpty
())
{
alertExceptions
.
put
(
domain
,
frontEndAlertExceptions
);
}
}
else
{
List
<
AlertException
>
domainAlertExceptions
=
buildDomainAlertExceptions
(
item
);
if
(!
domainAlertExceptions
.
isEmpty
())
{
alertExceptions
.
put
(
item
.
getDomain
(),
domainAlertExceptions
);
alertExceptions
.
put
(
domain
,
domainAlertExceptions
);
}
}
}
return
alertExceptions
;
}
private
List
<
AlertException
>
buildDomainAlertExceptionList
(
Item
item
)
{
private
List
<
AlertException
>
buildFrontEndAlertExceptions
(
Item
item
)
{
String
domain
=
item
.
getDomain
();
List
<
AlertException
>
alertExceptions
=
new
ArrayList
<
AlertException
>();
return
null
;
}
private
List
<
AlertException
>
buildDomainAlertExceptions
(
Item
item
)
{
String
domain
=
item
.
getDomain
();
List
<
AlertException
>
alertExceptions
=
new
ArrayList
<
AlertException
>();
Pair
<
Double
,
Double
>
totalLimitPair
=
queryDomainTotalLimit
(
domain
);
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/exception/ExceptionAlert.java
浏览文件 @
9d4d022b
...
...
@@ -113,12 +113,6 @@ public class ExceptionAlert implements Task {
entity
.
setDate
(
new
Date
()).
setContent
(
exception
.
toString
()).
setLevel
(
exception
.
getType
());
entity
.
setMetric
(
metricName
).
setType
(
getName
()).
setGroup
(
domain
);
AlertExceptionBuilder
builder
=
new
AlertEntity
().
new
AlertExceptionBuilder
();
builder
.
buildDate
(
new
Date
()).
buildLevel
(
exception
.
getType
()).
buildContent
(
exception
.
toString
());
builder
.
buildMetric
(
metricName
).
buildProductline
(
domain
).
buildType
(
getName
()).
buildGroup
(
domain
);
AlertEntity
alertEntity
=
builder
.
getAlertEntity
();
m_sendManager
.
addAlert
(
entity
);
}
}
catch
(
Exception
e
)
{
...
...
cat-home/src/main/resources/META-INF/dal/model/aggreation-codegen.xml
已删除
100644 → 0
浏览文件 @
96ad7b97
<?xml version="1.0" encoding="UTF-8"?>
<model>
<entity
name=
"aggregation"
root=
"true"
>
<entity-ref
name=
"aggregation-rule"
type=
"list"
names=
"aggregation-rules"
/>
</entity>
<entity
name=
"aggregation-rule"
>
<attribute
name=
"type"
value-type=
"int"
/>
<attribute
name=
"domain"
value-type=
"String"
/>
<attribute
name=
"pattern"
value-type=
"String"
/>
<attribute
name=
"sample"
value-type=
"String"
/>
<attribute
name=
"display-name"
value-type=
"String"
/>
<attribute
name=
"creation-date"
value-type=
"Date"
format=
"yyyy-MM-dd HH:mm:ss"
/>
</entity>
</model>
cat-home/src/main/resources/META-INF/dal/model/aggreation-manifest.xml
已删除
100644 → 0
浏览文件 @
96ad7b97
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<file
path=
"aggreation-codegen.xml"
/>
<file
path=
"aggreation-model.xml"
/>
</manifest>
cat-home/src/main/resources/META-INF/dal/model/aggreation-model.xml
已删除
100644 → 0
浏览文件 @
96ad7b97
<?xml version="1.0" encoding="UTF-8"?>
<model
model-package=
"com.dianping.cat.home.aggreation"
enable-merger=
"false"
enable-sax-parser=
"true"
enable-base-visitor=
"false"
>
<entity
name=
"aggregation"
root=
"true"
>
<entity-ref
name=
"aggregation-rule"
type=
"map"
names=
"aggregation-rules"
method-find-or-create=
"true"
/>
</entity>
<entity
name=
"aggregation-rule"
>
<attribute
name=
"pattern"
value-type=
"String"
key=
"true"
/>
<attribute
name=
"type"
value-type=
"int"
/>
<attribute
name=
"domain"
value-type=
"String"
/>
<attribute
name=
"sample"
value-type=
"String"
/>
<attribute
name=
"display-name"
value-type=
"String"
/>
<attribute
name=
"creation-date"
value-type=
"Date"
format=
"yyyy-MM-dd HH:mm:ss"
/>
</entity>
</model>
cat-home/src/main/resources/config/default-aggregation-config.xml
浏览文件 @
9d4d022b
<?xml version="1.0" encoding="utf-8"?>
<aggregation>
<aggregation-rule
type=
"3"
domain=
"FrontEnd"
pattern=
"http://w.51ping.com/shop/{shopId}"
sample=
"http://w.51ping.com/shop/5722322"
display-name=
"http://w.51ping.com/shop/{shopId}"
creation-date=
"2013-06-05 15:42:03"
/>
<aggregation-rule
type=
"3"
domain=
"FrontEnd"
pattern=
"http://w.51ping.com/shop/{shopId}"
sample=
"http://w.51ping.com/shop/5722322"
display-name=
"http://w.51ping.com/shop/{shopId}"
warn=
"10"
email=
"jialin.sun@dianping.com"
creation-date=
"2013-06-05 15:42:03"
/>
<aggregation-rule
type=
"3"
domain=
"FrontEnd"
pattern=
"http://i{x}.dpfile.com/{*}"
sample=
"http://i1.dpfile.com/s/j"
display-name=
"http://i{x}.dpfile.com/{*}"
creation-date=
"2013-05-20 13:34:00"
/>
<aggregation-rule
type=
"3"
domain=
"FrontEnd"
pattern=
"http://www.dianping.com/{City}/food "
display-name=
"http://www.dianping.com/{City}/food "
creation-date=
"2013-05-20 13:34:00"
/>
<aggregation-rule
type=
"3"
domain=
"FrontEnd"
pattern=
"http://www.dianping.com/{City}/wedding"
display-name=
"http://www.dianping.com/{City}/wedding"
creation-date=
"2013-05-20 13:34:00"
/>
...
...
cat-home/src/main/webapp/jsp/system/aggregation/aggregation.jsp
浏览文件 @
9d4d022b
...
...
@@ -30,7 +30,9 @@
<tr
class=
"odd"
>
<th
width=
"15%"
>
报表类型
</th>
<th
width=
"10%"
>
域名
</th>
<th
width=
"70%"
>
规则
</th>
<th
width=
"60%"
>
规则
</th>
<th
width=
"10%"
>
告警阈值
</th>
<th
width=
"15%"
>
联系邮件
</th>
<!-- <th width="15%">显示名称</th>
<th width="8%">示例</th> -->
<th
width=
"5%"
>
操作
<a
class=
'btn btn-primary btn-small'
href=
"?op=aggregationUpdate"
>
新增
</a></th>
...
...
@@ -51,7 +53,9 @@
</c:when>
</c:choose>
<td>
${item.domain}
</td>
<td>
${item.pattern}
</td>
<%--
<td>
${item.pattern}
</td>
<td>
${item.warn}
</td>
<td>
${item.mails}
</td>
<%--
<td>${item.displayName}</td>
<td>${item.sample}</td> --%>
<td><a
class=
'btn btn-small btn-primary'
href=
"?op=aggregationUpdate&pattern=${item.pattern}"
>
编辑
</a>
...
...
cat-home/src/main/webapp/jsp/system/aggregation/aggregationUpdate.jsp
浏览文件 @
9d4d022b
...
...
@@ -54,6 +54,15 @@
<td>
模板
</td>
<td><input
type=
"text"
class=
"input-xlarge"
placeholder=
"选择被聚合对象的模板"
name=
"aggregation.pattern"
required
value=
"${model.aggregationRule.pattern}"
/></td>
</tr>
<tr>
<td>
告警阈值
</td>
<td><input
type=
"text"
class=
"input-xlarge"
placeholder=
"告警阈值"
name=
"aggregation.warn"
required
value=
"${model.aggregationRule.warn}"
/></td>
</tr>
<tr>
<td>
联系邮件
</td>
<td><input
type=
"text"
class=
"input-xlarge"
placeholder=
"联系邮件"
name=
"aggregation.mails"
required
value=
"${model.aggregationRule.mails}"
/></td>
</tr>
<%-- <tr>
<td>显示名称</td>
<td><input type="text" class="input-xlarge" placeholder="聚合显示的名称" name="aggregation.displayName" required value="${model.aggregationRule.displayName}"/></td>
...
...
cat-home/src/test/java/com/dianping/cat/report/task/alert/ExceptionBuilder.java
浏览文件 @
9d4d022b
...
...
@@ -6,6 +6,7 @@ public class ExceptionBuilder {
public
static
void
main
(
String
args
[])
{
while
(
true
)
{
Cat
.
logError
(
new
RuntimeException
(
"just test for FrontEnd"
));
System
.
out
.
println
(
"log error"
);
try
{
Thread
.
sleep
(
5000
);
}
catch
(
InterruptedException
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录