Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
41921fd0
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,发现更多精彩内容 >>
提交
41921fd0
编写于
7月 17, 2014
作者:
L
leon.li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change bugs that metric ids from different domains may equal
上级
331ebfab
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
109 addition
and
72 deletion
+109
-72
cat-home/src/main/java/com/dianping/cat/report/page/metric/graph/MetricGraphCreator.java
...ping/cat/report/page/metric/graph/MetricGraphCreator.java
+14
-3
cat-home/src/main/java/com/dianping/cat/report/page/network/graph/NetworkGraphCreator.java
...ng/cat/report/page/network/graph/NetworkGraphCreator.java
+18
-7
cat-home/src/main/java/com/dianping/cat/report/page/network/nettopology/NetGraphBuilder.java
.../cat/report/page/network/nettopology/NetGraphBuilder.java
+19
-29
cat-home/src/main/java/com/dianping/cat/report/page/network/nettopology/NetGraphManager.java
.../cat/report/page/network/nettopology/NetGraphManager.java
+22
-20
cat-home/src/main/java/com/dianping/cat/report/task/alert/AlertInfo.java
...in/java/com/dianping/cat/report/task/alert/AlertInfo.java
+28
-7
cat-home/src/main/java/com/dianping/cat/report/task/alert/BaseAlert.java
...in/java/com/dianping/cat/report/task/alert/BaseAlert.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/alert/business/BusinessAlert.java
...ianping/cat/report/task/alert/business/BusinessAlert.java
+1
-1
cat-home/src/main/java/com/dianping/cat/report/task/network/NetTopologyReportBuilder.java
...ing/cat/report/task/network/NetTopologyReportBuilder.java
+6
-4
未找到文件。
cat-home/src/main/java/com/dianping/cat/report/page/metric/graph/MetricGraphCreator.java
浏览文件 @
41921fd0
...
...
@@ -25,6 +25,7 @@ import com.dianping.cat.helper.TimeUtil;
import
com.dianping.cat.home.metric.group.entity.MetricKeyConfig
;
import
com.dianping.cat.report.chart.AbstractGraphCreator
;
import
com.dianping.cat.report.page.LineChart
;
import
com.dianping.cat.report.task.alert.AlertInfo.AlertMetric
;
import
com.dianping.cat.report.task.alert.MetricType
;
import
com.site.lookup.util.StringUtils
;
...
...
@@ -67,7 +68,7 @@ public class MetricGraphCreator extends AbstractGraphCreator {
public
Map
<
String
,
LineChart
>
buildChartData
(
final
Map
<
String
,
double
[]>
datas
,
Date
startDate
,
Date
endDate
,
final
Map
<
String
,
double
[]>
dataWithOutFutures
)
{
Map
<
String
,
LineChart
>
charts
=
new
LinkedHashMap
<
String
,
LineChart
>();
List
<
String
>
alertKeys
=
m_alertInfo
.
queryLastestAlarmKey
(
5
);
List
<
AlertMetric
>
alertKeys
=
m_alertInfo
.
queryLastestAlarmKey
(
5
);
int
step
=
m_dataExtractor
.
getStep
();
for
(
Entry
<
String
,
double
[]>
entry
:
dataWithOutFutures
.
entrySet
())
{
...
...
@@ -254,7 +255,7 @@ public class MetricGraphCreator extends AbstractGraphCreator {
return
des
;
}
private
void
buildLineChartTitle
(
List
<
String
>
alertKeys
,
LineChart
chart
,
String
key
,
String
contactInfo
)
{
private
void
buildLineChartTitle
(
List
<
AlertMetric
>
alertKeys
,
LineChart
chart
,
String
key
,
String
contactInfo
)
{
int
index
=
key
.
lastIndexOf
(
":"
);
String
metricId
=
key
.
substring
(
0
,
index
);
String
type
=
key
.
substring
(
index
+
1
);
...
...
@@ -266,7 +267,7 @@ public class MetricGraphCreator extends AbstractGraphCreator {
chart
.
setTitle
(
title
);
chart
.
setId
(
metricId
+
":"
+
type
);
if
(
alertKeys
.
contains
(
metricId
))
{
if
(
containMetric
(
alertKeys
,
metricId
))
{
chart
.
setHtmlTitle
(
"<span style='color:red'>"
+
title
+
"<br><small>"
+
contactInfo
+
"</small></span>"
);
}
else
{
chart
.
setHtmlTitle
(
title
+
"<br><small>"
+
contactInfo
+
"</small>"
);
...
...
@@ -274,6 +275,16 @@ public class MetricGraphCreator extends AbstractGraphCreator {
}
}
private
boolean
containMetric
(
List
<
AlertMetric
>
alertKeys
,
String
metricId
)
{
for
(
AlertMetric
alertMetric
:
alertKeys
)
{
if
(
alertMetric
.
getMetricId
().
equals
(
metricId
))
{
return
true
;
}
}
return
false
;
}
private
Map
<
String
,
double
[]>
buildGraphData
(
MetricReport
metricReport
,
List
<
MetricItemConfig
>
metricConfigs
)
{
Map
<
String
,
double
[]>
datas
=
m_pruductDataFetcher
.
buildGraphData
(
metricReport
);
Map
<
String
,
double
[]>
values
=
new
LinkedHashMap
<
String
,
double
[]>();
...
...
cat-home/src/main/java/com/dianping/cat/report/page/network/graph/NetworkGraphCreator.java
浏览文件 @
41921fd0
...
...
@@ -15,15 +15,16 @@ import com.dianping.cat.consumer.metric.model.entity.MetricReport;
import
com.dianping.cat.helper.TimeUtil
;
import
com.dianping.cat.report.chart.AbstractGraphCreator
;
import
com.dianping.cat.report.page.LineChart
;
import
com.dianping.cat.report.task.alert.AlertInfo.AlertMetric
;
import
com.dianping.cat.report.task.alert.MetricType
;
public
class
NetworkGraphCreator
extends
AbstractGraphCreator
{
public
Map
<
String
,
LineChart
>
buildChartData
(
final
Map
<
String
,
double
[]>
datas
,
Date
startDate
,
Date
end
Date
,
final
Map
<
String
,
double
[]>
dataWithOutFutures
)
{
public
Map
<
String
,
LineChart
>
buildChartData
(
String
productLine
,
final
Map
<
String
,
double
[]>
datas
,
Date
start
Date
,
Date
endDate
,
final
Map
<
String
,
double
[]>
dataWithOutFutures
)
{
Map
<
String
,
List
<
String
>>
aggregationKeys
=
buildLineChartKeys
(
dataWithOutFutures
.
keySet
());
Map
<
String
,
LineChart
>
charts
=
new
LinkedHashMap
<
String
,
LineChart
>();
List
<
String
>
alertKeys
=
m_alertInfo
.
queryLastestAlarmKey
(
5
);
List
<
AlertMetric
>
alertKeys
=
m_alertInfo
.
queryLastestAlarmKey
(
5
);
int
step
=
m_dataExtractor
.
getStep
();
for
(
Entry
<
String
,
List
<
String
>>
keyMapEntry
:
aggregationKeys
.
entrySet
())
{
...
...
@@ -41,7 +42,7 @@ public class NetworkGraphCreator extends AbstractGraphCreator {
Map
<
Long
,
Double
>
all
=
convertToMap
(
datas
.
get
(
key
),
startDate
,
1
);
Map
<
Long
,
Double
>
current
=
convertToMap
(
dataWithOutFutures
.
get
(
key
),
startDate
,
step
);
buildLineChartTitle
(
lineChart
,
key
,
alertKeys
);
buildLineChartTitle
(
productLine
,
lineChart
,
key
,
alertKeys
);
addLastMinuteData
(
current
,
all
,
m_lastMinute
,
endDate
);
convertFlowMetric
(
lineChart
,
current
,
buildLineTitle
(
key
));
}
else
{
...
...
@@ -53,12 +54,12 @@ public class NetworkGraphCreator extends AbstractGraphCreator {
return
charts
;
}
private
void
buildLineChartTitle
(
LineChart
lineChart
,
String
key
,
List
<
String
>
alertKeys
)
{
private
void
buildLineChartTitle
(
String
productLine
,
LineChart
lineChart
,
String
key
,
List
<
AlertMetric
>
alertKeys
)
{
String
title
=
lineChart
.
getHtmlTitle
();
String
realKey
=
key
.
substring
(
0
,
key
.
lastIndexOf
(
":"
));
// alertKeys格式 = [domain:Metric:key]
if
(
alertKeys
.
contains
(
realKey
)
&&
!
title
.
startsWith
(
"<span style='color:red'>"
))
{
if
(
containsAlert
(
productLine
,
realKey
,
alertKeys
)
&&
!
title
.
startsWith
(
"<span style='color:red'>"
))
{
lineChart
.
setHtmlTitle
(
"<span style='color:red'>"
+
title
+
"</span>"
);
}
else
{
lineChart
.
setHtmlTitle
(
title
);
...
...
@@ -70,7 +71,17 @@ public class NetworkGraphCreator extends AbstractGraphCreator {
Map
<
String
,
double
[]>
allCurrentValues
=
m_dataExtractor
.
extract
(
oldCurrentValues
);
Map
<
String
,
double
[]>
dataWithOutFutures
=
removeFutureData
(
endDate
,
allCurrentValues
);
return
buildChartData
(
oldCurrentValues
,
startDate
,
endDate
,
dataWithOutFutures
);
return
buildChartData
(
productLine
,
oldCurrentValues
,
startDate
,
endDate
,
dataWithOutFutures
);
}
private
boolean
containsAlert
(
String
productLine
,
String
key
,
List
<
AlertMetric
>
metrics
)
{
for
(
AlertMetric
metric
:
metrics
)
{
if
(
metric
.
getGroup
().
equals
(
productLine
)
&&
metric
.
getMetricId
().
equals
(
key
))
{
return
true
;
}
}
return
false
;
}
private
Map
<
String
,
double
[]>
prepareAllData
(
String
productLine
,
Date
startDate
,
Date
endDate
)
{
...
...
cat-home/src/main/java/com/dianping/cat/report/page/network/nettopology/NetGraphBuilder.java
浏览文件 @
41921fd0
...
...
@@ -14,12 +14,14 @@ import com.dianping.cat.home.nettopo.entity.NetGraph;
import
com.dianping.cat.home.nettopo.entity.NetGraphSet
;
import
com.dianping.cat.home.nettopo.entity.NetTopology
;
import
com.dianping.cat.home.nettopo.entity.Switch
;
import
com.dianping.cat.report.task.alert.AlertInfo.AlertMetric
;
public
class
NetGraphBuilder
{
private
static
final
int
ERROR
=
3
;
public
NetGraphSet
buildGraphSet
(
NetGraph
netGraphTemplate
,
Map
<
String
,
MetricReport
>
reports
,
List
<
String
>
alertKeys
)
{
public
NetGraphSet
buildGraphSet
(
NetGraph
netGraphTemplate
,
Map
<
String
,
MetricReport
>
reports
,
List
<
AlertMetric
>
alertKeys
)
{
NetGraphSet
netGraphSet
=
new
NetGraphSet
();
for
(
int
minute
=
0
;
minute
<=
59
;
minute
++)
{
...
...
@@ -49,7 +51,7 @@ public class NetGraphBuilder {
return
netGraphSet
;
}
private
void
buildConnectionInfo
(
Map
<
String
,
MetricReport
>
reports
,
List
<
String
>
alertKeys
,
int
minute
,
private
void
buildConnectionInfo
(
Map
<
String
,
MetricReport
>
reports
,
List
<
AlertMetric
>
alertKeys
,
int
minute
,
List
<
String
>
alertSwitchs
,
Connection
connection
)
{
double
insum
=
0
,
outsum
=
0
,
inDiscardsSum
=
0
,
outDiscardsSum
=
0
,
inErrorsSum
=
0
,
outErrorsSum
=
0
;
int
inState
=
0
,
outState
=
0
,
inDiscardsState
=
0
,
outDiscardsState
=
0
,
inErrorsState
=
0
,
outErrorsState
=
0
;
...
...
@@ -62,27 +64,27 @@ public class NetGraphBuilder {
updateInterface
(
inter
,
report
,
minute
);
if
(
inAlert
(
alertKeys
,
domain
,
key
))
{
if
(
containsAlert
(
alertKeys
,
group
,
domain
,
key
,
"-flow-in"
))
{
inter
.
setInstate
(
ERROR
);
inState
=
ERROR
;
}
if
(
inDiscardsAlert
(
alertKeys
,
domain
,
key
))
{
if
(
containsAlert
(
alertKeys
,
group
,
domain
,
key
,
"-discard/error-indiscards"
))
{
inter
.
setInDiscardsState
(
ERROR
);
inDiscardsState
=
ERROR
;
}
if
(
inErrorsAlert
(
alertKeys
,
domain
,
key
))
{
if
(
containsAlert
(
alertKeys
,
group
,
domain
,
key
,
"-discard/error-inerrors"
))
{
inter
.
setInErrorsState
(
ERROR
);
inErrorsState
=
ERROR
;
}
if
(
outAlert
(
alertKeys
,
domain
,
key
))
{
if
(
containsAlert
(
alertKeys
,
group
,
domain
,
key
,
"-flow-out"
))
{
inter
.
setOutstate
(
ERROR
);
outState
=
ERROR
;
}
if
(
outDiscardsAlert
(
alertKeys
,
domain
,
key
))
{
if
(
containsAlert
(
alertKeys
,
group
,
domain
,
key
,
"-discard/error-outdiscards"
))
{
inter
.
setOutDiscardsState
(
ERROR
);
outDiscardsState
=
ERROR
;
}
if
(
outErrorsAlert
(
alertKeys
,
domain
,
key
))
{
if
(
containsAlert
(
alertKeys
,
group
,
domain
,
key
,
"-discard/error-outerrors"
))
{
inter
.
setOutErrorsState
(
ERROR
);
outErrorsState
=
ERROR
;
}
...
...
@@ -106,35 +108,23 @@ public class NetGraphBuilder {
connection
.
setOutDiscardsState
(
outDiscardsState
);
connection
.
setInErrorsState
(
inErrorsState
);
connection
.
setOutErrorsState
(
outErrorsState
);
if
(
inState
==
ERROR
||
outState
==
ERROR
||
inDiscardsState
==
ERROR
||
outDiscardsState
==
ERROR
||
inErrorsState
==
ERROR
||
outErrorsState
==
ERROR
)
{
alertSwitchs
.
add
(
connection
.
getFrom
());
}
}
private
boolean
inAlert
(
List
<
String
>
alertKeys
,
String
domain
,
String
key
)
{
return
alertKeys
.
contains
(
domain
+
":Metric:"
+
key
+
"-flow-in"
);
}
private
boolean
inDiscardsAlert
(
List
<
String
>
alertKeys
,
String
domain
,
String
key
)
{
return
alertKeys
.
contains
(
domain
+
":Metric:"
+
key
+
"-discard/error-indiscards"
);
}
private
boolean
inErrorsAlert
(
List
<
String
>
alertKeys
,
String
domain
,
String
key
)
{
return
alertKeys
.
contains
(
domain
+
":Metric:"
+
key
+
"-discard/error-inerrors"
);
}
private
boolean
containsAlert
(
List
<
AlertMetric
>
alertKeys
,
String
group
,
String
domain
,
String
key
,
String
suffix
)
{
String
actualKey
=
domain
+
":Metric:"
+
key
+
suffix
;
private
boolean
outAlert
(
List
<
String
>
alertKeys
,
String
domain
,
String
key
)
{
return
alertKeys
.
contains
(
domain
+
":Metric:"
+
key
+
"-flow-out"
);
}
private
boolean
outDiscardsAlert
(
List
<
String
>
alertKeys
,
String
domain
,
String
key
)
{
return
alertKeys
.
contains
(
domain
+
":Metric:"
+
key
+
"-discard/error-outdiscards"
);
}
for
(
AlertMetric
metric
:
alertKeys
)
{
if
(
metric
.
getGroup
().
equals
(
group
)
&&
metric
.
getMetricId
().
equals
(
actualKey
))
{
return
true
;
}
}
private
boolean
outErrorsAlert
(
List
<
String
>
alertKeys
,
String
domain
,
String
key
)
{
return
alertKeys
.
contains
(
domain
+
":Metric:"
+
key
+
"-discard/error-outerrors"
);
return
false
;
}
private
NetGraph
copyBaseInfoFromTemplate
(
NetGraph
netGraph
)
{
...
...
cat-home/src/main/java/com/dianping/cat/report/page/network/nettopology/NetGraphManager.java
浏览文件 @
41921fd0
...
...
@@ -32,6 +32,7 @@ import com.dianping.cat.message.Transaction;
import
com.dianping.cat.report.page.JsonBuilder
;
import
com.dianping.cat.report.service.ReportService
;
import
com.dianping.cat.report.task.alert.AlertInfo
;
import
com.dianping.cat.report.task.alert.AlertInfo.AlertMetric
;
import
com.dianping.cat.report.task.alert.RemoteMetricReportService
;
import
com.dianping.cat.service.ModelRequest
;
import
com.dianping.cat.system.config.NetGraphConfigManager
;
...
...
@@ -49,13 +50,13 @@ public class NetGraphManager implements Initializable, LogEnabled {
@Inject
private
NetGraphBuilder
m_netGraphBuilder
;
@Inject
private
AlertInfo
m_alertInfo
;
@Inject
private
NetGraphConfigManager
m_netGraphConfigManager
;
private
NetGraphSet
m_currentNetGraphSet
;
private
NetGraphSet
m_lastNetGraphSet
;
...
...
@@ -109,18 +110,17 @@ public class NetGraphManager implements Initializable, LogEnabled {
}
private
Set
<
String
>
queryAllGroups
(
NetGraph
netGraphTemplate
)
{
Set
<
String
>
groups
=
new
HashSet
<
String
>();
for
(
NetTopology
netTopology
:
netGraphTemplate
.
getNetTopologies
())
{
for
(
Connection
connection
:
netTopology
.
getConnections
())
{
for
(
Interface
inter
:
connection
.
getInterfaces
())
{
groups
.
add
(
inter
.
getGroup
());
}
}
}
return
groups
;
}
Set
<
String
>
groups
=
new
HashSet
<
String
>();
for
(
NetTopology
netTopology
:
netGraphTemplate
.
getNetTopologies
())
{
for
(
Connection
connection
:
netTopology
.
getConnections
())
{
for
(
Interface
inter
:
connection
.
getInterfaces
())
{
groups
.
add
(
inter
.
getGroup
());
}
}
}
return
groups
;
}
private
Map
<
String
,
MetricReport
>
queryMetricReports
(
Set
<
String
>
groups
,
Date
date
)
{
Map
<
String
,
MetricReport
>
reports
=
new
HashMap
<
String
,
MetricReport
>();
...
...
@@ -154,19 +154,21 @@ public class NetGraphManager implements Initializable, LogEnabled {
minuteStr
=
'0'
+
minuteStr
;
}
Transaction
t
=
Cat
.
newTransaction
(
"NetGraph"
,
"M"
+
minuteStr
);
try
{
NetGraph
netGraphTemplate
=
m_netGraphConfigManager
.
getConfig
().
getNetGraphs
().
get
(
0
);
Set
<
String
>
groups
=
queryAllGroups
(
netGraphTemplate
);
Map
<
String
,
MetricReport
>
currentMetricReports
=
queryMetricReports
(
groups
,
TimeUtil
.
getCurrentHour
());
List
<
String
>
alertKeys
=
m_alertInfo
.
queryLastestAlarmKey
(
5
);
m_currentNetGraphSet
=
m_netGraphBuilder
.
buildGraphSet
(
netGraphTemplate
,
currentMetricReports
,
alertKeys
);
List
<
AlertMetric
>
alertKeys
=
m_alertInfo
.
queryLastestAlarmKey
(
5
);
m_currentNetGraphSet
=
m_netGraphBuilder
.
buildGraphSet
(
netGraphTemplate
,
currentMetricReports
,
alertKeys
);
Date
lastHour
=
new
Date
(
TimeUtil
.
getCurrentHour
().
getTime
()
-
TimeUtil
.
ONE_HOUR
);
Map
<
String
,
MetricReport
>
lastHourReports
=
queryMetricReports
(
groups
,
lastHour
);
m_lastNetGraphSet
=
m_netGraphBuilder
.
buildGraphSet
(
netGraphTemplate
,
lastHourReports
,
new
ArrayList
<
String
>());
m_lastNetGraphSet
=
m_netGraphBuilder
.
buildGraphSet
(
netGraphTemplate
,
lastHourReports
,
new
ArrayList
<
AlertMetric
>());
t
.
setStatus
(
Transaction
.
SUCCESS
);
}
catch
(
Exception
e
)
{
t
.
setStatus
(
e
);
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/AlertInfo.java
浏览文件 @
41921fd0
...
...
@@ -14,32 +14,53 @@ import com.dianping.cat.helper.TimeUtil;
public
class
AlertInfo
implements
Initializable
{
private
ConcurrentHashMap
<
String
,
Long
>
m_alertInfos
=
new
ConcurrentHashMap
<
String
,
Long
>();
private
ConcurrentHashMap
<
AlertMetric
,
Long
>
m_alertInfos
=
new
ConcurrentHashMap
<
AlertMetric
,
Long
>();
@Inject
protected
MetricConfigManager
m_manager
;
public
void
addAlertInfo
(
String
metricId
,
long
value
)
{
m_alertInfos
.
put
(
metricId
,
value
);
public
void
addAlertInfo
(
String
group
,
String
metricId
,
long
value
)
{
m_alertInfos
.
put
(
new
AlertMetric
(
group
,
metricId
)
,
value
);
}
@Override
public
void
initialize
()
throws
InitializationException
{
}
public
List
<
String
>
queryLastestAlarmKey
(
int
minute
)
{
List
<
String
>
keys
=
new
ArrayList
<
String
>();
public
List
<
AlertMetric
>
queryLastestAlarmKey
(
int
minute
)
{
List
<
AlertMetric
>
keys
=
new
ArrayList
<
AlertMetric
>();
long
currentTimeMillis
=
System
.
currentTimeMillis
();
for
(
Entry
<
String
,
Long
>
entry
:
m_alertInfos
.
entrySet
())
{
for
(
Entry
<
AlertMetric
,
Long
>
entry
:
m_alertInfos
.
entrySet
())
{
Long
value
=
entry
.
getValue
();
if
(
currentTimeMillis
-
value
<
TimeUtil
.
ONE_MINUTE
*
minute
)
{
keys
.
add
(
entry
.
getKey
());
}
}
return
keys
;
}
public
class
AlertMetric
{
private
String
m_group
;
private
String
m_metricId
;
public
AlertMetric
(
String
group
,
String
metricId
)
{
this
.
m_group
=
group
;
this
.
m_metricId
=
metricId
;
}
public
String
getGroup
()
{
return
m_group
;
}
public
String
getMetricId
()
{
return
m_metricId
;
}
}
}
cat-home/src/main/java/com/dianping/cat/report/task/alert/BaseAlert.java
浏览文件 @
41921fd0
...
...
@@ -284,7 +284,7 @@ public abstract class BaseAlert {
String
mailTitle
=
getAlertConfig
().
buildMailTitle
(
productLine
.
getTitle
(),
metricTitle
);
String
contactInfo
=
buildContactInfo
(
extractDomain
(
metricKey
));
alertResult
.
setContent
(
alertResult
.
getContent
()
+
contactInfo
);
m_alertInfo
.
addAlertInfo
(
metricKey
,
new
Date
().
getTime
());
m_alertInfo
.
addAlertInfo
(
productlineName
,
metricKey
,
new
Date
().
getTime
());
storeAlert
(
productlineName
,
metricTitle
,
mailTitle
,
alertResult
);
sendAlertInfo
(
productLine
,
mailTitle
,
alertResult
.
getContent
(),
alertResult
.
getAlertType
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/business/BusinessAlert.java
浏览文件 @
41921fd0
...
...
@@ -73,7 +73,7 @@ public class BusinessAlert extends BaseAlert implements Task, LogEnabled {
String
mailTitle
=
m_alertConfig
.
buildMailTitle
(
productLine
.
getTitle
(),
config
.
getTitle
());
String
contactInfo
=
buildContactInfo
(
domain
);
alertResult
.
setContent
(
alertResult
.
getContent
()
+
contactInfo
);
m_alertInfo
.
addAlertInfo
(
metricKey
,
new
Date
().
getTime
());
m_alertInfo
.
addAlertInfo
(
productLine
.
getId
(),
metricKey
,
new
Date
().
getTime
());
storeAlert
(
domain
,
metric
,
mailTitle
,
alertResult
);
sendAlertInfo
(
productLine
,
mailTitle
,
alertResult
.
getContent
(),
alertResult
.
getAlertType
());
...
...
cat-home/src/main/java/com/dianping/cat/report/task/network/NetTopologyReportBuilder.java
浏览文件 @
41921fd0
...
...
@@ -21,6 +21,7 @@ import com.dianping.cat.home.nettopo.entity.NetTopology;
import
com.dianping.cat.home.nettopo.transform.DefaultNativeBuilder
;
import
com.dianping.cat.report.page.network.nettopology.NetGraphBuilder
;
import
com.dianping.cat.report.service.ReportService
;
import
com.dianping.cat.report.task.alert.AlertInfo.AlertMetric
;
import
com.dianping.cat.report.task.spi.ReportTaskBuilder
;
import
com.dianping.cat.system.config.NetGraphConfigManager
;
...
...
@@ -31,7 +32,7 @@ public class NetTopologyReportBuilder implements ReportTaskBuilder {
@Inject
private
NetGraphBuilder
m_netGraphBuilder
;
@Inject
private
NetGraphConfigManager
m_netGraphConfigManager
;
...
...
@@ -52,7 +53,7 @@ public class NetTopologyReportBuilder implements ReportTaskBuilder {
}
}
}
Map
<
String
,
MetricReport
>
reports
=
new
HashMap
<
String
,
MetricReport
>();
for
(
String
group
:
groups
)
{
...
...
@@ -61,8 +62,9 @@ public class NetTopologyReportBuilder implements ReportTaskBuilder {
reports
.
put
(
group
,
report
);
}
NetGraphSet
netGraphSet
=
m_netGraphBuilder
.
buildGraphSet
(
netGraphTemplate
,
reports
,
new
ArrayList
<
String
>());
NetGraphSet
netGraphSet
=
m_netGraphBuilder
.
buildGraphSet
(
netGraphTemplate
,
reports
,
new
ArrayList
<
AlertMetric
>());
HourlyReport
hourlyReport
=
new
HourlyReport
();
hourlyReport
.
setType
(
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录