Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
08808af6
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,发现更多精彩内容 >>
提交
08808af6
编写于
6月 07, 2013
作者:
Y
yong.you
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the dependency report
上级
32ac725c
变更
29
显示空白变更内容
内联
并排
Showing
29 changed file
with
544 addition
and
198 deletion
+544
-198
cat-home/src/main/java/com/dianping/cat/build/ComponentsConfigurator.java
...n/java/com/dianping/cat/build/ComponentsConfigurator.java
+3
-3
cat-home/src/main/java/com/dianping/cat/helper/CatString.java
...home/src/main/java/com/dianping/cat/helper/CatString.java
+2
-0
cat-home/src/main/java/com/dianping/cat/helper/Parse.java
cat-home/src/main/java/com/dianping/cat/helper/Parse.java
+12
-0
cat-home/src/main/java/com/dianping/cat/report/page/dependency/Action.java
.../java/com/dianping/cat/report/page/dependency/Action.java
+7
-5
cat-home/src/main/java/com/dianping/cat/report/page/dependency/Handler.java
...java/com/dianping/cat/report/page/dependency/Handler.java
+90
-63
cat-home/src/main/java/com/dianping/cat/report/page/dependency/JspFile.java
...java/com/dianping/cat/report/page/dependency/JspFile.java
+5
-3
cat-home/src/main/java/com/dianping/cat/report/page/dependency/JspViewer.java
...va/com/dianping/cat/report/page/dependency/JspViewer.java
+6
-4
cat-home/src/main/java/com/dianping/cat/report/page/dependency/Model.java
...n/java/com/dianping/cat/report/page/dependency/Model.java
+54
-1
cat-home/src/main/java/com/dianping/cat/report/page/dependency/Payload.java
...java/com/dianping/cat/report/page/dependency/Payload.java
+19
-8
cat-home/src/main/java/com/dianping/cat/report/page/dependency/dashboard/ProductLineConfig.java
...t/report/page/dependency/dashboard/ProductLineConfig.java
+12
-7
cat-home/src/main/java/com/dianping/cat/report/page/dependency/dashboard/ProductLineDashboard.java
...eport/page/dependency/dashboard/ProductLineDashboard.java
+82
-0
cat-home/src/main/java/com/dianping/cat/report/page/dependency/dashboard/ProductLinesDashboard.java
...port/page/dependency/dashboard/ProductLinesDashboard.java
+6
-4
cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/TopologyGraphManager.java
...at/report/page/dependency/graph/TopologyGraphManager.java
+29
-9
cat-home/src/main/java/com/dianping/cat/report/page/top/Payload.java
...c/main/java/com/dianping/cat/report/page/top/Payload.java
+22
-0
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+22
-19
cat-home/src/main/webapp/jsp/report/dependency/dependency.jsp
...home/src/main/webapp/jsp/report/dependency/dependency.jsp
+5
-6
cat-home/src/main/webapp/jsp/report/dependency/dependencyDashboard.jsp
...main/webapp/jsp/report/dependency/dependencyDashboard.jsp
+17
-2
cat-home/src/main/webapp/jsp/report/dependency/dependencyDetailData.jsp
...ain/webapp/jsp/report/dependency/dependencyDetailData.jsp
+0
-0
cat-home/src/main/webapp/jsp/report/dependency/dependencyEvent.jsp
...src/main/webapp/jsp/report/dependency/dependencyEvent.jsp
+0
-0
cat-home/src/main/webapp/jsp/report/dependency/dependencyLineGraph.jsp
...main/webapp/jsp/report/dependency/dependencyLineGraph.jsp
+1
-1
cat-home/src/main/webapp/jsp/report/dependency/dependencyOpNav.jsp
...src/main/webapp/jsp/report/dependency/dependencyOpNav.jsp
+7
-0
cat-home/src/main/webapp/jsp/report/dependency/dependencyProductLine.jsp
...in/webapp/jsp/report/dependency/dependencyProductLine.jsp
+98
-0
cat-home/src/main/webapp/jsp/report/dependency/dependencyTimeNav.jsp
...c/main/webapp/jsp/report/dependency/dependencyTimeNav.jsp
+8
-3
cat-home/src/main/webapp/jsp/report/dependency/dependencyTopologyGraph.jsp
.../webapp/jsp/report/dependency/dependencyTopologyGraph.jsp
+10
-5
cat-home/src/main/webapp/jsp/report/dependencyDashboardNav.jsp
...ome/src/main/webapp/jsp/report/dependencyDashboardNav.jsp
+0
-25
cat-home/src/main/webapp/jsp/report/dependencyTopologyGraphNav.jsp
...src/main/webapp/jsp/report/dependencyTopologyGraphNav.jsp
+0
-26
cat-home/src/main/webapp/jsp/report/top.jsp
cat-home/src/main/webapp/jsp/report/top.jsp
+17
-1
cat-home/src/main/webapp/jsp/system/topologyGraphEdgeConfigs.jsp
...e/src/main/webapp/jsp/system/topologyGraphEdgeConfigs.jsp
+5
-1
cat-home/src/main/webapp/jsp/system/topologyGraphNodeConfigs.jsp
...e/src/main/webapp/jsp/system/topologyGraphNodeConfigs.jsp
+5
-2
未找到文件。
cat-home/src/main/java/com/dianping/cat/build/ComponentsConfigurator.java
浏览文件 @
08808af6
...
...
@@ -32,7 +32,7 @@ import com.dianping.cat.report.graph.DefaultValueTranslater;
import
com.dianping.cat.report.graph.GraphBuilder
;
import
com.dianping.cat.report.graph.ValueTranslater
;
import
com.dianping.cat.report.page.PayloadNormalizer
;
import
com.dianping.cat.report.page.dependency.dashboard.
Dashboard
Config
;
import
com.dianping.cat.report.page.dependency.dashboard.
ProductLine
Config
;
import
com.dianping.cat.report.page.dependency.graph.TopologyGraphBuilder
;
import
com.dianping.cat.report.page.dependency.graph.TopologyGraphConfigManger
;
import
com.dianping.cat.report.page.dependency.graph.TopologyGraphItemBuilder
;
...
...
@@ -217,10 +217,10 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
// model service
all
.
addAll
(
new
ServiceComponentConfigurator
().
defineComponents
());
all
.
add
(
C
(
Dashboard
Config
.
class
));
all
.
add
(
C
(
ProductLine
Config
.
class
));
all
.
add
(
C
(
TopologyGraphManager
.
class
).
req
(
TopologyGraphBuilder
.
class
,
ServerConfigManager
.
class
)
//
.
req
(
Dashboard
Config
.
class
).
req
(
ModelService
.
class
,
"dependency"
));
.
req
(
ProductLine
Config
.
class
).
req
(
ModelService
.
class
,
"dependency"
));
// database
all
.
add
(
C
(
JdbcDataSourceConfigurationManager
.
class
)
//
...
...
cat-home/src/main/java/com/dianping/cat/helper/CatString.java
浏览文件 @
08808af6
...
...
@@ -30,4 +30,6 @@ public class CatString {
public
static
final
String
FAIL
=
"Fail"
;
public
static
final
String
TUAN_TOU
=
"TuanGou"
;
}
cat-home/src/main/java/com/dianping/cat/helper/Parse.java
0 → 100644
浏览文件 @
08808af6
package
com.dianping.cat.helper
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
public
interface
Parse
{
public
double
[]
compute
(
Map
<
Date
,
List
<
double
[]>>
datas
);
public
void
setDateNoUse
(
Date
start
,
Date
end
);
}
cat-home/src/main/java/com/dianping/cat/report/page/dependency/Action.java
浏览文件 @
08808af6
package
com.dianping.cat.report.page.dependency
;
public
enum
Action
implements
org
.
unidal
.
web
.
mvc
.
Action
{
VIEW
(
"view"
),
LINE_CHART
(
"view"
),
GRAPH
(
"dependencyGraph"
),
TOPOLOGY
(
"dependencyGraph"
),
DASHBOARD
(
"dashboard"
),;
DASHBOARD
(
"dashboard"
),
PRODUCT_LINE
(
"productLine"
);
private
String
m_name
;
...
...
cat-home/src/main/java/com/dianping/cat/report/page/dependency/Handler.java
浏览文件 @
08808af6
...
...
@@ -37,7 +37,9 @@ import com.dianping.cat.home.dependency.graph.transform.DefaultJsonBuilder;
import
com.dianping.cat.report.ReportPage
;
import
com.dianping.cat.report.page.LineChart
;
import
com.dianping.cat.report.page.PayloadNormalizer
;
import
com.dianping.cat.report.page.dependency.dashboard.DashboardGraph
;
import
com.dianping.cat.report.page.dependency.dashboard.ProductLineConfig
;
import
com.dianping.cat.report.page.dependency.dashboard.ProductLineDashboard
;
import
com.dianping.cat.report.page.dependency.dashboard.ProductLinesDashboard
;
import
com.dianping.cat.report.page.dependency.graph.GraphConstrant
;
import
com.dianping.cat.report.page.dependency.graph.LineGraphBuilder
;
import
com.dianping.cat.report.page.dependency.graph.TopologyGraphManager
;
...
...
@@ -48,6 +50,7 @@ import com.dianping.cat.report.page.model.spi.ModelResponse;
import
com.dianping.cat.report.page.model.spi.ModelService
;
public
class
Handler
implements
PageHandler
<
Context
>
{
@Inject
(
type
=
ModelService
.
class
,
value
=
"dependency"
)
private
ModelService
<
DependencyReport
>
m_dependencyService
;
...
...
@@ -60,18 +63,21 @@ public class Handler implements PageHandler<Context> {
@Inject
private
JspViewer
m_jspViewer
;
private
Set
<
String
>
m_nodes
;
@Inject
private
PayloadNormalizer
m_normalizePayload
;
@Inject
(
type
=
ModelService
.
class
,
value
=
"problem"
)
private
ModelService
<
ProblemReport
>
m_problemservice
;
private
Set
<
String
>
m_nodes
;
private
SimpleDateFormat
m_dateFormat
=
new
SimpleDateFormat
(
"yyyyMMddHH"
);
@Inject
private
ProductLineConfig
m_productLineConfig
;
private
SimpleDateFormat
m_sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
private
SimpleDateFormat
m_dateFormat
=
new
SimpleDateFormat
(
"yyyyMMddHH"
);
private
Segment
buildAllSegmentInfo
(
DependencyReport
report
)
{
Segment
result
=
new
Segment
();
Map
<
Integer
,
Segment
>
segments
=
report
.
getSegments
();
...
...
@@ -94,39 +100,6 @@ public class Handler implements PageHandler<Context> {
return
result
;
}
private
void
buildDashboardErrorInfo
(
DashboardGraph
dashboardGraph
,
Model
model
,
Payload
payload
)
{
Map
<
String
,
List
<
Node
>>
nodes
=
dashboardGraph
.
getNodes
();
Date
reportTime
=
new
Date
(
payload
.
getDate
()
+
TimeUtil
.
ONE_MINUTE
*
model
.
getMinute
());
for
(
Entry
<
String
,
List
<
Node
>>
entry
:
nodes
.
entrySet
())
{
for
(
Node
node
:
entry
.
getValue
())
{
String
domain
=
node
.
getId
();
List
<
Event
>
events
=
m_eventManager
.
queryEvents
(
domain
,
reportTime
);
node
.
setLink
(
buildLink
(
payload
,
model
,
domain
));
if
(
events
!=
null
&&
events
.
size
()
>
0
)
{
if
(
node
.
getStatus
()
==
GraphConstrant
.
OK
)
{
node
.
setStatus
(
GraphConstrant
.
OP_ERROR
);
}
node
.
setDes
(
node
.
getDes
()
+
buildZabbixHeader
(
payload
,
model
));
StringBuilder
sb
=
new
StringBuilder
();
for
(
Event
event
:
events
)
{
sb
.
append
(
m_sdf
.
format
(
event
.
getDate
())).
append
((
" "
));
sb
.
append
(
event
.
getSubject
()).
append
(
GraphConstrant
.
ENTER
);
}
node
.
setDes
(
node
.
getDes
()
+
sb
.
toString
());
}
if
(
node
.
getStatus
()
!=
GraphConstrant
.
OK
)
{
String
exceptionInfo
=
buildProblemInfo
(
domain
,
payload
);
node
.
setDes
(
node
.
getDes
()
+
exceptionInfo
);
}
}
}
}
private
void
buildExceptionInfoOnGraph
(
Payload
payload
,
Model
model
,
TopologyGraph
graph
)
{
if
(
graph
.
getStatus
()
!=
GraphConstrant
.
OK
)
{
String
problemInfo
=
buildProblemInfo
(
graph
.
getId
(),
payload
);
...
...
@@ -184,24 +157,6 @@ public class Handler implements PageHandler<Context> {
}
}
private
List
<
String
>
buildGraphList
(
List
<
LineChart
>
charts
)
{
List
<
String
>
result
=
new
ArrayList
<
String
>();
for
(
LineChart
temp
:
charts
)
{
result
.
add
(
temp
.
getJsonString
());
}
return
result
;
}
private
Map
<
String
,
List
<
String
>>
buildGraphMap
(
Map
<
String
,
List
<
LineChart
>>
charts
)
{
Map
<
String
,
List
<
String
>>
result
=
new
HashMap
<
String
,
List
<
String
>>();
for
(
Entry
<
String
,
List
<
LineChart
>>
temp
:
charts
.
entrySet
())
{
result
.
put
(
temp
.
getKey
(),
buildGraphList
(
temp
.
getValue
()));
}
return
result
;
}
private
void
buildHourlyLineGraph
(
DependencyReport
report
,
Model
model
)
{
LineGraphBuilder
builder
=
new
LineGraphBuilder
();
...
...
@@ -210,8 +165,8 @@ public class Handler implements PageHandler<Context> {
List
<
LineChart
>
index
=
builder
.
queryIndex
();
Map
<
String
,
List
<
LineChart
>>
dependencys
=
builder
.
queryDependencyGraph
();
model
.
setIndexGraph
(
build
GraphList
(
index
));
model
.
setDependencyGraph
(
buildGraphMap
(
dependencys
));
model
.
setIndexGraph
(
build
LineChartGraphs
(
index
));
model
.
setDependencyGraph
(
build
LineChart
GraphMap
(
dependencys
));
}
private
void
buildHourlyReport
(
DependencyReport
report
,
Model
model
,
Payload
payload
)
{
...
...
@@ -225,11 +180,56 @@ public class Handler implements PageHandler<Context> {
}
}
private
Map
<
String
,
List
<
String
>>
buildLineChartGraphMap
(
Map
<
String
,
List
<
LineChart
>>
charts
)
{
Map
<
String
,
List
<
String
>>
result
=
new
HashMap
<
String
,
List
<
String
>>();
for
(
Entry
<
String
,
List
<
LineChart
>>
temp
:
charts
.
entrySet
())
{
result
.
put
(
temp
.
getKey
(),
buildLineChartGraphs
(
temp
.
getValue
()));
}
return
result
;
}
private
List
<
String
>
buildLineChartGraphs
(
List
<
LineChart
>
charts
)
{
List
<
String
>
result
=
new
ArrayList
<
String
>();
for
(
LineChart
temp
:
charts
)
{
result
.
add
(
temp
.
getJsonString
());
}
return
result
;
}
private
String
buildLink
(
Payload
payload
,
Model
model
,
String
domain
)
{
return
String
.
format
(
"?op=dependencyGraph&minute=%s&domain=%s&date=%s"
,
model
.
getMinute
(),
domain
,
m_dateFormat
.
format
(
new
Date
(
payload
.
getDate
())));
}
private
void
buildNodeErrorInfo
(
Node
node
,
Model
model
,
Payload
payload
)
{
Date
reportTime
=
new
Date
(
payload
.
getDate
()
+
TimeUtil
.
ONE_MINUTE
*
model
.
getMinute
());
String
domain
=
node
.
getId
();
List
<
Event
>
events
=
m_eventManager
.
queryEvents
(
domain
,
reportTime
);
node
.
setLink
(
buildLink
(
payload
,
model
,
domain
));
if
(
events
!=
null
&&
events
.
size
()
>
0
)
{
if
(
node
.
getStatus
()
==
GraphConstrant
.
OK
)
{
node
.
setStatus
(
GraphConstrant
.
OP_ERROR
);
}
node
.
setDes
(
node
.
getDes
()
+
buildZabbixHeader
(
payload
,
model
));
StringBuilder
sb
=
new
StringBuilder
();
for
(
Event
event
:
events
)
{
sb
.
append
(
m_sdf
.
format
(
event
.
getDate
())).
append
((
" "
));
sb
.
append
(
event
.
getSubject
()).
append
(
GraphConstrant
.
ENTER
);
}
node
.
setDes
(
node
.
getDes
()
+
sb
.
toString
());
}
if
(
node
.
getStatus
()
!=
GraphConstrant
.
OK
)
{
String
exceptionInfo
=
buildProblemInfo
(
domain
,
payload
);
node
.
setDes
(
node
.
getDes
()
+
exceptionInfo
);
}
}
private
String
buildProblemInfo
(
String
domain
,
Payload
payload
)
{
ProblemReport
report
=
queryProblemReport
(
payload
,
domain
);
ExceptionInfoBuilder
visitor
=
new
ExceptionInfoBuilder
();
...
...
@@ -283,7 +283,7 @@ public class Handler implements PageHandler<Context> {
Date
reportTime
=
new
Date
(
payload
.
getDate
()
+
TimeUtil
.
ONE_MINUTE
*
model
.
getMinute
());
DependencyReport
report
=
queryDependencyReport
(
payload
);
switch
(
action
)
{
case
GRAPH
:
case
TOPOLOGY
:
TopologyGraph
topologyGraph
=
m_graphManager
.
buildGraphByDomainTime
(
model
.
getDomain
(),
reportTime
.
getTime
());
Map
<
String
,
List
<
String
>>
graphDependency
=
parseDependencies
(
topologyGraph
);
Map
<
String
,
List
<
Event
>>
externalErrors
=
queryDependencyEvent
(
graphDependency
,
model
.
getDomain
(),
reportTime
);
...
...
@@ -293,9 +293,11 @@ public class Handler implements PageHandler<Context> {
m_nodes
=
new
HashSet
<
String
>();
buildExternalErrorOnGraph
(
topologyGraph
,
buildZabbixHeader
(
payload
,
model
),
externalErrors
);
buildExceptionInfoOnGraph
(
payload
,
model
,
topologyGraph
);
model
.
setReportStart
(
new
Date
(
payload
.
getDate
()));
model
.
setReportEnd
(
new
Date
(
payload
.
getDate
()
+
TimeUtil
.
ONE_MINUTE
-
1
));
model
.
setTopologyGraph
(
new
DefaultJsonBuilder
().
buildJson
(
topologyGraph
));
break
;
case
VIEW
:
case
LINE_CHART
:
buildHourlyReport
(
report
,
model
,
payload
);
buildHourlyLineGraph
(
report
,
model
);
...
...
@@ -305,10 +307,36 @@ public class Handler implements PageHandler<Context> {
model
.
setEvents
(
queryDependencyEvent
(
dependency
,
model
.
getDomain
(),
reportTime
));
break
;
case
DASHBOARD:
DashboardGraph
dashboardGraph
=
m_graphManager
.
buildDashboardGraph
(
reportTime
.
getTime
());
ProductLinesDashboard
dashboardGraph
=
m_graphManager
.
buildDashboardGraph
(
reportTime
.
getTime
());
Map
<
String
,
List
<
Node
>>
dashboardNodes
=
dashboardGraph
.
getNodes
();
buildDashboardErrorInfo
(
dashboardGraph
,
model
,
payload
);
for
(
Entry
<
String
,
List
<
Node
>>
entry
:
dashboardNodes
.
entrySet
())
{
for
(
Node
node
:
entry
.
getValue
())
{
buildNodeErrorInfo
(
node
,
model
,
payload
);
}
}
model
.
setReportStart
(
new
Date
(
payload
.
getDate
()));
model
.
setReportEnd
(
new
Date
(
payload
.
getDate
()
+
TimeUtil
.
ONE_MINUTE
-
1
));
model
.
setDashboardGraph
(
dashboardGraph
.
toJson
());
model
.
setDashboardGraphData
(
dashboardGraph
);
break
;
case
PRODUCT_LINE:
String
productLine
=
payload
.
getProductLine
();
if
(
StringUtil
.
isEmpty
(
productLine
)){
payload
.
setProductLine
(
CatString
.
TUAN_TOU
);
productLine
=
CatString
.
TUAN_TOU
;
}
ProductLineDashboard
productLineGraph
=
m_graphManager
.
buildProductLineGraph
(
productLine
,
reportTime
.
getTime
());
List
<
Node
>
productLineNodes
=
productLineGraph
.
getNodes
();
for
(
Node
node
:
productLineNodes
)
{
buildNodeErrorInfo
(
node
,
model
,
payload
);
}
model
.
setReportStart
(
new
Date
(
payload
.
getDate
()));
model
.
setReportEnd
(
new
Date
(
payload
.
getDate
()
+
TimeUtil
.
ONE_MINUTE
-
1
));
model
.
setProductLineGraph
(
productLineGraph
.
toJson
());
model
.
setProductLines
(
new
ArrayList
<
String
>(
m_productLineConfig
.
queryProductLines
()));
break
;
}
m_jspViewer
.
view
(
ctx
,
model
);
...
...
@@ -316,7 +344,7 @@ public class Handler implements PageHandler<Context> {
private
void
normalize
(
Model
model
,
Payload
payload
)
{
model
.
setPage
(
ReportPage
.
DEPENDENCY
);
model
.
setAction
(
Action
.
VIEW
);
model
.
setAction
(
Action
.
LINE_CHART
);
m_normalizePayload
.
normalize
(
model
,
payload
);
...
...
@@ -353,7 +381,6 @@ public class Handler implements PageHandler<Context> {
targets
.
add
(
target
);
}
}
return
results
;
}
...
...
cat-home/src/main/java/com/dianping/cat/report/page/dependency/JspFile.java
浏览文件 @
08808af6
package
com.dianping.cat.report.page.dependency
;
public
enum
JspFile
{
VIEW
(
"/jsp/report
/dependency.jsp"
),
LINE_CHART
(
"/jsp/report/dependency
/dependency.jsp"
),
GRAPH
(
"/jsp/report
/dependencyTopologyGraph.jsp"
),
TOPOLOGY
(
"/jsp/report/dependency
/dependencyTopologyGraph.jsp"
),
DASHBOARD
(
"/jsp/report/dependencyDashboard.jsp"
),
DASHBOARD
(
"/jsp/report/dependency/dependencyDashboard.jsp"
),
PRODUCT_LINE
(
"/jsp/report/dependency/dependencyProductLine.jsp"
),
;
...
...
cat-home/src/main/java/com/dianping/cat/report/page/dependency/JspViewer.java
浏览文件 @
08808af6
...
...
@@ -10,12 +10,14 @@ public class JspViewer extends BaseJspViewer<ReportPage, Action, Context, Model>
Action
action
=
model
.
getAction
();
switch
(
action
)
{
case
VIEW
:
return
JspFile
.
VIEW
.
getPath
();
case
GRAPH
:
return
JspFile
.
GRAPH
.
getPath
();
case
LINE_CHART
:
return
JspFile
.
LINE_CHART
.
getPath
();
case
TOPOLOGY
:
return
JspFile
.
TOPOLOGY
.
getPath
();
case
DASHBOARD:
return
JspFile
.
DASHBOARD
.
getPath
();
case
PRODUCT_LINE:
return
JspFile
.
PRODUCT_LINE
.
getPath
();
}
throw
new
RuntimeException
(
"Unknown action: "
+
action
);
...
...
cat-home/src/main/java/com/dianping/cat/report/page/dependency/Model.java
浏览文件 @
08808af6
...
...
@@ -2,6 +2,7 @@ package com.dianping.cat.report.page.dependency;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
...
...
@@ -13,6 +14,7 @@ import com.dianping.cat.consumer.dependency.model.entity.DependencyReport;
import
com.dianping.cat.consumer.dependency.model.entity.Segment
;
import
com.dianping.cat.home.dal.report.Event
;
import
com.dianping.cat.report.page.AbstractReportModel
;
import
com.dianping.cat.report.page.dependency.dashboard.ProductLinesDashboard
;
import
com.dianping.cat.report.view.StringSortHelper
;
@ModelMeta
(
"dependecy"
)
...
...
@@ -38,6 +40,48 @@ public class Model extends AbstractReportModel<Action, Context> {
private
String
m_dashboardGraph
;
private
ProductLinesDashboard
m_dashboardGraphData
;
private
List
<
String
>
m_productLines
;
private
String
m_productLineGraph
;
private
Date
m_reportStart
;
private
Date
m_reportEnd
;
public
List
<
String
>
getProductLines
()
{
return
m_productLines
;
}
public
void
setProductLines
(
List
<
String
>
productLines
)
{
m_productLines
=
productLines
;
}
public
String
getProductLineGraph
()
{
return
m_productLineGraph
;
}
public
void
setProductLineGraph
(
String
productLineGraph
)
{
m_productLineGraph
=
productLineGraph
;
}
public
Date
getReportStart
()
{
return
m_reportStart
;
}
public
void
setReportStart
(
Date
reportStart
)
{
m_reportStart
=
reportStart
;
}
public
Date
getReportEnd
()
{
return
m_reportEnd
;
}
public
void
setReportEnd
(
Date
reportEnd
)
{
m_reportEnd
=
reportEnd
;
}
public
String
getDashboardGraph
()
{
return
m_dashboardGraph
;
}
...
...
@@ -84,7 +128,7 @@ public class Model extends AbstractReportModel<Action, Context> {
@Override
public
Action
getDefaultAction
()
{
return
Action
.
VIEW
;
return
Action
.
LINE_CHART
;
}
@Override
...
...
@@ -146,4 +190,13 @@ public class Model extends AbstractReportModel<Action, Context> {
m_topologyGraph
=
topologyGraph
;
}
public
ProductLinesDashboard
getDashboardGraphData
()
{
return
m_dashboardGraphData
;
}
public
void
setDashboardGraphData
(
ProductLinesDashboard
dashboardGraphData
)
{
m_dashboardGraphData
=
dashboardGraphData
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/dependency/Payload.java
浏览文件 @
08808af6
...
...
@@ -8,16 +8,19 @@ import com.dianping.cat.report.page.AbstractReportPayload;
public
class
Payload
extends
AbstractReportPayload
<
Action
>
{
@FieldMeta
(
"minute"
)
private
String
minute
;
private
String
m
_m
inute
;
@FieldMeta
(
"all"
)
private
boolean
all
;
private
boolean
m_
all
;
private
ReportPage
m_page
;
@FieldMeta
(
"op"
)
private
Action
m_action
;
@FieldMeta
(
"productLine"
)
private
String
productLine
;
public
Payload
()
{
super
(
ReportPage
.
DEPENDENCY
);
}
...
...
@@ -28,7 +31,7 @@ public class Payload extends AbstractReportPayload<Action> {
}
public
String
getMinute
()
{
return
minute
;
return
m
_m
inute
;
}
@Override
...
...
@@ -37,11 +40,11 @@ public class Payload extends AbstractReportPayload<Action> {
}
public
void
setAction
(
String
action
)
{
m_action
=
Action
.
getByName
(
action
,
Action
.
VIEW
);
m_action
=
Action
.
getByName
(
action
,
Action
.
LINE_CHART
);
}
public
void
setMinute
(
String
minute
)
{
this
.
minute
=
minute
;
this
.
m
_m
inute
=
minute
;
}
@Override
...
...
@@ -52,16 +55,24 @@ public class Payload extends AbstractReportPayload<Action> {
@Override
public
void
validate
(
ActionContext
<?>
ctx
)
{
if
(
m_action
==
null
)
{
m_action
=
Action
.
VIEW
;
m_action
=
Action
.
LINE_CHART
;
}
}
public
boolean
isAll
()
{
return
all
;
return
m_
all
;
}
public
void
setAll
(
boolean
all
)
{
this
.
all
=
all
;
this
.
m_all
=
all
;
}
public
String
getProductLine
()
{
return
productLine
;
}
public
void
setProductLine
(
String
productLine
)
{
this
.
productLine
=
productLine
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/dependency/dashboard/
Dashboard
Config.java
→
cat-home/src/main/java/com/dianping/cat/report/page/dependency/dashboard/
ProductLine
Config.java
浏览文件 @
08808af6
...
...
@@ -2,23 +2,28 @@ package com.dianping.cat.report.page.dependency.dashboard;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.TreeMap
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
;
public
class
Dashboard
Config
implements
Initializable
{
public
class
ProductLine
Config
implements
Initializable
{
private
Map
<
String
,
Group
>
m_groups
=
new
LinkedHash
Map
<
String
,
Group
>();
private
Map
<
String
,
Group
>
m_groups
=
new
Tree
Map
<
String
,
Group
>();
private
Set
<
String
>
m_allDomains
=
new
HashSet
<
String
>();
public
boolean
contains
(
String
domain
){
public
Set
<
String
>
queryProductLines
()
{
return
m_groups
.
keySet
();
}
public
boolean
contains
(
String
domain
)
{
return
m_allDomains
.
contains
(
domain
);
}
public
Map
<
String
,
Group
>
getGroups
()
{
return
m_groups
;
}
...
...
cat-home/src/main/java/com/dianping/cat/report/page/dependency/dashboard/ProductLineDashboard.java
0 → 100644
浏览文件 @
08808af6
package
com.dianping.cat.report.page.dependency.dashboard
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.dianping.cat.home.dependency.graph.entity.Node
;
import
com.dianping.cat.report.page.dependency.graph.GraphConstrant
;
import
com.google.gson.Gson
;
public
class
ProductLineDashboard
{
private
String
id
;
private
String
type
=
GraphConstrant
.
PROJECT
;
private
int
status
;
private
String
des
;
private
List
<
Node
>
nodes
=
new
ArrayList
<
Node
>();
public
ProductLineDashboard
(
String
productLine
)
{
id
=
productLine
;
}
public
ProductLineDashboard
addNode
(
Node
node
)
{
nodes
.
add
(
node
);
return
this
;
}
public
List
<
Node
>
getNodes
()
{
return
nodes
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
int
getStatus
()
{
return
status
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
String
getDes
()
{
return
des
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
void
setDes
(
String
des
)
{
this
.
des
=
des
;
}
public
List
<
Node
>
getPoints
()
{
return
nodes
;
}
public
void
setPoints
(
List
<
Node
>
points
)
{
this
.
nodes
=
points
;
}
public
String
toJson
()
{
String
str
=
new
Gson
().
toJson
(
this
);
str
=
str
.
replaceAll
(
"\"m_"
,
"\""
);
str
=
str
.
replaceAll
(
"\"nodes\""
,
"\"points\""
);
return
str
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/dependency/dashboard/
DashboardGraph
.java
→
cat-home/src/main/java/com/dianping/cat/report/page/dependency/dashboard/
ProductLinesDashboard
.java
浏览文件 @
08808af6
...
...
@@ -9,7 +9,7 @@ import com.dianping.cat.home.dependency.graph.entity.Node;
import
com.dianping.cat.home.dependency.graph.entity.Edge
;
import
com.google.gson.Gson
;
public
class
DashboardGraph
{
public
class
ProductLinesDashboard
{
private
Map
<
String
,
List
<
Node
>>
productLines
=
new
LinkedHashMap
<
String
,
List
<
Node
>>();
...
...
@@ -18,14 +18,16 @@ public class DashboardGraph {
private
transient
Map
<
String
,
Node
>
temp
=
new
LinkedHashMap
<
String
,
Node
>();
public
String
toJson
()
{
return
new
Gson
().
toJson
(
this
);
String
str
=
new
Gson
().
toJson
(
this
);
str
=
str
.
replaceAll
(
"\"m_"
,
"\""
);
return
str
;
}
public
boolean
exsit
(
Node
node
)
{
return
temp
.
containsKey
(
node
.
getId
());
}
public
DashboardGraph
addNode
(
String
productLine
,
Node
node
)
{
public
ProductLinesDashboard
addNode
(
String
productLine
,
Node
node
)
{
List
<
Node
>
nodeList
=
productLines
.
get
(
productLine
);
if
(
nodeList
==
null
)
{
...
...
@@ -37,7 +39,7 @@ public class DashboardGraph {
return
this
;
}
public
DashboardGraph
addEdge
(
Edge
edge
)
{
public
ProductLinesDashboard
addEdge
(
Edge
edge
)
{
edges
.
add
(
edge
);
return
this
;
}
...
...
cat-home/src/main/java/com/dianping/cat/report/page/dependency/graph/TopologyGraphManager.java
浏览文件 @
08808af6
...
...
@@ -18,16 +18,16 @@ import org.unidal.lookup.annotation.Inject;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.configuration.ServerConfigManager
;
import
com.dianping.cat.consumer.dependency.model.entity.DependencyReport
;
import
com.dianping.cat.home.dependency.graph.transform.BaseVisitor
;
import
com.dianping.cat.helper.TimeUtil
;
import
com.dianping.cat.home.dependency.graph.entity.Edge
;
import
com.dianping.cat.home.dependency.graph.entity.Node
;
import
com.dianping.cat.home.dependency.graph.entity.TopologyGraph
;
import
com.dianping.cat.message.Message
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.report.page.dependency.dashboard.DashboardConfig
;
import
com.dianping.cat.report.page.dependency.dashboard.DashboardConfig.Group
;
import
com.dianping.cat.report.page.dependency.dashboard.DashboardGraph
;
import
com.dianping.cat.report.page.dependency.dashboard.ProductLineConfig
;
import
com.dianping.cat.report.page.dependency.dashboard.ProductLineConfig.Group
;
import
com.dianping.cat.report.page.dependency.dashboard.ProductLineDashboard
;
import
com.dianping.cat.report.page.dependency.dashboard.ProductLinesDashboard
;
import
com.dianping.cat.report.page.model.spi.ModelPeriod
;
import
com.dianping.cat.report.page.model.spi.ModelRequest
;
import
com.dianping.cat.report.page.model.spi.ModelResponse
;
...
...
@@ -46,7 +46,7 @@ public class TopologyGraphManager implements Initializable, LogEnabled {
private
ServerConfigManager
m_manager
;
@Inject
private
DashboardConfig
m_dashboard
Config
;
private
ProductLineConfig
m_productLine
Config
;
private
Map
<
Long
,
TopologyGraph
>
m_topologyGraphs
=
new
ConcurrentHashMap
<
Long
,
TopologyGraph
>(
360
);
...
...
@@ -54,12 +54,32 @@ public class TopologyGraphManager implements Initializable, LogEnabled {
private
static
final
String
DEPENDENCY
=
"Dependency"
;
public
DashboardGraph
buildDashboardGraph
(
long
time
)
{
public
ProductLineDashboard
buildProductLineGraph
(
String
productLine
,
long
time
)
{
TopologyGraph
topologyGraph
=
queryGraph
(
time
);
DashboardGraph
dashboardGraph
=
new
DashboardGraph
();
ProductLineDashboard
dashboard
=
new
ProductLineDashboard
(
productLine
);
Group
group
=
m_productLineConfig
.
getGroups
().
get
(
productLine
);
if
(
group
!=
null
)
{
List
<
String
>
domains
=
group
.
getDomains
();
if
(
topologyGraph
!=
null
)
{
Map
<
String
,
Group
>
groups
=
m_dashboardConfig
.
getGroups
();
for
(
String
domain
:
domains
)
{
Node
node
=
topologyGraph
.
findNode
(
domain
);
if
(
node
!=
null
)
{
dashboard
.
addNode
(
m_graphBuilder
.
cloneNode
(
node
));
}
}
}
}
return
dashboard
;
}
public
ProductLinesDashboard
buildDashboardGraph
(
long
time
)
{
TopologyGraph
topologyGraph
=
queryGraph
(
time
);
ProductLinesDashboard
dashboardGraph
=
new
ProductLinesDashboard
();
if
(
topologyGraph
!=
null
)
{
Map
<
String
,
Group
>
groups
=
m_productLineConfig
.
getGroups
();
for
(
Entry
<
String
,
Group
>
entry
:
groups
.
entrySet
())
{
String
groupName
=
entry
.
getKey
();
...
...
@@ -79,7 +99,7 @@ public class TopologyGraphManager implements Initializable, LogEnabled {
String
self
=
edge
.
getSelf
();
String
to
=
edge
.
getTarget
();
if
(
m_
dashboardConfig
.
contains
(
self
)
&&
m_dashboard
Config
.
contains
(
to
))
{
if
(
m_
productLineConfig
.
contains
(
self
)
&&
m_productLine
Config
.
contains
(
to
))
{
dashboardGraph
.
addEdge
(
m_graphBuilder
.
cloneEdge
(
edge
));
}
}
...
...
cat-home/src/main/java/com/dianping/cat/report/page/top/Payload.java
浏览文件 @
08808af6
...
...
@@ -15,10 +15,32 @@ public class Payload extends AbstractReportPayload<Action> {
@FieldMeta
(
"count"
)
private
int
m_count
;
@FieldMeta
(
"second"
)
private
int
m_second
;
@FieldMeta
(
"refresh"
)
private
boolean
m_refresh
;
public
int
getSecond
()
{
return
m_second
;
}
public
void
setSecond
(
int
second
)
{
m_second
=
second
;
}
public
Payload
()
{
super
(
ReportPage
.
TOP
);
}
public
boolean
getRefresh
()
{
return
m_refresh
;
}
public
void
setRefresh
(
boolean
refresh
)
{
m_refresh
=
refresh
;
}
@Override
public
Action
getAction
()
{
return
m_action
;
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
08808af6
...
...
@@ -1194,8 +1194,8 @@
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.page.dependency.dashboard.
Dashboard
Config
</role>
<implementation>
com.dianping.cat.report.page.dependency.dashboard.
Dashboard
Config
</implementation>
<role>
com.dianping.cat.report.page.dependency.dashboard.
ProductLine
Config
</role>
<implementation>
com.dianping.cat.report.page.dependency.dashboard.
ProductLine
Config
</implementation>
</component>
<component>
<role>
com.dianping.cat.report.page.dependency.graph.TopologyGraphManager
</role>
...
...
@@ -1208,7 +1208,7 @@
<role>
com.dianping.cat.configuration.ServerConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.dependency.dashboard.
Dashboard
Config
</role>
<role>
com.dianping.cat.report.page.dependency.dashboard.
ProductLine
Config
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.model.spi.ModelService
</role>
...
...
@@ -2529,35 +2529,29 @@
<implementation>
com.dianping.cat.report.page.dependency.Handler
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.report.page.dependency.JspViewer
</role>
<role>
com.dianping.cat.report.page.model.spi.ModelService
</role>
<role-hint>
dependency
</role-hint>
<field-name>
m_dependencyService
</field-name>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.externalError.EventCollectManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.model.spi.ModelService
</role>
<role-hint>
dependency
</role-hint>
<field-name>
m_dependencyService
</field-name>
<role>
com.dianping.cat.report.page.dependency.graph.TopologyGraphManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.
PayloadNormaliz
er
</role>
<role>
com.dianping.cat.report.page.
dependency.JspView
er
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.
dependency.graph.TopologyGraphManag
er
</role>
<role>
com.dianping.cat.report.page.
PayloadNormaliz
er
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.model.spi.ModelService
</role>
<role-hint>
problem
</role-hint>
<field-name>
m_problemservice
</field-name>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.page.dependency.JspViewer
</role>
<implementation>
com.dianping.cat.report.page.dependency.JspViewer
</implementation>
<requirements>
<requirement>
<role>
org.unidal.web.mvc.view.model.ModelHandler
</role>
<role>
com.dianping.cat.report.page.dependency.dashboard.ProductLineConfig
</role>
</requirement>
</requirements>
</component>
...
...
@@ -2598,7 +2592,7 @@
<role>
com.dianping.cat.configuration.ServerConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.dependency.dashboard.
Dashboard
Config
</role>
<role>
com.dianping.cat.report.page.dependency.dashboard.
ProductLine
Config
</role>
</requirement>
</requirements>
</component>
...
...
@@ -2607,8 +2601,17 @@
<implementation>
com.dianping.cat.report.page.dependency.graph.TopologyGraphBuilder
</implementation>
</component>
<component>
<role>
com.dianping.cat.report.page.dependency.dashboard.DashboardConfig
</role>
<implementation>
com.dianping.cat.report.page.dependency.dashboard.DashboardConfig
</implementation>
<role>
com.dianping.cat.report.page.dependency.dashboard.ProductLineConfig
</role>
<implementation>
com.dianping.cat.report.page.dependency.dashboard.ProductLineConfig
</implementation>
</component>
<component>
<role>
com.dianping.cat.report.page.dependency.JspViewer
</role>
<implementation>
com.dianping.cat.report.page.dependency.JspViewer
</implementation>
<requirements>
<requirement>
<role>
org.unidal.web.mvc.view.model.ModelHandler
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.page.externalError.Handler
</role>
...
...
cat-home/src/main/webapp/jsp/report/dependency.jsp
→
cat-home/src/main/webapp/jsp/report/dependency
/dependency
.jsp
浏览文件 @
08808af6
...
...
@@ -22,15 +22,14 @@
<div
class=
'report'
>
<div
class=
"row-fluid"
>
<div
class=
"span12 text-center"
>
<a
class=
"btn btn-danger btn-primary"
href=
"?op=dependencyGraph&minute=${model.minute}&domain=${model.domain}&date=${model.date}"
>
切换到实时拓扑图
</a>
<a
class=
"btn btn-danger btn-primary"
href=
"?op=dashboard&minute=${model.minute}&domain=${model.domain}&date=${model.date}"
>
切换到产品线监控大盘
</a>
<%@ include
file=
"dependencyOpNav.jsp"
%>
</div>
</div>
<div
class=
"tabbable text-error"
id=
"content"
>
<!-- Only required for left/right tabs -->
<ul
class=
"nav nav-tabs"
>
<li
style=
"margin-left:20px;"
class=
"text-right active"
><a
href=
"#tab1"
data-toggle=
"tab"
>
数据趋势(项目以及依赖项目)
</a></li>
<li
class=
"text-right"
><a
href=
"#tab2"
data-toggle=
"tab"
>
运维告警(Zabbix告警信息)
</a></li>
<li
class=
"text-right"
><a
href=
"#tab3"
data-toggle=
"tab"
>
详细数据(Detail以及配置)
</a></li>
<li
style=
"margin-left:20px;"
class=
"text-right active"
><a
href=
"#tab1"
data-toggle=
"tab"
>
<strong>
项目指标以及依赖项目数据趋势
</strong>
</a></li>
<li
class=
"text-right"
><a
href=
"#tab2"
data-toggle=
"tab"
>
<strong>
运维Zabbix告警信息
</strong>
</a></li>
<li
class=
"text-right"
><a
href=
"#tab3"
data-toggle=
"tab"
>
<strong>
详细数据以及配置
</strong>
</a></li>
</ul>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"tab1"
>
...
...
@@ -47,7 +46,7 @@
<c:if
test=
"
${
payload
.
all
==
false
}
"
>
${model.minute}
</c:if>
分钟
</h4>
</div>
<div
class=
"span10"
>
<%@ include
file=
"dependency
Header
.jsp"
%>
<%@ include
file=
"dependency
TimeNav
.jsp"
%>
</div>
</div>
<%@ include
file=
"dependencyDetailData.jsp"
%>
...
...
cat-home/src/main/webapp/jsp/report/dependencyDashboard.jsp
→
cat-home/src/main/webapp/jsp/report/dependency
/dependency
Dashboard.jsp
浏览文件 @
08808af6
...
...
@@ -9,7 +9,7 @@
<a:report
title=
"Dependency Report"
navUrlPrefix=
"domain=${model.domain}&op=dependencyGraph"
>
<jsp:attribute
name=
"subtitle"
>
From ${w:format(model.report
.startTime,'yyyy-MM-dd HH:mm:ss')} to ${w:format(model.report.endTime
,'yyyy-MM-dd HH:mm:ss')}
</jsp:attribute>
<jsp:attribute
name=
"subtitle"
>
From ${w:format(model.report
Start,'yyyy-MM-dd HH:mm:ss')} to ${w:format(model.reportEnd
,'yyyy-MM-dd HH:mm:ss')}
</jsp:attribute>
<jsp:body>
<res:useCss
value=
'
${
res
.
css
.
local
.
table_css
}
'
target=
"head-css"
/>
...
...
@@ -20,7 +20,22 @@
<res:useJs
value=
"
${
res
.
js
.
local
[
'jquery.validate.min.js'
]
}
"
target=
"head-js"
/>
<div
class=
"report"
>
<%@ include
file=
"dependencyDashboardNav.jsp"
%>
<div
class=
"row-fluid"
>
<div
class=
"span12 text-center"
>
<%@ include
file=
"dependencyOpNav.jsp"
%>
<%@ include
file=
"dependencyTimeNav.jsp"
%>
</div></div>
<div
class=
"tabbable tabs-left "
id=
"content"
>
<ul
class=
"nav nav-tabs alert-info"
>
<li
style=
"margin-left:20px;"
class=
"text-right active"
><a
href=
"#tab1"
data-toggle=
"tab"
><strong>
产品线监控
</strong></a></li>
<li
class=
"text-right"
><a
href=
"#tab2"
data-toggle=
"tab"
><strong>
TOP异常
</strong></a></li>
</ul>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"tab1"
>
</div>
<div
class=
"tab-pane"
id=
"tab2"
>
</div>
</div>
</div>
</jsp:body>
</a:report>
...
...
cat-home/src/main/webapp/jsp/report/dependencyDetailData.jsp
→
cat-home/src/main/webapp/jsp/report/dependency
/dependency
DetailData.jsp
浏览文件 @
08808af6
文件已移动
cat-home/src/main/webapp/jsp/report/dependencyEvent.jsp
→
cat-home/src/main/webapp/jsp/report/dependency
/dependency
Event.jsp
浏览文件 @
08808af6
文件已移动
cat-home/src/main/webapp/jsp/report/dependencyLineGraph.jsp
→
cat-home/src/main/webapp/jsp/report/dependency
/dependency
LineGraph.jsp
浏览文件 @
08808af6
...
...
@@ -24,7 +24,7 @@
<h4
class=
'text-error text-center'
>
当前小时内项目依赖指标趋势图
</h4>
<table>
<c:forEach
var=
"charts"
items=
"
${
model
.
dependencyGraph
}
"
varStatus=
"type"
>
<th
colspan=
"3"
><h4
class=
'text-center text-
warning
'
>
${charts.key}
</h4></th>
<th
colspan=
"3"
><h4
class=
'text-center text-
success
'
>
${charts.key}
</h4></th>
<c:set
var=
"key"
value=
"
${
charts
.
key
}
"
/>
<c:set
var=
"value"
value=
"
${
charts
.
value
}
"
/>
<tr>
...
...
cat-home/src/main/webapp/jsp/report/dependency/dependencyOpNav.jsp
0 → 100644
浏览文件 @
08808af6
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<div
class=
"text-center"
>
<a
class=
"btn btn-danger btn-primary"
href=
"?minute=${model.minute}&domain=${model.domain}&date=${model.date}"
>
实时趋势图
</a>
<a
class=
"btn btn-danger btn-primary"
href=
"?op=dependencyGraph&minute=${model.minute}&domain=${model.domain}&date=${model.date}"
>
实时拓扑图
</a>
<a
class=
"btn btn-danger btn-primary"
href=
"?op=productLine&minute=${model.minute}&domain=${model.domain}&date=${model.date}"
>
产品线监控
</a>
<a
class=
"btn btn-danger btn-primary"
href=
"?op=dashboard&minute=${model.minute}&domain=${model.domain}&date=${model.date}"
>
应用监控大盘
</a>
</div>
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/dependency/dependencyProductLine.jsp
0 → 100644
浏览文件 @
08808af6
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<%@ taglib
prefix=
"a"
uri=
"/WEB-INF/app.tld"
%>
<%@ taglib
prefix=
"w"
uri=
"http://www.unidal.org/web/core"
%>
<%@ taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%>
<%@ taglib
prefix=
"res"
uri=
"http://www.unidal.org/webres"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.dependency.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.dependency.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.dependency.Model"
scope=
"request"
/>
<a:report
title=
"Dependency Report"
navUrlPrefix=
"domain=${model.domain}&op=productLine&productLine=${payload.productLine}"
>
<jsp:attribute
name=
"subtitle"
>
From ${w:format(model.reportStart,'yyyy-MM-dd HH:mm:ss')} to ${w:format(model.reportEnd,'yyyy-MM-dd HH:mm:ss')}
</jsp:attribute>
<jsp:body>
<res:useCss
value=
'
${
res
.
css
.
local
.
table_css
}
'
target=
"head-css"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'jquery.dataTables.min.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'startopo.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'raphael-min.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'dependencyConfig.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'jquery.validate.min.js'
]
}
"
target=
"head-js"
/>
<div
class=
"report"
>
<div
class=
'text-center'
>
<%@ include
file=
"dependencyOpNav.jsp"
%>
<%@ include
file=
"dependencyTimeNav.jsp"
%>
</div>
<div
class=
"row-fluid"
>
<div
class=
"span2"
>
<div
class=
"well sidebar-nav"
>
<ul
class=
"nav nav-list"
>
<c:forEach
var=
"item"
items=
"
${
model
.
productLines
}
"
varStatus=
"status"
>
<li
class=
"text-left"
id=
"tab${item}"
><a
href=
"?op=productLine&productLine=${item}&minute=${model.minute}&domain=${model.domain}&date=${model.date}"
>
${item}
</a></li>
</c:forEach></ul></div></div>
<div
class=
"span10"
>
<div
class=
"text-center"
id=
"container"
style=
"width:1000px;height:600px;border:solid 1px #ccc;"
></div>
</div>
</div>
</div>
</jsp:body>
</a:report>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#minute
'
+
$
{
model
.
minute
}).
addClass
(
'
disabled
'
);
$
(
'
#tab
'
+
'
${payload.productLine}
'
).
addClass
(
'
active
'
);
var
data
=
$
{
model
.
productLineGraph
};
console
.
log
(
data
);
function
parse
(
data
){
var
nodes
=
data
.
nodes
;
var
points
=
[];
var
sides
=
[];
for
(
var
o
in
nodes
){
if
(
nodes
.
hasOwnProperty
(
o
)){
points
.
push
(
nodes
[
o
]);
}
}
for
(
var
o
in
data
.
edges
){
if
(
data
.
edges
.
hasOwnProperty
(
o
)){
sides
.
push
(
data
.
edges
[
o
]);
}
}
data
.
points
=
points
;
data
.
sides
=
sides
;
delete
data
.
nodes
;
delete
data
.
edges
;
return
data
;
}
new
StarTopo
(
'
container
'
,
data
,{
typeMap
:{
database
:
'
rect
'
,
project
:
'
circle
'
,
service
:
'
lozenge
'
},
colorMap
:{
"
1
"
:
'
#2fbf2f
'
,
"
2
"
:
'
#bfa22f
'
,
"
3
"
:
'
#b94a48
'
,
"
4
"
:
'
#772fbf
'
},
radius
:
300
,
sideWeight
:
function
(
weight
){
return
weight
+
1
},
nodeWeight
:
function
(
weight
){
return
weight
/
5
+
0.8
;
}});
});
</script>
<style>
.pagination
{
margin
:
4px
0
;
}
.pagination
ul
{
margin-top
:
0px
;
}
.pagination
ul
>
li
>
a
,
.pagination
ul
>
li
>
span
{
padding
:
3px
10px
;
}
</style>
cat-home/src/main/webapp/jsp/report/dependency
Header
.jsp
→
cat-home/src/main/webapp/jsp/report/dependency
/dependencyTimeNav
.jsp
浏览文件 @
08808af6
...
...
@@ -5,12 +5,12 @@
<ul>
</c:if>
<c:if
test=
"
${
item
>
model
.
maxMinute
}
"
><li
class=
"disabled"
id=
"minute${item}"
><a
href=
"?
domain=${model.domain}&date=${model.date}&minute=${item}"
>
id=
"href${item}"
href=
"?op=${payload.action.name}&
domain=${model.domain}&date=${model.date}&minute=${item}"
>
<c:if
test=
"
${
item
<
10
}
"
>
0${item}
</c:if>
<c:if
test=
"
${
item
>=
10
}
"
>
${item}
</c:if></a></li>
</c:if>
<c:if
test=
"
${
item
<=
model
.
maxMinute
}
"
><li
id=
"minute${item}"
><a
href=
"?
domain=${model.domain}&date=${model.date}&minute=${item}"
>
id=
"href${item}"
href=
"?op=${payload.action.name}&
domain=${model.domain}&date=${model.date}&minute=${item}"
>
<c:if
test=
"
${
item
<
10
}
"
>
0${item}
</c:if>
<c:if
test=
"
${
item
>=
10
}
"
>
${item}
</c:if></a></li>
</c:if>
...
...
@@ -19,3 +19,8 @@
</div>
</c:if>
</c:forEach>
<script
type=
"text/javascript"
>
$
(
'
#href${model.minute}
'
).
css
(
'
color
'
,
"
red
"
);
$
(
'
#href${model.minute}
'
).
css
(
'
font-weight
'
,
"
bold
"
);
</script>
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/dependencyTopologyGraph.jsp
→
cat-home/src/main/webapp/jsp/report/dependency
/dependency
TopologyGraph.jsp
浏览文件 @
08808af6
...
...
@@ -9,7 +9,7 @@
<a:report
title=
"Dependency Report"
navUrlPrefix=
"domain=${model.domain}&op=dependencyGraph"
>
<jsp:attribute
name=
"subtitle"
>
From ${w:format(model.report
.startTime,'yyyy-MM-dd HH:mm:ss')} to ${w:format(model.report.endTime
,'yyyy-MM-dd HH:mm:ss')}
</jsp:attribute>
<jsp:attribute
name=
"subtitle"
>
From ${w:format(model.report
Start,'yyyy-MM-dd HH:mm:ss')} to ${w:format(model.reportEnd
,'yyyy-MM-dd HH:mm:ss')}
</jsp:attribute>
<jsp:body>
<res:useCss
value=
'
${
res
.
css
.
local
.
table_css
}
'
target=
"head-css"
/>
...
...
@@ -20,12 +20,16 @@
<res:useJs
value=
"
${
res
.
js
.
local
[
'jquery.validate.min.js'
]
}
"
target=
"head-js"
/>
<div
class=
"report"
>
<%@ include
file=
"dependencyTopologyGraphNav.jsp"
%>
<div
class=
"row-fluid"
>
<div
class=
"span12 text-center"
>
<%@ include
file=
"dependencyOpNav.jsp"
%>
<%@ include
file=
"dependencyTimeNav.jsp"
%>
</div></div>
<div
class=
"tabbable tabs-left "
id=
"content"
>
<!-- Only required for left/right tabs -->
<ul
class=
"nav nav-tabs alert-info"
>
<li
style=
"margin-left:20px;"
class=
"text-right active"
><a
href=
"#tab1"
data-toggle=
"tab"
>
依赖拓扑
</a></li>
<li
class=
"text-right"
><a
href=
"#tab2"
data-toggle=
"tab"
>
运维告警
</a></li>
<li
class=
"text-right"
><a
href=
"#tab3"
data-toggle=
"tab"
>
数据配置
</a></li>
<li
style=
"margin-left:20px;"
class=
"text-right active"
><a
href=
"#tab1"
data-toggle=
"tab"
>
<strong>
依赖拓扑
</strong>
</a></li>
<li
class=
"text-right"
><a
href=
"#tab2"
data-toggle=
"tab"
>
<strong>
运维告警
</strong>
</a></li>
<li
class=
"text-right"
><a
href=
"#tab3"
data-toggle=
"tab"
>
<strong>
数据配置
</strong>
</a></li>
</ul>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"tab1"
>
...
...
@@ -53,6 +57,7 @@
});
$
(
'
#minute
'
+
$
{
model
.
minute
}).
addClass
(
'
disabled
'
);
$
(
'
#minute
'
+
$
{
model
.
minute
}).
addClass
(
'
text-error
'
);
$
(
'
#zabbixTab0
'
).
addClass
(
'
active
'
);
$
(
'
#leftTab0
'
).
addClass
(
'
active
'
);
$
(
'
.contents
'
).
dataTable
({
...
...
cat-home/src/main/webapp/jsp/report/dependencyDashboardNav.jsp
已删除
100644 → 0
浏览文件 @
32ac725c
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<div
class=
'text-center'
>
<a
class=
"btn btn-danger btn-primary"
href=
"?minute=${model.minute}&domain=${model.domain}&date=${model.date}"
>
切换到实时趋势图(当前分钟:${model.minute})
</a>
<c:forEach
var=
"item"
items=
"
${
model
.
minutes
}
"
varStatus=
"status"
>
<c:if
test=
"
${
status
.
index
%
30
==
0
}
"
>
<div
class=
"pagination"
>
<ul>
</c:if>
<c:if
test=
"
${
item
>
model
.
maxMinute
}
"
><li
class=
"disabled"
id=
"minute${item}"
><a
href=
"?op=dependencyGraph&domain=${model.domain}&date=${model.date}&minute=${item}"
>
<c:if
test=
"
${
item
<
10
}
"
>
0${item}
</c:if>
<c:if
test=
"
${
item
>=
10
}
"
>
${item}
</c:if></a></li>
</c:if>
<c:if
test=
"
${
item
<=
model
.
maxMinute
}
"
><li
id=
"minute${item}"
><a
href=
"?op=dependencyGraph&domain=${model.domain}&date=${model.date}&minute=${item}"
>
<c:if
test=
"
${
item
<
10
}
"
>
0${item}
</c:if>
<c:if
test=
"
${
item
>=
10
}
"
>
${item}
</c:if></a></li>
</c:if>
<c:if
test=
"
${
status
.
index
%
30
==
29
||
status
.
last
}
"
>
</ul>
</div>
</c:if>
</c:forEach>
</div>
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/dependencyTopologyGraphNav.jsp
已删除
100644 → 0
浏览文件 @
32ac725c
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<div
class=
'text-center'
>
<span
class=
'text-error'
><strong>
(当前分钟:${model.minute})
</strong></span><a
class=
"btn btn-danger btn-primary"
href=
"?minute=${model.minute}&domain=${model.domain}&date=${model.date}"
>
切换到实时趋势图
</a>
<a
class=
"btn btn-danger btn-primary"
href=
"?op=dashboard&minute=${model.minute}&domain=${model.domain}&date=${model.date}"
>
切换到产品线监控大盘
</a>
<c:forEach
var=
"item"
items=
"
${
model
.
minutes
}
"
varStatus=
"status"
>
<c:if
test=
"
${
status
.
index
%
30
==
0
}
"
>
<div
class=
"pagination"
>
<ul>
</c:if>
<c:if
test=
"
${
item
>
model
.
maxMinute
}
"
><li
class=
"disabled"
id=
"minute${item}"
><a
href=
"?op=dependencyGraph&domain=${model.domain}&date=${model.date}&minute=${item}"
>
<c:if
test=
"
${
item
<
10
}
"
>
0${item}
</c:if>
<c:if
test=
"
${
item
>=
10
}
"
>
${item}
</c:if></a></li>
</c:if>
<c:if
test=
"
${
item
<=
model
.
maxMinute
}
"
><li
id=
"minute${item}"
><a
href=
"?op=dependencyGraph&domain=${model.domain}&date=${model.date}&minute=${item}"
>
<c:if
test=
"
${
item
<
10
}
"
>
0${item}
</c:if>
<c:if
test=
"
${
item
>=
10
}
"
>
${item}
</c:if></a></li>
</c:if>
<c:if
test=
"
${
status
.
index
%
30
==
29
||
status
.
last
}
"
>
</ul>
</div>
</c:if>
</c:forEach>
</div>
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/top.jsp
浏览文件 @
08808af6
...
...
@@ -14,11 +14,22 @@
border-collapse
:
collapse
;
border-spacing
:
0
;
}
</style>
<a:body>
<res:useCss
value=
'
${
res
.
css
.
local
.
table_css
}
'
target=
"head-css"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'bootstrap.min.js'
]
}
"
target=
"head-js"
/>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
var
refresh
=
$
{
payload
.
refresh
};
var
second
=
$
{
payload
.
second
};
if
(
refresh
){
setInterval
(
function
(){
window
.
location
.
href
=
"
?refresh=true&second=
"
+
second
;
},
second
*
1000
);
}
});
</script>
<div
class=
"report"
>
<table
class=
"header"
>
<tr>
...
...
@@ -32,6 +43,11 @@
</tr>
</table>
<div
class=
'text-center'
style=
"margin:3px;"
>
<a
class=
'btn btn-small btn-primary'
href=
"?refresh=true&second=10"
>
10秒定时刷新
</a>
<a
class=
'btn btn-small btn-primary'
href=
"?refresh=true&second=20"
>
20秒定时刷新
</a>
<a
class=
'btn btn-small btn-primary'
href=
"?refresh=true&second=30"
>
30秒定时刷新
</a>
</div>
<div
class=
"tabbable tabs-left alert-info"
id=
"topMetric"
>
<!-- Only required for left/right tabs -->
<ul
class=
"nav nav-tabs"
>
<li
class=
"text-right active"
><a
href=
"#tab1"
data-toggle=
"tab"
>
异常最多Top10
</a></li>
...
...
cat-home/src/main/webapp/jsp/system/topologyGraphEdgeConfigs.jsp
浏览文件 @
08808af6
...
...
@@ -15,6 +15,10 @@
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#topylogyEdgeConfigList
'
).
addClass
(
'
active
'
);
$
(
'
#content .nav-tabs a
'
).
mouseenter
(
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
tab
(
'
show
'
);
});
$
(
"
.delete
"
).
bind
(
"
click
"
,
function
()
{
return
confirm
(
"
确定要删除此项目吗(不可恢复)?
"
);
});
...
...
@@ -75,7 +79,7 @@
<div
class=
"span2 text-center"
><a
class=
"btn btn-primary btn-small update"
href=
"?op=topologyGraphEdgeConfigAdd"
>
新增
</a></div>
</div>
</c:if>
<div
class=
"tabbable tabs-left"
id=
"
topMetric
"
>
<!-- Only required for left/right tabs -->
<div
class=
"tabbable tabs-left"
id=
"
content
"
>
<!-- Only required for left/right tabs -->
<ul
class=
"nav nav-tabs"
>
<c:forEach
var=
"item"
items=
"
${
model
.
edgeConfigs
}
"
varStatus=
"status"
>
<c:set
var=
"key"
value=
"
${
item
.
key
}
"
/>
...
...
cat-home/src/main/webapp/jsp/system/topologyGraphNodeConfigs.jsp
浏览文件 @
08808af6
...
...
@@ -15,7 +15,10 @@
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#topylogyNodeConfigList
'
).
addClass
(
'
active
'
);
$
(
'
#content .nav-tabs a
'
).
mouseenter
(
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
tab
(
'
show
'
);
});
var
type
=
'
${payload.type}
'
;
if
(
type
==
''
){
type
=
'
URL
'
;
...
...
@@ -72,7 +75,7 @@
<div
id=
"myModal"
class=
"modal hide fade"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
</div>
<h4
id=
"state"
class=
"text-center text-error"
>
</h4>
<div
class=
"tabbable tabs-left"
id=
"
topMetric
"
>
<!-- Only required for left/right tabs -->
<div
class=
"tabbable tabs-left"
id=
"
content
"
>
<!-- Only required for left/right tabs -->
<ul
class=
"nav nav-tabs"
>
<c:forEach
var=
"item"
items=
"
${
model
.
config
.
nodeConfigs
}
"
varStatus=
"status"
>
<c:set
var=
"key"
value=
"
${
item
.
key
}
"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录