Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
d187ebf3
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,发现更多精彩内容 >>
提交
d187ebf3
编写于
7月 16, 2014
作者:
J
jialinsun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
resolve
上级
8ede6385
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
395 addition
and
28 deletion
+395
-28
cat-core/src/main/java/com/dianping/cat/config/app/AppDataService.java
...main/java/com/dianping/cat/config/app/AppDataService.java
+55
-7
cat-home/src/main/java/com/dianping/cat/build/ComponentsConfigurator.java
...n/java/com/dianping/cat/build/ComponentsConfigurator.java
+6
-0
cat-home/src/main/java/com/dianping/cat/report/page/app/Handler.java
...c/main/java/com/dianping/cat/report/page/app/Handler.java
+35
-5
cat-home/src/main/java/com/dianping/cat/report/page/app/Model.java
...src/main/java/com/dianping/cat/report/page/app/Model.java
+14
-0
cat-home/src/main/java/com/dianping/cat/report/page/app/Payload.java
...c/main/java/com/dianping/cat/report/page/app/Payload.java
+11
-0
cat-home/src/main/java/com/dianping/cat/report/page/app/graph/AppGraphCreator.java
...m/dianping/cat/report/page/app/graph/AppGraphCreator.java
+72
-0
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+73
-0
cat-home/src/main/webapp/js/baseGraph.js
cat-home/src/main/webapp/js/baseGraph.js
+75
-0
cat-home/src/main/webapp/jsp/report/app.jsp
cat-home/src/main/webapp/jsp/report/app.jsp
+54
-16
未找到文件。
cat-core/src/main/java/com/dianping/cat/config/app/AppDataService.java
浏览文件 @
d187ebf3
package
com.dianping.cat.config.app
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Random
;
public
class
AppDataService
{
public
void
insert
(){
public
static
final
String
SUCCESS_RATIO
=
"successRatio"
;
public
static
final
String
REQUEST_COUNT
=
"requestCount"
;
public
static
final
String
DELAY_AVG
=
"delayAvg"
;
public
void
insert
()
{
}
public
Map
<
String
,
double
[]>
queryAppValue
(
QueryEntity
entity
,
String
type
)
{
if
(
SUCCESS_RATIO
.
equals
(
type
))
{
return
querySuccessRatio
(
entity
);
}
else
if
(
REQUEST_COUNT
.
equals
(
type
))
{
return
queryRequestCount
(
entity
);
}
else
if
(
DELAY_AVG
.
equals
(
type
))
{
return
queryDelayAvg
(
entity
);
}
else
{
return
new
LinkedHashMap
<
String
,
double
[]>();
}
}
public
void
queryAvg
(
QueryEntity
entity
)
{
private
Map
<
String
,
double
[]>
makeMockValue
(
String
type
)
{
Map
<
String
,
double
[]>
map
=
new
LinkedHashMap
<
String
,
double
[]>();
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
cal
.
set
(
Calendar
.
MINUTE
,
0
);
cal
.
set
(
Calendar
.
SECOND
,
0
);
cal
.
set
(
Calendar
.
MILLISECOND
,
0
);
long
startTime
=
cal
.
getTime
().
getTime
();
long
current
=
System
.
currentTimeMillis
();
long
endTime
=
current
-
current
%
300000
;
int
n
=
(
int
)
(
endTime
-
startTime
)
/
300000
;
double
[]
value
=
new
double
[
n
];
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
value
[
i
]
=
(
new
Random
().
nextDouble
()
+
1
)
*
100
;
}
map
.
put
(
type
,
value
);
return
map
;
}
private
Map
<
String
,
double
[]>
queryDelayAvg
(
QueryEntity
entity
)
{
return
makeMockValue
(
DELAY_AVG
);
}
p
ublic
void
query
Count
(
QueryEntity
entity
)
{
p
rivate
Map
<
String
,
double
[]>
queryRequest
Count
(
QueryEntity
entity
)
{
return
makeMockValue
(
REQUEST_COUNT
);
}
public
void
querySuccessRate
(
QueryEntity
entity
)
{
private
Map
<
String
,
double
[]>
querySuccessRatio
(
QueryEntity
entity
)
{
return
makeMockValue
(
SUCCESS_RATIO
);
}
public
static
class
Statistics
{
...
...
@@ -50,5 +98,5 @@ public class AppDataService {
m_avg
=
avg
;
}
}
}
cat-home/src/main/java/com/dianping/cat/build/ComponentsConfigurator.java
浏览文件 @
d187ebf3
...
...
@@ -12,6 +12,7 @@ import org.unidal.lookup.configuration.Component;
import
com.dianping.cat.CatHomeModule
;
import
com.dianping.cat.ServerConfigManager
;
import
com.dianping.cat.config.app.AppDataService
;
import
com.dianping.cat.consumer.dependency.DependencyAnalyzer
;
import
com.dianping.cat.consumer.metric.MetricAnalyzer
;
import
com.dianping.cat.consumer.metric.MetricConfigManager
;
...
...
@@ -36,6 +37,7 @@ import com.dianping.cat.report.graph.GraphBuilder;
import
com.dianping.cat.report.graph.ValueTranslater
;
import
com.dianping.cat.report.page.JsonBuilder
;
import
com.dianping.cat.report.page.PayloadNormalizer
;
import
com.dianping.cat.report.page.app.graph.AppGraphCreator
;
import
com.dianping.cat.report.page.cdn.graph.CdnGraphCreator
;
import
com.dianping.cat.report.page.dependency.graph.TopologyGraphBuilder
;
import
com.dianping.cat.report.page.dependency.graph.TopologyGraphConfigManager
;
...
...
@@ -160,6 +162,10 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
all
.
add
(
C
(
NetworkGraphCreator
.
class
).
req
(
CachedMetricReportService
.
class
,
DataExtractor
.
class
,
MetricDataFetcher
.
class
).
req
(
BaselineService
.
class
,
MetricConfigManager
.
class
,
ProductLineConfigManager
.
class
,
MetricGroupConfigManager
.
class
,
AlertInfo
.
class
));
all
.
add
(
C
(
AppGraphCreator
.
class
).
req
(
AppDataService
.
class
,
CachedMetricReportService
.
class
,
DataExtractor
.
class
,
MetricDataFetcher
.
class
).
req
(
BaselineService
.
class
,
MetricConfigManager
.
class
,
ProductLineConfigManager
.
class
,
MetricGroupConfigManager
.
class
,
AlertInfo
.
class
));
// report serivce
all
.
addAll
(
new
ReportServiceComponentConfigurator
().
defineComponents
());
// task
...
...
cat-home/src/main/java/com/dianping/cat/report/page/app/Handler.java
浏览文件 @
d187ebf3
package
com.dianping.cat.report.page.app
;
import
java.io.IOException
;
import
java.util.Iterator
;
import
java.util.Map
;
import
javax.servlet.ServletException
;
import
com.dianping.cat.config.app.AppConfigManager
;
import
com.dianping.cat.config.app.QueryEntity
;
import
com.dianping.cat.report.ReportPage
;
import
org.codehaus.plexus.util.StringUtils
;
import
org.unidal.lookup.annotation.Inject
;
import
org.unidal.web.mvc.PageHandler
;
import
org.unidal.web.mvc.annotation.InboundActionMeta
;
import
org.unidal.web.mvc.annotation.OutboundActionMeta
;
import
org.unidal.web.mvc.annotation.PayloadMeta
;
import
com.dianping.cat.config.app.AppConfigManager
;
import
com.dianping.cat.config.app.QueryEntity
;
import
com.dianping.cat.report.ReportPage
;
import
com.dianping.cat.report.page.LineChart
;
import
com.dianping.cat.report.page.app.graph.AppGraphCreator
;
public
class
Handler
implements
PageHandler
<
Context
>
{
@Inject
private
JspViewer
m_jspViewer
;
...
...
@@ -20,6 +26,9 @@ public class Handler implements PageHandler<Context> {
@Inject
private
AppConfigManager
m_manager
;
@Inject
private
AppGraphCreator
m_appGraphCreator
;
@Override
@PayloadMeta
(
Payload
.
class
)
@InboundActionMeta
(
name
=
"app"
)
...
...
@@ -45,13 +54,34 @@ public class Handler implements PageHandler<Context> {
QueryEntity
entity1
=
payload
.
getQueryEntity1
();
QueryEntity
entity2
=
payload
.
getQueryEntity2
();
String
type
=
payload
.
getType
();
if
(
StringUtils
.
isEmpty
(
type
))
{
type
=
"successRatio"
;
}
LineChart
lineCharts
=
new
LineChart
();
if
(
entity1
!=
null
)
{
System
.
out
.
println
(
entity1
.
toString
());
LineChart
lineChart1
=
m_appGraphCreator
.
buildChartsByProductLine
(
entity1
,
type
);
Iterator
<
String
>
ititle
=
lineChart1
.
getSubTitles
().
iterator
();
Iterator
<
Map
<
Long
,
Double
>>
idata
=
lineChart1
.
getDatas
().
iterator
();
while
(
ititle
.
hasNext
()
&&
idata
.
hasNext
())
{
lineCharts
.
add
(
ititle
.
next
().
toString
(),
idata
.
next
());
}
}
if
(
entity2
!=
null
)
{
System
.
out
.
println
(
entity2
.
toString
());
LineChart
lineChart2
=
m_appGraphCreator
.
buildChartsByProductLine
(
entity2
,
type
);
Iterator
<
String
>
ititle
=
lineChart2
.
getSubTitles
().
iterator
();
Iterator
<
Map
<
Long
,
Double
>>
idata
=
lineChart2
.
getDatas
().
iterator
();
while
(
ititle
.
hasNext
()
&&
idata
.
hasNext
())
{
lineCharts
.
add
(
ititle
.
next
().
toString
(),
idata
.
next
());
}
}
lineCharts
.
setId
(
"app"
);
lineCharts
.
setHtmlTitle
(
type
);
model
.
setLineChart
(
lineCharts
);
if
(!
ctx
.
isProcessStopped
())
{
m_jspViewer
.
view
(
ctx
,
model
);
...
...
cat-home/src/main/java/com/dianping/cat/report/page/app/Model.java
浏览文件 @
d187ebf3
...
...
@@ -6,14 +6,20 @@ import java.util.LinkedHashMap;
import
java.util.List
;
import
java.util.Map
;
import
org.unidal.web.mvc.view.annotation.EntityMeta
;
import
com.dianping.cat.configuration.app.entity.Code
;
import
com.dianping.cat.configuration.app.entity.Command
;
import
com.dianping.cat.configuration.app.entity.Item
;
import
com.dianping.cat.report.page.AbstractReportModel
;
import
com.dianping.cat.report.page.JsonBuilder
;
import
com.dianping.cat.report.page.LineChart
;
public
class
Model
extends
AbstractReportModel
<
Action
,
Context
>
{
@EntityMeta
private
LineChart
m_lineChart
;
private
List
<
Item
>
m_cities
;
private
List
<
Item
>
m_versions
;
...
...
@@ -117,4 +123,12 @@ public class Model extends AbstractReportModel<Action, Context> {
public
void
setVersions
(
List
<
Item
>
versions
)
{
m_versions
=
versions
;
}
public
LineChart
getLineChart
()
{
return
m_lineChart
;
}
public
void
setLineChart
(
LineChart
lineChart
)
{
m_lineChart
=
lineChart
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/app/Payload.java
浏览文件 @
d187ebf3
...
...
@@ -19,6 +19,9 @@ public class Payload extends AbstractReportPayload<Action> {
@FieldMeta
(
"query2"
)
private
String
m_query2
;
@FieldMeta
(
"type"
)
private
String
m_type
=
"successRatio"
;
public
Payload
()
{
super
(
ReportPage
.
APP
);
}
...
...
@@ -74,6 +77,14 @@ public class Payload extends AbstractReportPayload<Action> {
m_query2
=
query2
;
}
public
void
setType
(
String
type
)
{
m_type
=
type
;
}
public
String
getType
()
{
return
m_type
;
}
@Override
public
void
validate
(
ActionContext
<?>
ctx
)
{
if
(
m_action
==
null
)
{
...
...
cat-home/src/main/java/com/dianping/cat/report/page/app/graph/AppGraphCreator.java
0 → 100644
浏览文件 @
d187ebf3
package
com.dianping.cat.report.page.app.graph
;
import
java.util.Date
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
org.unidal.lookup.annotation.Inject
;
import
com.dianping.cat.config.app.AppDataService
;
import
com.dianping.cat.config.app.QueryEntity
;
import
com.dianping.cat.helper.TimeUtil
;
import
com.dianping.cat.report.chart.AbstractGraphCreator
;
import
com.dianping.cat.report.page.LineChart
;
public
class
AppGraphCreator
extends
AbstractGraphCreator
{
@Inject
private
AppDataService
m_appDataService
;
public
LineChart
buildChartsByProductLine
(
QueryEntity
queryEntity
,
String
type
)
{
Map
<
String
,
double
[]>
values
=
prepareAllData
(
queryEntity
,
type
);
long
startTime
=
queryEntity
.
getDate
().
getTime
();
long
endTime
=
startTime
+
TimeUtil
.
ONE_DAY
;
Date
endDate
=
new
Date
(
endTime
);
Date
startDate
=
new
Date
(
startTime
);
return
buildChartData
(
values
,
startDate
,
endDate
);
}
private
Map
<
String
,
double
[]>
prepareAllData
(
QueryEntity
queryEntity
,
String
type
)
{
Map
<
String
,
double
[]>
value
=
m_appDataService
.
queryAppValue
(
queryEntity
,
type
);
return
value
;
}
public
LineChart
buildChartData
(
final
Map
<
String
,
double
[]>
datas
,
Date
startDate
,
Date
endDate
)
{
LineChart
lineChart
=
new
LineChart
();
for
(
Entry
<
String
,
double
[]>
entry
:
datas
.
entrySet
())
{
String
key
=
entry
.
getKey
();
lineChart
.
setId
(
startDate
.
toString
());
lineChart
.
setHtmlTitle
(
key
);
Map
<
Long
,
Double
>
all
=
convertToMap
(
datas
.
get
(
key
),
startDate
,
endDate
,
5
);
lineChart
.
add
(
startDate
.
toString
(),
all
);
}
return
lineChart
;
}
protected
Map
<
Long
,
Double
>
convertToMap
(
double
[]
data
,
Date
start
,
Date
end
,
int
step
)
{
Map
<
Long
,
Double
>
map
=
new
LinkedHashMap
<
Long
,
Double
>();
int
length
=
data
.
length
;
long
startTime
=
start
.
getTime
();
long
endTime
=
end
.
getTime
();
long
time
=
startTime
;
int
i
=
0
;
for
(;
i
<
length
;
i
++)
{
time
+=
step
*
TimeUtil
.
ONE_MINUTE
;
map
.
put
(
time
,
data
[
i
]);
}
for
(;
time
<
endTime
;
time
+=
step
*
TimeUtil
.
ONE_MINUTE
)
{
map
.
put
(
time
,
-
1
D
);
}
return
map
;
}
}
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
d187ebf3
...
...
@@ -383,6 +383,39 @@
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.page.app.graph.AppGraphCreator
</role>
<implementation>
com.dianping.cat.report.page.app.graph.AppGraphCreator
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.config.app.AppDataService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.chart.CachedMetricReportService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.chart.DataExtractor
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.chart.MetricDataFetcher
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.baseline.BaselineService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.consumer.metric.MetricConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.consumer.metric.ProductLineConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.system.config.MetricGroupConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.task.alert.AlertInfo
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.service.impl.TransactionReportService
</role>
<implementation>
com.dianping.cat.report.service.impl.TransactionReportService
</implementation>
...
...
@@ -3643,6 +3676,9 @@
<requirement>
<role>
com.dianping.cat.config.app.AppConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.page.app.graph.AppGraphCreator
</role>
</requirement>
</requirements>
</component>
<component>
...
...
@@ -3663,6 +3699,43 @@
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.page.app.graph.AppGraphCreator
</role>
<implementation>
com.dianping.cat.report.page.app.graph.AppGraphCreator
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.config.app.AppDataService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.baseline.BaselineService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.chart.DataExtractor
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.chart.MetricDataFetcher
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.chart.CachedMetricReportService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.consumer.metric.MetricConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.consumer.metric.ProductLineConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.system.config.MetricGroupConfigManager
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.report.task.alert.AlertInfo
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.config.app.AppDataService
</role>
<implementation>
com.dianping.cat.config.app.AppDataService
</implementation>
</component>
<component>
<role>
com.dianping.cat.system.SystemModule
</role>
<implementation>
com.dianping.cat.system.SystemModule
</implementation>
...
...
cat-home/src/main/webapp/js/baseGraph.js
浏览文件 @
d187ebf3
...
...
@@ -117,8 +117,82 @@ function graphMetricChart(container, data) {
week
:
'
%Y-%m-%d
'
,
month
:
'
%m-%d
'
,
year
:
'
%Y-%m
'
},
},
yAxis
:
{
min
:
ylabelMin
,
title
:
{
text
:
data
.
unit
,
}
},
credits
:
{
enabled
:
false
},
plotOptions
:
{
spline
:
{
lineWidth
:
2
,
states
:
{
hover
:
{
lineWidth
:
2
}
},
marker
:
{
enabled
:
false
}
}
},
legend
:
{
maxHeight
:
82
},
tooltip
:
{
allowPointSelect
:
false
,
formatter
:
function
()
{
var
number0
=
Number
(
this
.
y
).
toFixed
(
0
);
var
number1
=
Number
(
this
.
y
).
toFixed
(
1
);
var
number
=
number1
;
if
(
Number
(
number1
)
==
Number
(
number0
)){
number
=
number0
;
}
return
Highcharts
.
dateFormat
(
'
%Y-%m-%d %H:%M
'
,
this
.
x
)
+
'
<br/>[
'
+
this
.
series
.
name
+
'
]
'
+
'
<b>
'
+
number
+
'
</b>
'
;
}
},
series
:
_data
});
}
function
graphMetricChart2
(
container
,
data
)
{
Highcharts
.
setOptions
({
global
:
{
useUTC
:
false
}
});
var
ylabelMin
=
data
.
minYlable
;
var
_data
=
parseMetricLineData
(
data
);
$
(
container
).
highcharts
(
{
chart
:
{
type
:
'
spline
'
},
title
:
{
text
:
data
.
htmlTitle
,
useHTML
:
true
},
xAxis
:
{
type
:
'
datetime
'
,
dateTimeLabelFormats
:
{
second
:
'
%H:%M:%S
'
,
minute
:
'
%H:%M
'
,
hour
:
'
%H:%M
'
,
day
:
'
%m-%d
'
,
week
:
'
%Y-%m-%d
'
,
month
:
'
%m-%d
'
,
year
:
'
%Y-%m
'
},
},
yAxis
:
{
min
:
ylabelMin
,
title
:
{
...
...
@@ -163,6 +237,7 @@ function graphMetricChart(container, data) {
series
:
_data
});
}
function
graphLineChart
(
container
,
data
)
{
Highcharts
.
setOptions
({
global
:
{
...
...
cat-home/src/main/webapp/jsp/report/app.jsp
浏览文件 @
d187ebf3
...
...
@@ -3,18 +3,18 @@
<%@ 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.app.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.app.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.app.Model"
scope=
"request"
/>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.app.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.app.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.app.Model"
scope=
"request"
/>
<a:body>
<res:useCss
value=
"
${
res
.
css
.
local
[
'select2.css'
]
}
"
target=
"head-css"
/>
<res:useCss
value=
"
${
res
.
css
.
local
[
'bootstrap-datetimepicker.min.css'
]
}
"
target=
"head-css"
/>
<res:useCss
value=
"
${
res
.
css
.
local
[
'bootstrap-datetimepicker.min.css'
]
}
"
target=
"head-css"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'select2.min.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'bootstrap-datetimepicker.min.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'bootstrap-datetimepicker.min.js'
]
}
"
target=
"head-js"
/>
<res:useJs
value=
"
${
res
.
js
.
local
[
'baseGraph.js'
]
}
"
target=
"head-js"
/>
<script
type=
"text/javascript"
>
var
commandInfo
=
$
{
model
.
command
};
...
...
@@ -61,7 +61,7 @@
return
myDate
.
getFullYear
()
+
"
-
"
+
myDate
.
getMonth
()
+
"
-
"
+
myDate
.
getDate
();
}
function
query
()
{
var
time
=
$
(
"
#time
"
).
val
();
var
command
=
$
(
"
#command
"
).
val
();
...
...
@@ -94,8 +94,18 @@
+
split
+
palteform2
+
split
+
city2
+
split
+
operator2
;
}
var
checkboxs
=
document
.
getElementsByName
(
"
typeCheckbox
"
);
var
type
=
""
;
for
(
var
i
=
0
;
i
<
checkboxs
.
length
;
i
++
){
if
(
checkboxs
[
i
].
checked
){
type
=
checkboxs
[
i
].
value
;
break
;
}
}
var
href
=
"
?query1=
"
+
query1
+
"
&query2=
"
+
query2
;
var
href
=
"
?query1=
"
+
query1
+
"
&query2=
"
+
query2
+
"
&type=
"
+
type
;
window
.
location
.
href
=
href
;
}
...
...
@@ -113,13 +123,14 @@
command2
.
on
(
'
change
'
,
command2Change
);
$
(
"
#command
"
).
val
(
words
[
1
]);
if
(
words
[
0
]
==
null
||
words
[
0
].
length
==
0
)
{
if
(
words
[
0
]
==
null
||
words
[
0
].
length
==
0
)
{
$
(
"
#time
"
).
val
(
getDate
());
}
else
{
}
else
{
$
(
"
#time
"
).
val
(
words
[
0
]);
}
command1Change
();
$
(
"
#code
"
).
val
(
words
[
2
]);
$
(
"
#network
"
).
val
(
words
[
3
]);
...
...
@@ -134,9 +145,9 @@
document
.
getElementById
(
"
checkbox
"
).
checked
=
true
;
var
words
=
query2
.
split
(
"
;
"
);
if
(
words
[
0
]
==
null
||
words
[
0
].
length
==
0
)
{
if
(
words
[
0
]
==
null
||
words
[
0
].
length
==
0
)
{
$
(
"
#time2
"
).
val
(
getDate
());
}
else
{
}
else
{
$
(
"
#time2
"
).
val
(
words
[
0
]);
}
...
...
@@ -149,9 +160,22 @@
$
(
"
#platform2
"
).
val
(
words
[
6
]);
$
(
"
#city2
"
).
val
(
words
[
7
]);
$
(
"
#operator2
"
).
val
(
words
[
8
]);
}
else
{
}
else
{
$
(
"
#time2
"
).
val
(
getDate
());
}
var
checkboxs
=
document
.
getElementsByName
(
"
typeCheckbox
"
);
for
(
var
i
=
0
;
i
<
checkboxs
.
length
;
i
++
){
if
(
checkboxs
[
i
].
value
==
"
${payload.type}
"
){
checkboxs
[
i
].
checked
=
true
;
break
;
}
}
var
data
=
$
{
model
.
lineChart
.
jsonString
};
graphMetricChart2
(
document
.
getElementById
(
'
${model.lineChart.id}
'
),
data
);
});
</script>
<div
class=
"report"
>
...
...
@@ -258,6 +282,20 @@
</tr>
</table>
<div
class=
"btn-group"
data-toggle=
"buttons"
>
<label
class=
"btn btn-info"
>
<input
type=
"radio"
name=
"typeCheckbox"
value=
"successRatio"
>
成功率
</label>
<label
class=
"btn btn-info"
>
<input
type=
"radio"
name=
"typeCheckbox"
value=
"requestCount"
>
总请求数
</label>
<label
class=
"btn btn-info"
>
<input
type=
"radio"
name=
"typeCheckbox"
value=
"delayAvg"
>
成功延时(ms)
</label>
</div>
<div
style=
"float:left;width:95%;"
>
<div
id=
"${model.lineChart.id}"
></div>
</div>
<table
class=
"footer"
>
<tr>
<td>
[ end ]
</td>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录