Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
f6da6f67
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,发现更多精彩内容 >>
提交
f6da6f67
编写于
3月 06, 2014
作者:
Y
youyong205
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
youhua
上级
e523688a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
51 addition
and
27 deletion
+51
-27
cat-home/src/main/java/com/dianping/cat/report/page/problem/HistoryGraphs.java
...a/com/dianping/cat/report/page/problem/HistoryGraphs.java
+24
-24
cat-home/src/main/java/com/dianping/cat/system/page/config/Handler.java
...ain/java/com/dianping/cat/system/page/config/Handler.java
+19
-0
cat-home/src/main/webapp/images/business04.png
cat-home/src/main/webapp/images/business04.png
+0
-0
cat-home/src/main/webapp/jsp/report/home/integratingBusiness.jsp
...e/src/main/webapp/jsp/report/home/integratingBusiness.jsp
+1
-0
cat-home/src/main/webapp/jsp/system/productLine/topologyProductLineAdd.jsp
.../webapp/jsp/system/productLine/topologyProductLineAdd.jsp
+1
-1
cat-home/src/main/webapp/jsp/system/productLine/topologyProductLines.jsp
...in/webapp/jsp/system/productLine/topologyProductLines.jsp
+6
-2
未找到文件。
cat-home/src/main/java/com/dianping/cat/report/page/problem/HistoryGraphs.java
浏览文件 @
f6da6f67
...
...
@@ -169,30 +169,6 @@ public class HistoryGraphs extends BaseHistoryGraphs {
model
.
setErrorsTrend
(
item
.
getJsonString
());
}
public
void
buildTrendGraph
(
Model
model
,
Payload
payload
)
{
Date
start
=
payload
.
getHistoryStartDate
();
Date
end
=
payload
.
getHistoryEndDate
();
int
size
=
(
int
)
((
end
.
getTime
()
-
start
.
getTime
())
*
60
/
TimeUtil
.
ONE_HOUR
);
String
queryType
=
payload
.
getReportType
();
String
domain
=
model
.
getDomain
();
String
type
=
payload
.
getType
();
String
name
=
payload
.
getStatus
();
String
ip
=
model
.
getIpAddress
();
long
step
=
TimeUtil
.
ONE_MINUTE
;
if
(
queryType
.
equalsIgnoreCase
(
"week"
))
{
size
=
(
int
)
((
end
.
getTime
()
-
start
.
getTime
())
/
TimeUtil
.
ONE_DAY
);
step
=
TimeUtil
.
ONE_DAY
;
}
else
if
(
queryType
.
equalsIgnoreCase
(
"month"
))
{
size
=
(
int
)
((
end
.
getTime
()
-
start
.
getTime
())
/
TimeUtil
.
ONE_DAY
);
step
=
TimeUtil
.
ONE_DAY
;
}
List
<
Map
<
String
,
double
[]>>
allDatas
=
buildLineChartData
(
start
,
end
,
queryType
,
domain
,
type
,
name
,
ip
);
LineChart
item
=
buildFail
(
allDatas
,
start
,
step
,
size
,
queryType
);
model
.
setErrorsTrend
(
item
.
getJsonString
());
}
private
List
<
Map
<
String
,
double
[]>>
buildLineChartData
(
Date
start
,
Date
end
,
String
domain
,
String
type
,
String
name
,
String
ip
,
String
queryType
)
{
List
<
Map
<
String
,
double
[]>>
allDatas
=
new
ArrayList
<
Map
<
String
,
double
[]>>();
...
...
@@ -223,6 +199,30 @@ public class HistoryGraphs extends BaseHistoryGraphs {
return
allDatas
;
}
public
void
buildTrendGraph
(
Model
model
,
Payload
payload
)
{
Date
start
=
payload
.
getHistoryStartDate
();
Date
end
=
payload
.
getHistoryEndDate
();
int
size
=
(
int
)
((
end
.
getTime
()
-
start
.
getTime
())
*
60
/
TimeUtil
.
ONE_HOUR
);
String
queryType
=
payload
.
getReportType
();
String
domain
=
model
.
getDomain
();
String
type
=
payload
.
getType
();
String
name
=
payload
.
getStatus
();
String
ip
=
model
.
getIpAddress
();
long
step
=
TimeUtil
.
ONE_MINUTE
;
if
(
queryType
.
equalsIgnoreCase
(
"week"
))
{
size
=
(
int
)
((
end
.
getTime
()
-
start
.
getTime
())
/
TimeUtil
.
ONE_DAY
);
step
=
TimeUtil
.
ONE_DAY
;
}
else
if
(
queryType
.
equalsIgnoreCase
(
"month"
))
{
size
=
(
int
)
((
end
.
getTime
()
-
start
.
getTime
())
/
TimeUtil
.
ONE_DAY
);
step
=
TimeUtil
.
ONE_DAY
;
}
List
<
Map
<
String
,
double
[]>>
allDatas
=
buildLineChartData
(
start
,
end
,
queryType
,
domain
,
type
,
name
,
ip
);
LineChart
item
=
buildFail
(
allDatas
,
start
,
step
,
size
,
queryType
);
model
.
setErrorsTrend
(
item
.
getJsonString
());
}
private
Map
<
String
,
double
[]>
getGraphDatasFromDaily
(
Date
start
,
Date
end
,
String
domain
,
String
type
,
String
name
,
String
ip
)
{
String
queryIp
=
"All"
.
equalsIgnoreCase
(
ip
)
==
true
?
"All"
:
ip
;
...
...
cat-home/src/main/java/com/dianping/cat/system/page/config/Handler.java
浏览文件 @
f6da6f67
...
...
@@ -5,6 +5,7 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
...
...
@@ -339,13 +340,31 @@ public class Handler implements PageHandler<Context> {
private
void
metricConfigList
(
Payload
payload
,
Model
model
)
{
Map
<
String
,
ProductLine
>
productLines
=
m_productLineConfigManger
.
queryProductLines
();
Map
<
ProductLine
,
List
<
MetricItemConfig
>>
metricConfigs
=
new
HashMap
<
ProductLine
,
List
<
MetricItemConfig
>>();
Set
<
String
>
exists
=
new
HashSet
<
String
>();
for
(
Entry
<
String
,
ProductLine
>
entry
:
productLines
.
entrySet
())
{
Set
<
String
>
domains
=
entry
.
getValue
().
getDomains
().
keySet
();
List
<
MetricItemConfig
>
configs
=
m_metricConfigManager
.
queryMetricItemConfigs
(
domains
);
for
(
MetricItemConfig
config
:
configs
)
{
exists
.
add
(
m_metricConfigManager
.
buildMetricKey
(
config
.
getDomain
(),
config
.
getType
(),
config
.
getMetricKey
()));
}
metricConfigs
.
put
(
entry
.
getValue
(),
configs
);
}
Map
<
String
,
MetricItemConfig
>
allConfigs
=
m_metricConfigManager
.
getMetricConfig
().
getMetricItemConfigs
();
Set
<
String
>
keys
=
allConfigs
.
keySet
();
List
<
MetricItemConfig
>
otherConfigs
=
new
ArrayList
<
MetricItemConfig
>();
for
(
String
key
:
exists
)
{
keys
.
remove
(
key
);
}
for
(
String
str
:
keys
)
{
otherConfigs
.
add
(
allConfigs
.
get
(
str
));
}
ProductLine
otherProductLine
=
new
ProductLine
(
"Other"
).
setTitle
(
"Other"
);
metricConfigs
.
put
(
otherProductLine
,
otherConfigs
);
model
.
setProductMetricConfigs
(
metricConfigs
);
}
...
...
cat-home/src/main/webapp/images/business04.png
查看替换文件 @
e523688a
浏览文件 @
f6da6f67
68.0 KB
|
W:
|
H:
30.7 KB
|
W:
|
H:
2-up
Swipe
Onion skin
cat-home/src/main/webapp/jsp/report/home/integratingBusiness.jsp
浏览文件 @
f6da6f67
...
...
@@ -26,6 +26,7 @@
</br>
<h4
class=
"text-success"
>
第三步:产品线配置
</h4>
<p>
业务监控展示的是一个产品线下所有的业务指标信息,CAT提供了产品的配置信息
</p>
<p><span
class=
'text-error'
>
必须把一个产品线下的所有项目加入到此产品线,这样这个产品线下所有指标才能正确展示
</span></p>
<h4
class=
"text-error"
>
url :
<a
href=
""
target=
"_blank"
>
链接
</a></h4>
<img
class=
"img-polaroid"
width=
'60%'
src=
"${model.webapp}/images/business01.png"
/>
</br>
...
...
cat-home/src/main/webapp/jsp/system/productLine/topologyProductLineAdd.jsp
浏览文件 @
f6da6f67
...
...
@@ -23,7 +23,7 @@
<input
type=
"hidden"
name=
"op"
value=
"topologyProductLineAddSubmit"
/>
<table
class=
"table table-striped table-bordered table-condensed"
>
<tr>
<td
style=
"text-align: right"
class=
"text-success"
>
产品线名称(全英文)
</td>
<td
style=
"
width:20%"
style=
"
text-align: right"
class=
"text-success"
>
产品线名称(全英文)
</td>
<td><input
name=
"productLine.id"
value=
"${model.productLine.id}"
required
/></td>
</tr>
...
...
cat-home/src/main/webapp/jsp/system/productLine/topologyProductLines.jsp
浏览文件 @
f6da6f67
...
...
@@ -51,8 +51,12 @@
<h4
id=
"state"
class=
"text-center text-error"
>
</h4>
<table
class=
"table table-striped table-bordered"
>
<tr
class=
"text-success"
>
<th>
产品线
</th><th>
标题
</th><th>
顺序
</th><th>
监控大盘显示
</th><th>
项目列表
</th>
<th>
操作
<a
href=
"?op=topologyProductLineAdd"
class=
'update btn btn-primary btn-small'
>
新增
</a></th>
<th
width=
"6%"
>
产品线
</th>
<th
width=
"8%"
>
标题
</th>
<th
width=
"5%"
>
顺序
</th>
<th
width=
"12%"
>
监控大盘显示
</th>
<th>
项目列表
</th>
<th
width=
"10%"
>
操作
<a
href=
"?op=topologyProductLineAdd"
class=
'update btn btn-primary btn-small'
>
新增
</a></th>
</tr>
<c:forEach
var=
"entry"
items=
"
${
model
.
productLines
}
"
varStatus=
"status"
>
<c:set
var=
'item'
value=
'
${
entry
.
value
}
'
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录