Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
11461d3e
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,发现更多精彩内容 >>
提交
11461d3e
编写于
3月 27, 2014
作者:
Y
youyong205
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #272 from leonindy/master
modify the alteration
上级
74a9ed3b
304aeb1b
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
210 addition
and
666 deletion
+210
-666
cat-home/src/main/java/com/dianping/cat/report/page/alteration/Handler.java
...java/com/dianping/cat/report/page/alteration/Handler.java
+2
-107
cat-home/src/main/java/com/dianping/cat/report/page/alteration/Model.java
...n/java/com/dianping/cat/report/page/alteration/Model.java
+11
-11
cat-home/src/main/java/com/dianping/cat/report/page/alteration/Payload.java
...java/com/dianping/cat/report/page/alteration/Payload.java
+6
-27
cat-home/src/main/webapp/css/body.css
cat-home/src/main/webapp/css/body.css
+9
-0
cat-home/src/main/webapp/jsp/report/alteration/alter_query.jsp
...ome/src/main/webapp/jsp/report/alteration/alter_query.jsp
+21
-24
cat-home/src/main/webapp/jsp/report/alteration/alter_view.jsp
...home/src/main/webapp/jsp/report/alteration/alter_view.jsp
+41
-154
cat-home/src/main/webapp/jsp/report/alteration/alter_view_backup.jsp
...c/main/webapp/jsp/report/alteration/alter_view_backup.jsp
+0
-343
cat-home/src/main/webapp/jsp/report/home/alterationDocument.jsp
...me/src/main/webapp/jsp/report/home/alterationDocument.jsp
+38
-0
cat-home/src/main/webapp/jsp/report/home/home.jsp
cat-home/src/main/webapp/jsp/report/home/home.jsp
+3
-0
cat-home/src/main/webapp/jsp/report/home/userDocument/integratingBusiness.jsp
...bapp/jsp/report/home/userDocument/integratingBusiness.jsp
+79
-0
未找到文件。
cat-home/src/main/java/com/dianping/cat/report/page/alteration/Handler.java
浏览文件 @
11461d3e
package
com.dianping.cat.report.page.alteration
;
import
java.io.IOException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.ServletException
;
...
...
@@ -31,33 +26,6 @@ public class Handler implements PageHandler<Context> {
@Inject
private
AlterationDao
m_alterationDao
;
private
long
buildBarrelKey
(
long
barTime
,
long
endMill
,
long
granularity
)
{
long
key
;
if
(
endMill
==
barTime
)
{
key
=
barTime
-
granularity
;
}
else
if
((
endMill
-
barTime
)
/
granularity
==
0
)
{
key
=
barTime
;
}
else
{
key
=
endMill
-
((
endMill
-
barTime
)
/
granularity
+
1
)
*
granularity
;
}
return
key
;
}
private
String
buildType
(
String
type
)
{
String
str
;
if
(
type
!=
null
)
{
str
=
type
.
toLowerCase
();
}
else
{
return
"other"
;
}
if
(!
"puppet"
.
equals
(
str
)
&&
!
"workflow"
.
equals
(
str
)
&&
!
"lazyman"
.
equals
(
str
))
{
return
"other"
;
}
else
{
return
type
;
}
}
@Override
@PayloadMeta
(
Payload
.
class
)
@InboundActionMeta
(
name
=
"alteration"
)
...
...
@@ -94,7 +62,6 @@ public class Handler implements PageHandler<Context> {
}
break
;
case
VIEW:
long
granularity
=
payload
.
getGranularity
();
List
<
Alteration
>
alts
;
Date
startTime
=
payload
.
getStartTime
();
Date
endTime
=
payload
.
getEndTime
();
...
...
@@ -106,9 +73,8 @@ public class Handler implements PageHandler<Context> {
Cat
.
logError
(
e
);
break
;
}
Map
<
Long
,
AltBarrel
>
alterations
=
buildBarrelViewModel
(
alts
,
granularity
,
endTime
.
getTime
());
model
.
set
Barrels
(
alteration
s
);
model
.
set
Alterations
(
alt
s
);
break
;
}
...
...
@@ -120,28 +86,6 @@ public class Handler implements PageHandler<Context> {
}
}
private
Map
<
Long
,
AltBarrel
>
buildBarrelViewModel
(
List
<
Alteration
>
alts
,
long
granularity
,
long
endMill
)
{
Map
<
Long
,
AltBarrel
>
alterations
=
new
LinkedHashMap
<
Long
,
AltBarrel
>();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
for
(
Alteration
altGenBarrel
:
alts
)
{
long
barTime
=
altGenBarrel
.
getDate
().
getTime
();
long
key
=
buildBarrelKey
(
barTime
,
endMill
,
granularity
);
AltBarrel
tmpBarrel
=
alterations
.
get
(
key
);
List
<
Alteration
>
tmpAlterations
;
if
(
tmpBarrel
==
null
)
{
alterations
.
put
(
key
,
new
AltBarrel
(
sdf
.
format
(
new
Date
(
key
)),
sdf
.
format
(
new
Date
(
key
+
granularity
)),
key
));
tmpBarrel
=
alterations
.
get
(
key
);
}
tmpAlterations
=
tmpBarrel
.
getAlterationMap
().
get
(
buildType
(
altGenBarrel
.
getType
()));
tmpAlterations
.
add
(
altGenBarrel
);
}
return
alterations
;
}
private
Alteration
buildAlteration
(
Payload
payload
)
{
String
type
=
payload
.
getType
();
String
domain
=
payload
.
getDomain
();
...
...
@@ -208,55 +152,6 @@ public class Handler implements PageHandler<Context> {
}
else
if
(
status
==
2
)
{
model
.
setInsertResult
(
"{\"status\":200, \"errorMessage\":\"lack args\"}"
);
}
}
public
class
AltBarrel
{
private
Map
<
String
,
List
<
Alteration
>>
m_alterationMap
;
private
String
m_startTime
;
private
String
m_endTime
;
private
long
m_key
;
public
AltBarrel
(
String
startTime
,
String
endTime
,
long
key
)
{
m_startTime
=
startTime
;
m_endTime
=
endTime
;
m_key
=
key
;
m_alterationMap
=
new
HashMap
<
String
,
List
<
Alteration
>>();
m_alterationMap
.
put
(
"puppet"
,
new
ArrayList
<
Alteration
>());
m_alterationMap
.
put
(
"workflow"
,
new
ArrayList
<
Alteration
>());
m_alterationMap
.
put
(
"lazyman"
,
new
ArrayList
<
Alteration
>());
m_alterationMap
.
put
(
"other"
,
new
ArrayList
<
Alteration
>());
}
public
Map
<
String
,
List
<
Alteration
>>
getAlterationMap
()
{
return
m_alterationMap
;
}
public
String
getEndTime
()
{
return
m_endTime
;
}
public
long
getKey
()
{
return
m_key
;
}
public
String
getStartTime
()
{
return
m_startTime
;
}
public
void
setAlterationMap
(
Map
<
String
,
List
<
Alteration
>>
tmpAltMap
)
{
m_alterationMap
=
tmpAltMap
;
}
public
void
setEndTime
(
String
endTime
)
{
m_endTime
=
endTime
;
}
public
void
setStartTime
(
String
startTime
)
{
m_startTime
=
startTime
;
}
}
}
cat-home/src/main/java/com/dianping/cat/report/page/alteration/Model.java
浏览文件 @
11461d3e
...
...
@@ -2,26 +2,22 @@ package com.dianping.cat.report.page.alteration;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.
Map
;
import
java.util.
List
;
import
com.dianping.cat.Constants
;
import
com.dianping.cat.home.dal.report.Alteration
;
import
com.dianping.cat.report.page.AbstractReportModel
;
import
com.dianping.cat.report.page.alteration.Handler.AltBarrel
;
public
class
Model
extends
AbstractReportModel
<
Action
,
Context
>
{
private
String
m_insertResult
;
private
Map
<
Long
,
AltBarrel
>
m_barrel
s
;
private
List
<
Alteration
>
m_alteration
s
;
public
Model
(
Context
ctx
)
{
super
(
ctx
);
}
public
Map
<
Long
,
AltBarrel
>
getBarrels
()
{
return
m_barrels
;
}
@Override
public
Action
getDefaultAction
()
{
return
Action
.
VIEW
;
...
...
@@ -41,12 +37,16 @@ public class Model extends AbstractReportModel<Action, Context> {
return
m_insertResult
;
}
public
void
setBarrels
(
Map
<
Long
,
AltBarrel
>
barrels
)
{
m_barrels
=
barrels
;
}
public
void
setInsertResult
(
String
insertResult
)
{
m_insertResult
=
insertResult
;
}
public
List
<
Alteration
>
getAlterations
()
{
return
m_alterations
;
}
public
void
setAlterations
(
List
<
Alteration
>
alterations
)
{
m_alterations
=
alterations
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/alteration/Payload.java
浏览文件 @
11461d3e
...
...
@@ -17,9 +17,6 @@ public class Payload extends AbstractReportPayload<Action> {
@FieldMeta
(
"frequency"
)
private
int
m_frequency
=
10
;
@FieldMeta
(
"rows"
)
private
int
m_rows
=
10
;
@FieldMeta
(
"refresh"
)
private
boolean
m_refresh
=
false
;
...
...
@@ -62,9 +59,6 @@ public class Payload extends AbstractReportPayload<Action> {
@FieldMeta
(
"endTime"
)
private
String
m_endTime
;
@FieldMeta
(
"granularity"
)
private
long
m_granularity
;
@FieldMeta
(
"hostname"
)
private
String
m_hostname
;
...
...
@@ -90,18 +84,19 @@ public class Payload extends AbstractReportPayload<Action> {
return
new
Date
();
}
}
public
String
getContent
()
{
return
m_content
;
}
public
String
getDomain
()
{
if
(
""
.
equals
(
m_domain
))
{
if
(
m_domain
==
null
||
""
.
equals
(
m_domain
))
{
return
null
;
}
else
{
return
m_domain
;
}
}
public
Date
getEndTime
()
{
if
(
m_endTime
==
null
||
m_endTime
.
length
()
==
0
)
{
...
...
@@ -119,16 +114,12 @@ public class Payload extends AbstractReportPayload<Action> {
return
m_frequency
;
}
public
long
getGranularity
()
{
return
m_granularity
;
}
public
String
getGroup
()
{
return
m_group
;
}
public
String
getHostname
()
{
if
(
""
.
equals
(
m_hostname
)){
if
(
m_hostname
==
null
||
""
.
equals
(
m_hostname
)){
return
null
;
}
else
{
return
m_hostname
;
...
...
@@ -143,13 +134,9 @@ public class Payload extends AbstractReportPayload<Action> {
return
m_page
;
}
public
int
getRows
()
{
return
m_rows
;
}
public
Date
getStartTime
()
{
if
(
m_startTime
==
null
||
m_startTime
.
length
()
==
0
)
{
return
new
Date
(
System
.
currentTimeMillis
()
-
TimeUtil
.
ONE_HOUR
);
return
new
Date
(
System
.
currentTimeMillis
()
-
2
*
TimeUtil
.
ONE_HOUR
);
}
else
{
try
{
return
m_sdf
.
parse
(
m_startTime
);
...
...
@@ -211,10 +198,6 @@ public class Payload extends AbstractReportPayload<Action> {
this
.
fullScreen
=
fullScreen
;
}
public
void
setGranularity
(
long
granularity
)
{
m_granularity
=
granularity
;
}
public
void
setGroup
(
String
group
)
{
m_group
=
group
;
}
...
...
@@ -240,10 +223,6 @@ public class Payload extends AbstractReportPayload<Action> {
m_refresh
=
refresh
;
}
public
void
setRows
(
int
rows
)
{
m_rows
=
rows
;
}
public
void
setStartTime
(
String
startTime
)
{
m_startTime
=
startTime
;
}
...
...
cat-home/src/main/webapp/css/body.css
浏览文件 @
11461d3e
...
...
@@ -260,4 +260,13 @@ ul, ol{
}
#loginModal
.form-horizontal
.controls
{
margin-left
:
70px
;
}
.aleration_puppet
{
background
:
#F0FFFF
;
}
.aleration_lazyman
{
background
:
#F5F5DC
;
}
.aleration_workflow
{
background
:
#87CEEB
;
}
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/alteration/alter_query.jsp
浏览文件 @
11461d3e
<%@ taglib
prefix=
"fmt"
uri=
"http://java.sun.com/jsp/jstl/fmt"
%>
<%@ taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%>
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<div
class=
"text-left text-info"
></div>
时间粒度
<select
class=
"input-small"
id=
"granularity"
>
<option
value=
"120000"
>
2 min
</option>
<option
value=
"300000"
>
5 min
</option>
<option
value=
"600000"
>
10 min
</option>
<option
value=
"1800000"
>
30 min
</option>
<option
value=
"3600000"
>
1 hour
</option>
</select>
<div
class=
"text-left"
></div>
开始
<input
type=
"text"
name=
"startTime"
id=
"startTime"
value=
"
<fmt:formatDate
value=
"
${
payload
.
startTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
"
style=
"height:auto"
class=
"input-medium"
placeholder=
"格式如:2014-02-02 00:00:00"
>
结束
...
...
@@ -17,36 +10,40 @@
<input
type=
"text"
name=
"domain"
id=
"domain"
value=
"${payload.domain}"
style=
"height:auto"
class=
"input-small"
>
机器名
<input
type=
"text"
name=
"hostname"
id=
"hostname"
value=
"${payload.hostname}"
style=
"height:auto"
class=
"input-small"
>
<input
class=
"btn btn-primary btn-small"
value=
"查询"
onclick=
"queryNew()"
type=
"submit"
>
<input
class=
"btn btn-primary btn-small"
value=
"查询"
onclick=
"queryNew()"
type=
"submit"
>
<c:if
test=
"
${
!
payload
.
fullScreen
}
"
>
<a
id=
"fullScreen"
class=
'btn btn-small btn-primary'
href=
"?fullScreen=true&refresh=${payload.refresh}&frequency=${payload.frequency}&startTime=
<fmt:formatDate
value=
"
${
payload
.
startTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&endTime=
<fmt:formatDate
value=
"
${
payload
.
endTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&granularity=${payload.granularity}
"
>
全屏
</a>
<a
id=
"fullScreen"
class=
'btn btn-small btn-primary'
onclick=
"queryFullScreen(true)
"
>
全屏
</a>
</c:if>
<c:if
test=
"
${
payload
.
fullScreen
}
"
>
<a
id=
"fullScreen"
class=
'btn btn-small btn-primary'
href=
"?fullScreen=false&refresh=${payload.refresh}&frequency=${payload.frequency}&startTime=
<fmt:formatDate
value=
"
${
payload
.
startTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&endTime=
<fmt:formatDate
value=
"
${
payload
.
endTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&granularity=${payload.granularity}
"
>
全屏
</a>
<a
id=
"fullScreen"
class=
'btn btn-small btn-primary'
onclick=
"queryFullScreen(false)
"
>
全屏
</a>
</c:if>
<a
id=
"refresh10"
class=
'btn btn-small btn-primary'
href=
"?fullScreen=${payload.fullScreen}&refresh=true&frequency=10&startTime=
<fmt:formatDate
value=
"
${
payload
.
startTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&endTime=
<fmt:formatDate
value=
"
${
payload
.
endTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&granularity=${payload.granularity}"
>
10秒定时刷新
</a>
<a
id=
"refresh20"
class=
'btn btn-small btn-primary'
href=
"?fullScreen=${payload.fullScreen}&refresh=true&frequency=20&startTime=
<fmt:formatDate
value=
"
${
payload
.
startTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&endTime=
<fmt:formatDate
value=
"
${
payload
.
endTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&granularity=${payload.granularity}"
>
20秒定时刷新
</a>
<a
id=
"refresh30"
class=
'btn btn-small btn-primary'
href=
"?fullScreen=${payload.fullScreen}&refresh=true&frequency=30&startTime=
<fmt:formatDate
value=
"
${
payload
.
startTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&endTime=
<fmt:formatDate
value=
"
${
payload
.
endTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&granularity=${payload.granularity}"
>
30秒定时刷新
</a>
<a
id=
"refresh10"
class=
'btn btn-small btn-primary'
onclick=
"queryFrequency(10)"
>
10秒
</a>
<a
id=
"refresh20"
class=
'btn btn-small btn-primary'
onclick=
"queryFrequency(20)"
>
20秒
</a>
<a
id=
"refresh30"
class=
'btn btn-small btn-primary'
onclick=
"queryFrequency(30)"
>
30秒
</a>
<br>
<div
class=
"btn-group"
>
展示种类
<button
class=
"btn typeButton btn-primary"
id=
"puppetButton"
>
puppet
</button>
<button
class=
"btn typeButton btn-primary"
id=
"workflowButton"
>
workflow
</button>
<button
class=
"btn typeButton btn-primary"
id=
"lazymanButton"
>
lazyman
</button>
</div>
</div>
<script>
function
queryNew
(){
var
granularity
=
$
(
"
#granularity
"
).
val
();
var
startTime
=
$
(
"
#startTime
"
).
val
();
var
endTime
=
$
(
"
#endTime
"
).
val
();
var
domain
=
$
(
"
#domain
"
).
val
();
var
hostname
=
$
(
"
#hostname
"
).
val
();
window
.
location
.
href
=
"
?op=view&domain=
"
+
domain
+
"
&
granularity=
"
+
granularity
+
"
&
startTime=
"
+
startTime
+
"
&endTime=
"
+
endTime
+
"
&hostname=
"
+
hostname
;
window
.
location
.
href
=
"
?op=view&domain=
"
+
domain
+
"
&startTime=
"
+
startTime
+
"
&endTime=
"
+
endTime
+
"
&hostname=
"
+
hostname
;
}
</script>
function
queryFullScreen
(
isFullScreen
){
<c:if
test=
"
${
payload
.
refresh
}
"
>
window
.
location
.
href
=
"
?domain=${payload.domain}&hostname=${payload.hostname}&fullScreen=
"
+
isFullScreen
+
"
&refresh=${payload.refresh}&frequency=${payload.frequency}
"
;
</c:if>
<c:if
test=
"
${
!
payload
.
refresh
}
"
>
window
.
location
.
href
=
"
?domain=${payload.domain}&hostname=${payload.hostname}&fullScreen=
"
+
isFullScreen
+
"
&refresh=${payload.refresh}&frequency=${payload.frequency}&startTime=
<fmt:formatDate
value=
"
${
payload
.
startTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&endTime=
<fmt:formatDate
value=
"
${
payload
.
endTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
"
;
</c:if>
}
function
queryFrequency
(
frequency
){
window
.
location
.
href
=
"
?domain=${payload.domain}&hostname=${payload.hostname}&fullScreen=${payload.fullScreen}&refresh=true&frequency=
"
+
frequency
;
}
</script>
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/alteration/alter_view.jsp
浏览文件 @
11461d3e
<%@ page
session=
"false"
language=
"java"
pageEncoding=
"UTF-8"
%>
<%@ page
session=
"false"
language=
"java"
pageEncoding=
"UTF-8"
%>
<%@ 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"
%>
<%@ taglib
prefix=
"fn"
uri=
"http://java.sun.com/jsp/jstl/functions"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.alteration.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.alteration.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.alteration.Model"
scope=
"request"
/>
<%@ taglib
prefix=
"fn"
uri=
"http://java.sun.com/jsp/jstl/functions"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.alteration.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.alteration.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.alteration.Model"
scope=
"request"
/>
<a:report
title=
"Alteration Report"
navUrlPrefix=
""
>
<a:report
title=
"Alteration Report"
navUrlPrefix=
""
>
<jsp:body>
<res:useJs
value=
"
${
res
.
js
.
local
[
'highcharts.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'baseGraph.js'
]
}
"
target=
"head-js"
/>
<table
class=
"machines"
>
<tr>
<th>
<%@ include
file=
"alter_query.jsp"
%>
</th>
</tr>
</table>
<table
class=
"problem table table-striped table-bordered table-condensed table-hover"
style=
"width:100%;word-wrap: break-word; word-break: break-all;"
>
<tr
class=
"text-success"
>
<th
width=
"15%"
>
时间
</th>
<th
width=
"28%"
class=
"puppet"
>
puppet
</th>
<th
width=
"28%"
class=
"workflow"
>
workflow
</th>
<th
width=
"28%"
class=
"lazyman"
>
lazyman
</th>
</tr>
<c:forEach
var=
"barrelMap"
items=
"
${
model
.
barrels
}
"
varStatus=
"typeIndex"
>
<c:set
var=
"barrel"
value=
"
${
barrelMap
.
value
}
"
/>
<tr
style=
"width:85%"
>
<td
width=
"10%"
>
${barrel.startTime}
</br>
${barrel.endTime}
</td>
<td
width=
"30%"
class=
"puppet"
>
<table
class=
"table table-striped table-bordered table-condensed table-hover"
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
>
<tr
class=
"text-success"
>
<th
width=
"100%"
>
标题
</th>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'puppet'
]
}
"
varStatus=
"index"
begin=
"0"
end=
"
${
payload
.
rows
-
1
}
"
>
<tr>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
</tr>
</c:forEach>
<c:if
test=
"
${
fn:
length
(
barrel
.
alterationMap
[
'puppet'
])>
payload
.
rows
}
"
>
<tr
class=
'showMenu'
id=
'${barrel.key}_show'
style=
"display:table-row;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: show all ::]
</a></td>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'puppet'
]
}
"
varStatus=
"index"
begin=
"
${
payload
.
rows
}
"
>
<tr
style=
"display:none;"
class=
'${barrel.key}_content'
>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
</c:forEach>
<tr
class=
'hideMenu'
id=
'${barrel.key}_hide'
style=
"display:none;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: hide ::]
</a></td>
</tr>
</c:if>
</table>
</td>
<td
width=
"30%"
class=
"workflow"
>
<table
class=
"table table-striped table-bordered table-condensed table-hover"
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
>
<tr
class=
"text-success"
>
<th
width=
"100%"
>
标题
</th>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'workflow'
]
}
"
varStatus=
"index"
begin=
"0"
end=
"
${
payload
.
rows
-
1
}
"
>
<tr>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
</tr>
</c:forEach>
<c:if
test=
"
${
fn:
length
(
barrel
.
alterationMap
[
'workflow'
])>
payload
.
rows
}
"
>
<tr
class=
'showMenu'
id=
'${barrel.key}_show'
style=
"display:table-row;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: show all ::]
</a></td>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'workflow'
]
}
"
varStatus=
"index"
begin=
"
${
payload
.
rows
}
"
>
<tr
style=
"display:none;"
class=
'${barrel.key}_content'
>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
</tr>
</c:forEach>
<tr
class=
'hideMenu'
id=
'${barrel.key}_hide'
style=
"display:none;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: hide ::]
</a></td>
</tr>
</c:if>
</table>
</td>
<td
width=
"30%"
class=
"lazyman"
>
<table
class=
"table table-striped table-bordered table-condensed table-hover"
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
>
<tr
class=
"text-success"
>
<th
width=
"100%"
>
标题
</th>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'lazyman'
]
}
"
varStatus=
"index"
begin=
"0"
end=
"
${
payload
.
rows
-
1
}
"
>
<tr>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
</tr>
</c:forEach>
<c:if
test=
"
${
fn:
length
(
barrel
.
alterationMap
[
'lazyman'
])>
payload
.
rows
}
"
>
<tr
class=
'showMenu'
id=
'${barrel.key}_show'
style=
"display:table-row;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: show all ::]
</a></td>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'lazyman'
]
}
"
varStatus=
"index"
begin=
"
${
payload
.
rows
}
"
>
<tr
style=
"display:none;"
class=
'${barrel.key}_content'
>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
</c:forEach>
<tr
class=
'hideMenu'
id=
'${barrel.key}_hide'
style=
"display:none;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: hide ::]
</a></td>
</tr>
</c:if>
</table>
</td>
<res:useJs
value=
"
${
res
.
js
.
local
[
'highcharts.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'baseGraph.js'
]
}
"
target=
"head-js"
/>
<%@ include
file=
"alter_query.jsp"
%>
<table
class=
"problem table table-striped table-bordered table-condensed table-hover"
>
<tr
class=
"text-success"
>
<th
width=
"15%"
>
时间
</th>
<th
width=
"5%"
>
类型
</th>
<th
width=
"60%"
>
标题
</th>
<th
width=
"8%"
>
项目名
</th>
<th
width=
"8%"
>
机器名
</th>
</tr>
</c:forEach>
</table>
<c:forEach
var=
"item"
items=
"
${
model
.
alterations
}
"
varStatus=
"status"
>
<tr
class=
"aleration_${item.type}"
>
<td>
${w:format(item.date,'yyyy-MM-dd HH:mm:ss')}
</td>
<td>
${item.type}
</td>
<td
class=
"text-info"
>
<c:choose>
<c:when
test=
"
${
empty
item
.
url
}
"
>
<span
class=
"hreftip"
data-toggle=
"tooltip"
data-placement=
"top"
title=
""
data-original-title=
"${item.content}"
>
${item.title}
</span>
</c:when>
<c:otherwise>
<a
class=
"hreftip"
target=
"_blank"
href=
"${item.url}"
data-toggle=
"tooltip"
data-placement=
"top"
title=
""
data-original-title=
"${item.content}"
>
${item.title}
</a>
</c:otherwise>
</c:choose>
</td>
<td>
${item.domain}
</td>
<td>
${item.hostname}
</td>
</tr>
</c:forEach>
</table>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
"
.header
"
).
hide
();
$
(
'
i[tips]
'
).
popover
();
$
(
'
.hreftip
'
).
tooltip
({
container
:
'
body
'
,
html
:
true
,
delay
:{
show
:
0
,
hide
:
0
}});
<c:if
test=
"
${
payload
.
fullScreen
}
"
>
$
(
'
#fullScreen
'
).
addClass
(
'
btn-danger
'
);
...
...
@@ -148,34 +60,15 @@
$
(
"
.typeButton
"
).
click
(
function
(){
var
type
=
"
.
"
+
this
.
id
.
replace
(
"
Button
"
,
""
);
$
(
this
).
toggleClass
(
"
btn-primary
"
);
if
(
$
(
type
).
css
(
"
display
"
)
==
"
block
"
){
if
(
$
(
type
).
css
(
"
display
"
)
==
"
table-cell
"
){
$
(
this
).
removeClass
(
"
btn-primary
"
);
$
(
type
).
css
(
"
display
"
,
"
none
"
);
}
else
{
$
(
type
).
css
(
"
display
"
,
"
block
"
);
}
else
if
(
$
(
type
).
css
(
"
display
"
)
==
"
none
"
){
$
(
this
).
addClass
(
"
btn-primary
"
);
$
(
type
).
css
(
"
display
"
,
"
table-cell
"
);
}
})
$
(
"
.showMenu
"
).
click
(
function
(){
var
timeStamp
=
this
.
id
.
replace
(
"
_show
"
,
""
);
var
content
=
"
.
"
+
timeStamp
+
"
_content
"
;
var
hide
=
"
#
"
+
timeStamp
+
"
_hide
"
;
$
(
this
).
css
(
"
display
"
,
"
none
"
);
$
(
content
).
css
(
"
display
"
,
"
table-row
"
);
$
(
hide
).
css
(
"
display
"
,
"
table-row
"
);
})
$
(
"
.hideMenu
"
).
click
(
function
(){
var
timeStamp
=
this
.
id
.
replace
(
"
_hide
"
,
""
);
var
content
=
"
.
"
+
timeStamp
+
"
_content
"
;
var
show
=
"
#
"
+
timeStamp
+
"
_show
"
;
$
(
this
).
css
(
"
display
"
,
"
none
"
);
$
(
content
).
css
(
"
display
"
,
"
none
"
);
$
(
show
).
css
(
"
display
"
,
"
table-row
"
);
})
var
refresh
=
$
{
payload
.
refresh
};
var
frequency
=
$
{
payload
.
frequency
};
if
(
refresh
){
...
...
@@ -184,14 +77,8 @@
location
.
reload
();
},
frequency
*
1000
);
};
var
value
=
$
{
payload
.
granularity
};
$
(
"
#granularity
"
).
val
(
value
);
});
</script>
<res:useJs
value=
"
${
res
.
js
.
local
.
problem_js
}
"
target=
"buttom-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
.
problemHistory_js
}
"
target=
"bottom-js"
/>
</jsp:body>
</a:report>
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/alteration/alter_view_backup.jsp
已删除
100644 → 0
浏览文件 @
74a9ed3b
<%@ page
session=
"false"
language=
"java"
pageEncoding=
"UTF-8"
%>
<%@ 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"
%>
<%@ taglib
prefix=
"fn"
uri=
"http://java.sun.com/jsp/jstl/functions"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.alteration.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.alteration.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.alteration.Model"
scope=
"request"
/>
<a:report
title=
"Alteration Report"
navUrlPrefix=
""
>
<jsp:body>
<res:useJs
value=
"
${
res
.
js
.
local
[
'highcharts.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'baseGraph.js'
]
}
"
target=
"head-js"
/>
<table
class=
"machines"
>
<tr>
<th>
<%@ include
file=
"alter_query.jsp"
%>
</th>
</tr>
</table>
<table
class=
"problem table table-striped table-bordered table-condensed table-hover"
style=
"width:100%;word-wrap: break-word; word-break: break-all;"
>
<tr
class=
"text-success"
>
<th
width=
"15%"
>
时间
</th>
<th
width=
"28%"
class=
"puppet"
>
puppet
</th>
<th
width=
"28%"
class=
"workflow"
>
workflow
</th>
<th
width=
"28%"
class=
"lazyman"
>
lazyman
</th>
</tr>
<c:forEach
var=
"barrelMap"
items=
"
${
model
.
barrels
}
"
varStatus=
"typeIndex"
>
<c:set
var=
"barrel"
value=
"
${
barrelMap
.
value
}
"
/>
<tr
style=
"width:85%"
>
<td
width=
"10%"
>
${barrel.startTime}
</br>
${barrel.endTime}
</td>
<td
width=
"30%"
class=
"puppet"
>
<table
class=
"table table-striped table-bordered table-condensed table-hover"
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
>
<tr
class=
"text-success"
>
<th
width=
"20%"
>
标题
</th>
<th
width=
"5%"
>
类型
</th>
<th
width=
"5%"
>
应用
</th>
<th
width=
"8%"
>
主机名
</th>
<th
width=
"10%"
>
变更时间
</th>
<th
width=
"5%"
>
变更用户
</th>
<th
width=
"5%"
>
详情
</th>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'puppet'
]
}
"
varStatus=
"index"
begin=
"0"
end=
"9"
>
<tr>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
<td
class=
"alertation${item.type}"
>
${item.type}
</td>
<td
>
${item.domain}
</td>
<td
>
${item.hostname}
</td>
<td
>
${item.date}
</td>
<td
>
${item.user}
</td>
<td
>
<c:if
test=
" ${empty item.url}"
>
<a
href=
"${item.url}"
>
link
</a>
</c:if>
</td>
</tr>
</c:forEach>
<c:if
test=
"
${
fn:
length
(
barrel
.
alterationMap
[
'puppet'
])>
10
}
"
>
<tr
class=
'showMenu'
id=
'${barrel.key}_show'
style=
"display:table-row;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: show all ::]
</a></td>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'puppet'
]
}
"
varStatus=
"index"
begin=
"10"
>
<tr
style=
"display:none;"
class=
'${barrel.key}_content'
>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
<td
class=
"alertation${item.type}"
>
${item.type}
</td>
<td
>
${item.domain}
</td>
<td
>
${item.hostname}
</td>
<td
>
${item.date}
</td>
<td
>
${item.user}
</td>
<td
>
<c:if
test=
" ${empty item.url}"
>
<a
href=
"${item.url}"
>
link
</a>
</c:if>
</td>
</tr>
</c:forEach>
<tr
class=
'hideMenu'
id=
'${barrel.key}_hide'
style=
"display:none;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: hide ::]
</a></td>
</tr>
</c:if>
</table>
</td>
<td
width=
"30%"
class=
"workflow"
>
<table
class=
"table table-striped table-bordered table-condensed table-hover"
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
>
<tr
class=
"text-success"
>
<th
width=
"20%"
>
标题
</th>
<th
width=
"5%"
>
类型
</th>
<th
width=
"5%"
>
应用
</th>
<th
width=
"8%"
>
主机名
</th>
<th
width=
"10%"
>
变更时间
</th>
<th
width=
"5%"
>
变更用户
</th>
<th
width=
"5%"
>
详情
</th>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'workflow'
]
}
"
varStatus=
"index"
begin=
"0"
end=
"9"
>
<tr>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
<td
class=
"alertation${item.type}"
>
${item.type}
</td>
<td
>
${item.domain}
</td>
<td
>
${item.hostname}
</td>
<td
>
${item.date}
</td>
<td
>
${item.user}
</td>
<td
>
<c:if
test=
" ${empty item.url}"
>
<a
href=
"${item.url}"
>
link
</a>
</c:if>
</td>
</tr>
</c:forEach>
<c:if
test=
"
${
fn:
length
(
barrel
.
alterationMap
[
'workflow'
])>
10
}
"
>
<tr
class=
'showMenu'
id=
'${barrel.key}_show'
style=
"display:table-row;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: show all ::]
</a></td>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'workflow'
]
}
"
varStatus=
"index"
begin=
"10"
>
<tr
style=
"display:none;"
class=
'${barrel.key}_content'
>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
<td
class=
"alertation${item.type}"
>
${item.type}
</td>
<td
>
${item.domain}
</td>
<td
>
${item.hostname}
</td>
<td
>
${item.date}
</td>
<td
>
${item.user}
</td>
<td
>
<c:if
test=
" ${empty item.url}"
>
<a
href=
"${item.url}"
>
link
</a>
</c:if>
</td>
</tr>
</c:forEach>
<tr
class=
'hideMenu'
id=
'${barrel.key}_hide'
style=
"display:none;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: hide ::]
</a></td>
</tr>
</c:if>
</table>
</td>
<td
width=
"30%"
class=
"lazyman"
>
<table
class=
"table table-striped table-bordered table-condensed table-hover"
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
>
<tr
class=
"text-success"
>
<th
width=
"20%"
>
标题
</th>
<th
width=
"5%"
>
类型
</th>
<th
width=
"5%"
>
应用
</th>
<th
width=
"8%"
>
主机名
</th>
<th
width=
"10%"
>
变更时间
</th>
<th
width=
"5%"
>
变更用户
</th>
<th
width=
"5%"
>
详情
</th>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'lazyman'
]
}
"
varStatus=
"index"
begin=
"0"
end=
"9"
>
<tr>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
<td
class=
"alertation${item.type}"
>
${item.type}
</td>
<td
>
${item.domain}
</td>
<td
>
${item.hostname}
</td>
<td
>
${item.date}
</td>
<td
>
${item.user}
</td>
<td
>
<c:if
test=
" ${empty item.url}"
>
<a
href=
"${item.url}"
>
link
</a>
</c:if>
</td>
</tr>
</c:forEach>
<c:if
test=
"
${
fn:
length
(
barrel
.
alterationMap
[
'lazyman'
])>
10
}
"
>
<tr
class=
'showMenu'
id=
'${barrel.key}_show'
style=
"display:table-row;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: show all ::]
</a></td>
</tr>
<c:forEach
var=
"item"
items=
"
${
barrel
.
alterationMap
[
'lazyman'
]
}
"
varStatus=
"index"
begin=
"10"
>
<tr
style=
"display:none;"
class=
'${barrel.key}_content'
>
<td
class=
"text-info"
>
<i
tips=
""
data-trigger=
"hover"
class=
"icon-question-sign"
data-toggle=
"popover"
data-placement=
"top"
data-content=
"${item.content}"
></i>
${item.title}
</td>
<td
class=
"alertation${item.type}"
>
${item.type}
</td>
<td
>
${item.domain}
</td>
<td
>
${item.hostname}
</td>
<td
>
${item.date}
</td>
<td
>
${item.user}
</td>
<td
>
<c:if
test=
" ${empty item.url}"
>
<a
href=
"${item.url}"
>
link
</a>
</c:if>
</td>
</tr>
</c:forEach>
<tr
class=
'hideMenu'
id=
'${barrel.key}_hide'
style=
"display:none;"
>
<td><a
href=
''
onclick=
"return false"
>
[:: hide ::]
</a></td>
</tr>
</c:if>
</table>
</td>
</tr>
</c:forEach>
</table>
<c:if
test=
"
${
model
.
totalPages
>
1
}
"
>
<div
class=
"pagination pagination-centered"
>
<ul>
<c:forEach
varStatus=
"idx"
begin=
"1"
end=
"
${
model
.
totalPages
}
"
>
<li
id=
'page${idx.index}'
><a
href=
"?fullScreen=${payload.fullScreen}&refresh=true&frequency=30&startTime=
<fmt:formatDate
value=
"
${
payload
.
startTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&endTime=
<fmt:formatDate
value=
"
${
payload
.
endTime
}
"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
&granularity=${payload.granularity}&pages=${idx.index}"
>
${idx.index}
</a></li>
</c:forEach>
</ul>
</div>
</c:if>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
"
.header
"
).
hide
();
$
(
'
i[tips]
'
).
popover
();
<c:if
test=
"
${
payload
.
fullScreen
}
"
>
$
(
'
#fullScreen
'
).
addClass
(
'
btn-danger
'
);
$
(
'
.navbar
'
).
hide
();
$
(
'
.footer
'
).
hide
();
</c:if>
<c:if
test=
"
${
!
payload
.
fullScreen
}
"
>
$
(
'
#fullScreen
'
).
removeClass
(
'
btn-danger
'
);
$
(
'
.navbar
'
).
show
();
$
(
'
.footer
'
).
show
();
</c:if>
<c:if
test=
"
${
model
.
totalPages
>
1
}
"
>
$
(
'
#page
'
+
$
{
payload
.
pages
}).
addClass
(
'
active
'
)
</c:if>
$
(
"
.showMenu
"
).
click
(
function
(){
var
timeStamp
=
this
.
id
.
replace
(
"
_show
"
,
""
);
var
content
=
"
.
"
+
timeStamp
+
"
_content
"
;
var
hide
=
"
#
"
+
timeStamp
+
"
_hide
"
;
$
(
this
).
css
(
"
display
"
,
"
none
"
);
$
(
content
).
css
(
"
display
"
,
"
table-row
"
);
$
(
hide
).
css
(
"
display
"
,
"
table-row
"
);
})
$
(
"
.hideMenu
"
).
click
(
function
(){
var
timeStamp
=
this
.
id
.
replace
(
"
_hide
"
,
""
);
var
content
=
"
.
"
+
timeStamp
+
"
_content
"
;
var
show
=
"
#
"
+
timeStamp
+
"
_show
"
;
$
(
this
).
css
(
"
display
"
,
"
none
"
);
$
(
content
).
css
(
"
display
"
,
"
none
"
);
$
(
show
).
css
(
"
display
"
,
"
table-row
"
);
})
var
refresh
=
$
{
payload
.
refresh
};
var
frequency
=
$
{
payload
.
frequency
};
if
(
refresh
){
$
(
'
#refresh${payload.frequency}
'
).
addClass
(
'
btn-danger
'
);
setInterval
(
function
(){
location
.
reload
();
},
frequency
*
1000
);
};
var
value
=
$
{
payload
.
granularity
};
$
(
"
#granularity
"
).
val
(
value
);
});
</script>
<res:useJs
value=
"
${
res
.
js
.
local
.
problem_js
}
"
target=
"buttom-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
.
problemHistory_js
}
"
target=
"bottom-js"
/>
</jsp:body>
</a:report>
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/home/alterationDocument.jsp
0 → 100644
浏览文件 @
11461d3e
<%@ page
session=
"false"
language=
"java"
pageEncoding=
"UTF-8"
%>
<h3
class=
"text-error"
>
变更监控文档
</h3>
</br>
<h4
class=
"text-info"
>
记录及展示变更内容
</h4>
<h4
class=
"text-success"
>
HTTP API调用方式
</h4>
<p>
接口调用请求说明(插入数据)
</p>
<pre>
http请求方式: GET或者POST
http://主机域名:端口/cat/r/alteration?
</pre>
<p>
参数说明
</p>
<table
style=
"width:50%"
class=
"table table-striped table-bordered table-condensed"
>
<tr><th
width=
"30%"
>
参数
</th><th
width=
"70%"
>
说明
</th></tr>
<tr><td>
op
</td><td>
执行操作
<span
class=
"text-error"
>
必需[唯一值:insert]
</span></td></tr>
<tr><td>
type
</td><td>
变更类型
<span
class=
"text-error"
>
必需[可能值:puppet, workflow, lazyman]
</span></td></tr>
<tr><td>
title
</td><td>
变更标题
<span
class=
"text-error"
>
必需
</span></td></tr>
<tr><td>
domain
</td><td>
变更项目
<span
class=
"text-error"
>
必需
</span></td></tr>
<tr><td>
hostname
</td><td>
变更机器域名
<span
class=
"text-error"
>
必需
</span></td></tr>
<tr><td>
alterationDate
</td><td>
变更时间
<span
class=
"text-error"
>
必需[格式如:2014-03-30 00:00:00]
</span></td></tr>
<tr><td>
user
</td><td>
发起变更用户
<span
class=
"text-error"
>
必需
</span></td></tr>
<tr><td>
content
</td><td>
变更内容
<span
class=
"text-error"
>
必需
</span></td></tr>
<tr><td>
group
</td><td>
变更组别
<span
class=
"text-success"
>
可选
</span></td></tr>
<tr><td>
ip
</td><td>
变更机器ip
<span
class=
"text-success"
>
可选
</span></td></tr>
<tr><td>
url
</td><td>
变更连接
<span
class=
"text-success"
>
可选
</span></td></tr>
</table>
<p>
url示例(get方式)
</p>
<pre>
http://主机域名:端口/cat/r/alteration?op=insert
&
type=puppet
&
title=2
&
domain=3
&
hostname=1
&
alterationDate=2013-02-19%2000:00:00
&
user=5
&
content=6
&
group=
&
ip=
&
url=
</pre>
<p>
返回说明
</p>
<pre>
<span
class=
"text-success"
>
{"status":200} ——> 成功
</span>
<span
class=
"text-error"
>
{"status":500, "errorMessage":"lack args"} ——> 失败 [必需参数不全]
</span>
<span
class=
"text-error"
>
{"status":500} ——> 失败 [其它错误]
</span>
</pre>
</br>
cat-home/src/main/webapp/jsp/report/home/home.jsp
浏览文件 @
11461d3e
...
...
@@ -21,17 +21,20 @@
<li
class=
"text-right"
><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=
"#tab8"
data-toggle=
"tab"
><strong>
业务监控
</strong></a></li>
<li
class=
"text-right"
><a
href=
"#tab9"
data-toggle=
"tab"
><strong>
变更监控
</strong></a></li>
<li
class=
"text-right"
><a
href=
"#tab3"
data-toggle=
"tab"
><strong>
开发者文档
</strong></a></li>
<li
class=
"text-right"
><a
href=
"#tab4"
data-toggle=
"tab"
><strong>
设计文档
</strong></a></li>
<li
class=
"text-right"
><a
href=
"#tab5"
data-toggle=
"tab"
><strong>
用户文档
</strong></a></li>
<li
class=
"text-right"
><a
href=
"#tab6"
data-toggle=
"tab"
><strong>
常见问题
</strong></a></li>
<li
class=
"text-right"
><a
href=
"#tab7"
data-toggle=
"tab"
><strong>
插件扩展
</strong></a></li>
<li
class=
"text-right"
><a
href=
"#tab8"
data-toggle=
"tab"
><strong>
变更文档
</strong></a></li>
</ul>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"tab0"
><%@ include
file=
"dianping.jsp"
%></div>
<div
class=
"tab-pane"
id=
"tab1"
><%@ include
file=
"releasenotes.jsp"
%></div>
<div
class=
"tab-pane"
id=
"tab2"
><%@ include
file=
"integratingDocument.jsp"
%></div>
<div
class=
"tab-pane"
id=
"tab8"
><%@ include
file=
"integratingBusiness.jsp"
%></div>
<div
class=
"tab-pane"
id=
"tab9"
><%@ include
file=
"alterationDocument.jsp"
%></div>
<div
class=
"tab-pane"
id=
"tab3"
><%@ include
file=
"developDocument.jsp"
%></div>
<div
class=
"tab-pane"
id=
"tab4"
><%@ include
file=
"develop.jsp"
%></div>
<div
class=
"tab-pane"
id=
"tab5"
><%@ include
file=
"userDocument.jsp"
%></div>
...
...
cat-home/src/main/webapp/jsp/report/home/userDocument/integratingBusiness.jsp
0 → 100644
浏览文件 @
11461d3e
<%@ page
session=
"false"
language=
"java"
pageEncoding=
"UTF-8"
%>
<h3
class=
"text-error"
>
业务监控接入文档
</h3>
</br>
<h4
class=
"text-info"
>
强调两个名词,业务监控以及业务分析
</h4>
<h5>
a).业务分析,产品线有很多指标,来确定产品是否能满足用户需求,这部分DW在负责。
</h5>
<h5>
b).业务监控,它关注于最重要的业务指标,业务监控目的是快速发现业务是否存在问题,一旦出现问题,这类问题对于业务的影响有多大。
</h5>
<h5>
c).业务监控和业务分析有部分的交叉,业务监控数据可能是不准确的,比如销售额,他仅仅用于监控,用于发现业务是否正常。建议产品线的核心指标不超过6个。
</h5>
</br>
<h4
class=
"text-success"
>
第一步:确定业务指标
</h4>
<h4
class=
"text-error"
>
1).每个指标都有一个String作为它的唯一KEY,这个KEY在整个产品线中,不能重复。产品线的配置参考第三步。
</h4>
<p>
比如团购业务中,有两个核心指标,一个订单数量,一个是销售总金额
</p>
<p>
对这两个指标定义两个唯一的String,PayCount 和 PayAmount
</p>
</br>
<h4
class=
"text-success"
>
第二步:业务代码埋点
</h4>
<h5
class=
'text-error'
>
Metric一共有三个API,分别用来记录次数、平均、总和,统一粒度为一分钟
</h5>
<h5>
1.Java API调用方式
</h5>
<p>
1).logMetricForCount用于记录一个指标值出现的次数
</p>
<p>
2).logMetricForDuration用于记录一个指标出现的平均值
</p>
<p>
3).logMetricForSum用于记录一个指标出现的总和
</p>
<p
class=
'text-error'
>
4).PayCount记录次数选用logMetricForCount这个API,PayAmount记录总和选用logMetricForSum这个API
</p>
<p>
5).集成代码可能是如下所示
</p>
<img
class=
"img-polaroid"
width=
'60%'
src=
"${model.webapp}/images/business04.png"
/>
<h5>
2.HTTP API调用方式
</h5>
<p>
接口调用请求说明
</p>
<pre>
http请求方式: GET(请使用http协议)
http://cat.dianpingoa.com/cat/r/systemMonitor?
</pre>
<p>
参数说明
</p>
<table
style=
"width:50%"
class=
"table table-striped table-bordered table-condensed"
>
<tr><th
width=
"30%"
>
参数
</th><th>
说明
</th></tr>
<tr><td>
group
</td><td>
监控组唯一ID名称,
<span
class=
"text-error"
>
必需
</span></td></tr>
<tr><td>
domain
</td><td>
应用唯一ID名称,
<span
class=
"text-error"
>
必需
</span></td></tr>
<tr><td>
key
</td><td>
监控业务唯一ID名称,
<span
class=
"text-error"
>
必需
</span></td></tr>
<tr><td>
op
</td><td>
sum,avg,count[
<span
class=
"text-error"
>
默认
</span>
]
</td></tr>
<tr><td>
count
</td><td>
op=count时所需,
<span
class=
"text-error"
>
默认为1
</span></td></tr>
<tr><td>
sum
</td><td>
op=sum时所需,
<span
class=
"text-error"
>
默认为0
</span></td></tr>
<tr><td>
avg
</td><td>
op=avg时所需,
<span
class=
"text-error"
>
默认为0
</span></td></tr>
</table>
<p>
1).op = count时,用于记录一个指标值出现的次数
</p>
<pre>
http://cat.dianpingoa.com/cat/r/monitor?group=myGroup
&
domain=myApp
&
key=myKey
&
op=count
</pre>
<p>
2).op = avg时,用于记录一个指标出现的平均值
</p>
<pre>
http://cat.dianpingoa.com/cat/r/monitor?group=myGroup
&
domain=myApp
&
key=myKey
&
op=avg
&
avg=500
</pre>
<p>
3).op = sum时,用于记录一个指标出现的总和
</p>
<pre>
http://cat.dianpingoa.com/cat/r/monitor?group=myGroup
&
domain=myApp
&
key=myKey
&
op=sum
&
sum=500
</pre>
<p>
返回说明
</p>
<pre>
<span
class=
"text-error"
>
{"statusCode":"-1","errorMsg":"Unknown [ domain,group,key ] name!"} ——> 失败 [必需参数缺失]
</span>
<span
class=
"text-success"
>
{"statusCode":"0"} ——> 成功
</span>
</pre>
</br>
</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>
<h4
class=
"text-success"
>
第四步:图形展示配置
</h4>
<p>
当程序埋点好,后端的Metric指标的数据都是自动插入到CAT数据库中,不需要用户进行新建业务指标,用户直接修改即可。
</p>
<p>
此时已经能展示基本的业务监控曲线,如果需要一些其他的配置,比如业务监控图形顺序,展示标题等。
</p>
<h4
class=
"text-error"
>
url :
<a
href=
"/cat/s/config?op=metricConfigList"
target=
"_blank"
>
链接
</a></h4>
<img
class=
"img-polaroid"
width=
'60%'
src=
"${model.webapp}/images/business02.png"
/>
</br>
<h4
class=
"text-success"
>
第五步:配置公司级别业务大盘【运维配置】
</h4>
<p>
业务大盘讲各个产品线重要的业务指标进行汇总,统一展示在一个监控大盘中。
</p>
<h4
class=
"text-error"
>
url :
<a
href=
"/cat/s/config?op=metricConfigList"
target=
"_blank"
>
链接
</a></h4>
<img
class=
"img-polaroid"
width=
'60%'
src=
"${model.webapp}/images/business03.png"
/>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录