Authored by jack

Merge branch 'dev1019'

... ... @@ -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";
}
... ...
... ... @@ -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;
}
... ...
... ... @@ -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;
}
}
... ...
... ... @@ -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",
... ...
... ... @@ -33,15 +33,15 @@
<h5>Java服务监控曲线</h5>
</div>
<div class="widget-content nopadding">
<div class="widget-title" style="height: 300px;">
<div class="widget-title" style="height: 400px;">
<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: 720px">
<div id="timesCharts" class="input-group" style="height: 380px;width: 760px;margin-left: 100px">
</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: "可用内存/总内存(MB)",
field: "memoryRate",
width: "10%"
},{
title: "带宽(IN/OUT)(kbps)",
title: "带宽(IN/OUT)(KBps)",
field: "bandwidth",
width: "10%"
... ... @@ -528,7 +528,7 @@
field: "cpuRate",
width: "10%"
},{
title: "可用内存/总内存(M)",
title: "可用内存/总内存(MB)",
field: "memoryRate",
// formatter: function (value, rowData, rowIndex) {
// if (rowData.apiToggle == 0)
... ... @@ -539,7 +539,7 @@
width: "10%"
},{
title: "带宽(IN/OUT)(kbps)",
title: "带宽(IN/OUT)(KBps)",
field: "bandwidth",
width: "15%"
... ... @@ -649,7 +649,7 @@
field: "cpuRate",
width: "10%"
},{
title: "可用内存/总内存(M)",
title: "可用内存/总内存(MB)",
field: "memoryRate",
// formatter: function (value, rowData, rowIndex) {
// if (rowData.apiToggle == 0)
... ... @@ -660,7 +660,7 @@
width: "10%"
},{
title: "带宽(IN/OUT)(kbps)",
title: "带宽(IN/OUT)(KBps)",
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");
... ...