Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ops
/
monitor-ui
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
jack
8 years ago
Commit
b2c6d66cbb7ec71db52cd0ff5c8915fccb8a400c
2 parents
c99f7355
96bd99c8
Merge branch 'dev1019'
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
46 deletions
monitor-ui-common/src/main/java/com/ui/contants/HttpUriContants.java
monitor-ui-common/src/main/java/com/ui/model/req/JavaApiMonitorReq.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/JavaMonitorCtrl.java
monitor-ui-web/src/main/webapp/jsp/javaMonitor/javaApiInfoList.jsp
monitor-ui-web/src/main/webapp/jsp/javaMonitor/javaMonitor.jsp
monitor-ui-common/src/main/java/com/ui/contants/HttpUriContants.java
View file @
b2c6d66
...
...
@@ -161,5 +161,6 @@ public class HttpUriContants {
public
static
final
String
JAVA_MONITOR_GET
=
"/newJavaApiInfo/queryByServiceType"
;
public
static
final
String
JAVA_GRAPH_GET
=
"/newJavaApiInfo/getJavaApiGraph"
;
public
static
final
String
JAVA_IP_LIST
=
"/newJavaApiInfo/getIPList"
;
public
static
final
String
JAVA_API_LIST
=
"/newJavaApiInfo/queryByServiceTypeAndIP"
;
}
...
...
monitor-ui-common/src/main/java/com/ui/model/req/JavaApiMonitorReq.java
View file @
b2c6d66
...
...
@@ -21,4 +21,10 @@ public class JavaApiMonitorReq extends PageRequest {
//云类型 1-aws,2-qcloud
private
int
cloudType
;
private
String
startTime
;
private
String
endTime
;
private
String
ip
;
}
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/JavaMonitorCtrl.java
View file @
b2c6d66
...
...
@@ -74,4 +74,11 @@ public class JavaMonitorCtrl {
return
rep
;
}
@RequestMapping
(
"/queryByServiceTypeAndIP"
)
@ResponseBody
public
BaseResponse
queryByServiceTypeAndIP
(
JavaApiMonitorReq
req
)
{
BaseResponse
rep
=
httpClient
.
defaultPost
(
HttpUriContants
.
JAVA_API_LIST
,
req
,
BaseResponse
.
class
);
return
rep
;
}
}
...
...
monitor-ui-web/src/main/webapp/jsp/javaMonitor/javaApiInfoList.jsp
View file @
b2c6d66
...
...
@@ -59,7 +59,7 @@
</div>
<div
class=
"input-group"
style=
"margin-left: 15px"
>
<span
class=
"input-group-addon"
>
IP:
</span>
<select
id=
"iPName"
name=
"iPName"
class=
"form-control"
style=
"width: 200px"
>
<select
id=
"iPName"
name=
"iPName"
class=
"form-control"
style=
"width: 200px"
onchange=
"getIpOnchange()"
>
</select>
</div>
</div>
...
...
@@ -116,6 +116,18 @@
getJavaAppType
(
cloudType
);
}
//ip类型选择事件
function
getIpOnchange
()
{
$
(
"#infoTable"
).
table
(
"load"
,
{
startTime
:
startTime
,
endTime
:
endTime
,
serviceType
:
serviceType
,
serviceName
:
serviceName
,
ip
:
$
(
"#iPName"
).
val
(),
cloudType
:
$
(
"#cloudType"
).
val
()
});
}
var
getJavaAppType
=
function
(
cloudType
)
{
$
.
ajax
({
url
:
contextPath
+
"/javaMonitor/queryIpList"
,
...
...
@@ -142,7 +154,13 @@
$
(
"#infoTable"
).
table
({
columnAutoWidth
:
false
,
url
:
contextPath
+
"/javaMonitor/query"
,
url
:
contextPath
+
"/javaMonitor/queryByServiceTypeAndIP"
,
queryParams
:
{
startTime
:
startTime
,
endTime
:
endTime
,
serviceType
:
serviceType
,
serviceName
:
serviceName
},
striped
:
true
,
title
:
"java服务监控信息列表"
,
dataType
:
"json"
,
...
...
@@ -153,6 +171,17 @@
},
onLoadSuccess
:
function
(
data
)
{
if
(
data
!=
null
){
//同步加载根据平均耗时排序的tab页列表
var
costObj
=
new
Array
();
for
(
var
j
=
0
;
j
<
data
.
length
;
j
++
){
costObj
.
push
(
data
[
j
]);
}
//按平均耗时从大到小排序ss
costObj
.
sort
(
function
(
a
,
b
){
return
b
.
avgCost
-
a
.
avgCost
;
});
//同步加载根据异常次数排序的tab页列表
var
errorObj
=
new
Array
();
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -163,36 +192,38 @@
return
b
.
errorCount
-
a
.
errorCount
;
});
$
(
"#infoTable1"
).
table
(
"loadLoaclData"
,
errorObj
);
return
costObj
;
}
},
columns
:
[{
title
:
"接口名"
,
field
:
"
ip
"
,
field
:
"
apiName
"
,
width
:
"10%"
,
sortable
:
true
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
var
div
=
$
(
"<div>"
);
var
editBtn
=
$
(
"<button>"
).
addClass
(
"btn btn-xs btn-success"
).
html
(
rowData
.
ip
).
appendTo
(
div
);
editBtn
.
click
(
function
()
{
var
dialog
=
$
(
"<div>"
).
appendTo
(
$
(
"body"
));
dialog
.
dialog
({
backdrop
:
"static"
,
title
:
"API详情"
,
href
:
contextPath
+
"jsp/javaMonitor/javaIpInfoList.jsp"
,
height
:
"80%"
,
width
:
"60%"
,
buttons
:
[{
text
:
"关闭"
,
className
:
"btn-info"
,
onclick
:
function
()
{
$
(
dialog
).
dialog
(
"hide"
);
}
}]
});
});
return
div
;
}
sortable
:
true
// formatter: function (value, rowData, rowIndex) {
// var div = $("<div>");
// var editBtn = $("<button>").addClass("btn btn-xs btn-success").html(rowData.ip).appendTo(div);
// editBtn.click(function () {
// var dialog = $("<div>").appendTo($("body"));
// dialog.dialog({
// backdrop: "static",
// title: "API详情",
// href: contextPath + "jsp/javaMonitor/javaIpInfoList.jsp",
// height: "80%",
// width: "60%",
// buttons: [{
// text: "关闭",
// className: "btn-info",
// onclick: function () {
// $(dialog).dialog("hide");
// }
// }]
// });
//
// });
// return div;
// }
},
{
title
:
"总请求次数"
,
field
:
"totalCount"
,
...
...
@@ -282,14 +313,15 @@
sortable
:
true
,
//是否启用排序
sortOrder
:
"desc"
,
columns
:
[{
title
:
"IP"
,
field
:
"ip"
,
title
:
"接口名"
,
field
:
"apiName"
,
width
:
"10%"
,
sortable
:
true
},
{
title
:
"网络归属"
,
field
:
"type"
,
width
:
"10%"
title
:
"总请求次数"
,
field
:
"totalCount"
,
width
:
"10%"
,
sortable
:
true
},
{
title
:
"请求异常次数"
,
field
:
"errorCount"
,
...
...
monitor-ui-web/src/main/webapp/jsp/javaMonitor/javaMonitor.jsp
View file @
b2c6d66
...
...
@@ -33,15 +33,15 @@
<h5>
Java服务监控曲线
</h5>
</div>
<div
class=
"widget-content nopadding"
>
<div
class=
"widget-title"
style=
"height:
3
00px;"
>
<div
class=
"widget-title"
style=
"height:
4
00px;"
>
<div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv"
style=
" margin-top: 12px;margin-left: 10px;float: left;"
>
<div
id=
"costCharts"
class=
"input-group"
style=
"float: left;height: 280px;width: 720px"
>
style=
" margin-top: 12px;margin-left: 10px;"
>
<div
id=
"costCharts"
class=
"input-group"
style=
"height: 380px;width: 760px"
>
</div>
</div>
<div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv1"
style=
" margin-top: 12px;margin-left: 25px;float: left;"
>
<div
id=
"timesCharts"
class=
"input-group"
style=
"
float: left;height: 280px;width: 72
0px"
>
<div
id=
"timesCharts"
class=
"input-group"
style=
"
height: 380px;width: 760px;margin-left: 10
0px"
>
</div>
</div>
</div>
...
...
@@ -285,8 +285,8 @@
sortOrder
:
"desc"
,
loadFilter
:
function
(
data
)
{
//记录下开始时间和结束时间
paramObj
.
startTime
=
data
.
startTime
;
paramObj
.
endTime
=
data
.
endTime
;
paramObj
.
startTime
=
data
.
data
.
startTime
;
paramObj
.
endTime
=
data
.
data
.
endTime
;
return
defaultLoadFilter
(
data
).
content
;
},
onLoadSuccess
:
function
(
data
)
{
...
...
@@ -410,12 +410,12 @@
field
:
"cpuRate"
,
width
:
"10%"
},{
title
:
"可用内存/总内存(M)"
,
title
:
"可用内存/总内存(M
B
)"
,
field
:
"memoryRate"
,
width
:
"10%"
},{
title
:
"带宽(IN/OUT)(
kb
ps)"
,
title
:
"带宽(IN/OUT)(
KB
ps)"
,
field
:
"bandwidth"
,
width
:
"10%"
...
...
@@ -528,7 +528,7 @@
field
:
"cpuRate"
,
width
:
"10%"
},{
title
:
"可用内存/总内存(M)"
,
title
:
"可用内存/总内存(M
B
)"
,
field
:
"memoryRate"
,
// formatter: function (value, rowData, rowIndex) {
// if (rowData.apiToggle == 0)
...
...
@@ -539,7 +539,7 @@
width
:
"10%"
},{
title
:
"带宽(IN/OUT)(
kb
ps)"
,
title
:
"带宽(IN/OUT)(
KB
ps)"
,
field
:
"bandwidth"
,
width
:
"15%"
...
...
@@ -649,7 +649,7 @@
field
:
"cpuRate"
,
width
:
"10%"
},{
title
:
"可用内存/总内存(M)"
,
title
:
"可用内存/总内存(M
B
)"
,
field
:
"memoryRate"
,
// formatter: function (value, rowData, rowIndex) {
// if (rowData.apiToggle == 0)
...
...
@@ -660,7 +660,7 @@
width
:
"10%"
},{
title
:
"带宽(IN/OUT)(
kb
ps)"
,
title
:
"带宽(IN/OUT)(
KB
ps)"
,
field
:
"bandwidth"
,
width
:
"15%"
...
...
@@ -677,8 +677,6 @@
//新增
$
(
"#searchJavaInfoBtn"
).
click
(
function
()
{
// paramObj.markingPustId = 0;
// paramObj.markingPushFlag = '1';
var
url
=
contextPath
+
"/javaMonitor/toJavaApiInfoList"
;
var
serviceType
=
$
(
"#searchApiName"
).
val
();
var
serviceName
=
$
(
"#searchApiName"
).
select
(
"getText"
);
...
...
Please
register
or
login
to post a comment