Merge branch 'dev1019'
Showing
5 changed files
with
90 additions
and
46 deletions
@@ -161,5 +161,6 @@ public class HttpUriContants { | @@ -161,5 +161,6 @@ public class HttpUriContants { | ||
161 | public static final String JAVA_MONITOR_GET = "/newJavaApiInfo/queryByServiceType"; | 161 | public static final String JAVA_MONITOR_GET = "/newJavaApiInfo/queryByServiceType"; |
162 | public static final String JAVA_GRAPH_GET = "/newJavaApiInfo/getJavaApiGraph"; | 162 | public static final String JAVA_GRAPH_GET = "/newJavaApiInfo/getJavaApiGraph"; |
163 | public static final String JAVA_IP_LIST = "/newJavaApiInfo/getIPList"; | 163 | public static final String JAVA_IP_LIST = "/newJavaApiInfo/getIPList"; |
164 | + public static final String JAVA_API_LIST = "/newJavaApiInfo/queryByServiceTypeAndIP"; | ||
164 | 165 | ||
165 | } | 166 | } |
@@ -21,4 +21,10 @@ public class JavaApiMonitorReq extends PageRequest { | @@ -21,4 +21,10 @@ public class JavaApiMonitorReq extends PageRequest { | ||
21 | //云类型 1-aws,2-qcloud | 21 | //云类型 1-aws,2-qcloud |
22 | private int cloudType; | 22 | private int cloudType; |
23 | 23 | ||
24 | + private String startTime; | ||
25 | + | ||
26 | + private String endTime; | ||
27 | + | ||
28 | + private String ip; | ||
29 | + | ||
24 | } | 30 | } |
@@ -74,4 +74,11 @@ public class JavaMonitorCtrl { | @@ -74,4 +74,11 @@ public class JavaMonitorCtrl { | ||
74 | return rep; | 74 | return rep; |
75 | } | 75 | } |
76 | 76 | ||
77 | + @RequestMapping("/queryByServiceTypeAndIP") | ||
78 | + @ResponseBody | ||
79 | + public BaseResponse queryByServiceTypeAndIP(JavaApiMonitorReq req) { | ||
80 | + BaseResponse rep = httpClient.defaultPost(HttpUriContants.JAVA_API_LIST, req, BaseResponse.class); | ||
81 | + return rep; | ||
82 | + } | ||
83 | + | ||
77 | } | 84 | } |
@@ -59,7 +59,7 @@ | @@ -59,7 +59,7 @@ | ||
59 | </div> | 59 | </div> |
60 | <div class="input-group" style="margin-left: 15px"> | 60 | <div class="input-group" style="margin-left: 15px"> |
61 | <span class="input-group-addon">IP:</span> | 61 | <span class="input-group-addon">IP:</span> |
62 | - <select id="iPName" name="iPName" class="form-control" style="width: 200px"> | 62 | + <select id="iPName" name="iPName" class="form-control" style="width: 200px" onchange="getIpOnchange()"> |
63 | </select> | 63 | </select> |
64 | </div> | 64 | </div> |
65 | </div> | 65 | </div> |
@@ -116,6 +116,18 @@ | @@ -116,6 +116,18 @@ | ||
116 | getJavaAppType(cloudType); | 116 | getJavaAppType(cloudType); |
117 | } | 117 | } |
118 | 118 | ||
119 | + //ip类型选择事件 | ||
120 | + function getIpOnchange() { | ||
121 | + $("#infoTable").table("load", { | ||
122 | + startTime : startTime, | ||
123 | + endTime : endTime, | ||
124 | + serviceType : serviceType, | ||
125 | + serviceName : serviceName, | ||
126 | + ip:$("#iPName").val(), | ||
127 | + cloudType : $("#cloudType").val() | ||
128 | + }); | ||
129 | + } | ||
130 | + | ||
119 | var getJavaAppType = function (cloudType) { | 131 | var getJavaAppType = function (cloudType) { |
120 | $.ajax({ | 132 | $.ajax({ |
121 | url: contextPath + "/javaMonitor/queryIpList", | 133 | url: contextPath + "/javaMonitor/queryIpList", |
@@ -142,7 +154,13 @@ | @@ -142,7 +154,13 @@ | ||
142 | 154 | ||
143 | $("#infoTable").table({ | 155 | $("#infoTable").table({ |
144 | columnAutoWidth: false, | 156 | columnAutoWidth: false, |
145 | - url: contextPath + "/javaMonitor/query", | 157 | + url: contextPath + "/javaMonitor/queryByServiceTypeAndIP", |
158 | + queryParams : { | ||
159 | + startTime : startTime, | ||
160 | + endTime : endTime, | ||
161 | + serviceType : serviceType, | ||
162 | + serviceName : serviceName | ||
163 | + }, | ||
146 | striped: true, | 164 | striped: true, |
147 | title: "java服务监控信息列表", | 165 | title: "java服务监控信息列表", |
148 | dataType: "json", | 166 | dataType: "json", |
@@ -153,6 +171,17 @@ | @@ -153,6 +171,17 @@ | ||
153 | }, | 171 | }, |
154 | onLoadSuccess: function (data) { | 172 | onLoadSuccess: function (data) { |
155 | if(data != null){ | 173 | if(data != null){ |
174 | + //同步加载根据平均耗时排序的tab页列表 | ||
175 | + var costObj = new Array(); | ||
176 | + for(var j = 0;j<data.length;j++){ | ||
177 | + costObj.push(data[j]); | ||
178 | + } | ||
179 | + //按平均耗时从大到小排序ss | ||
180 | + costObj.sort(function(a,b){ | ||
181 | + return b.avgCost-a.avgCost; | ||
182 | + }); | ||
183 | + | ||
184 | + | ||
156 | //同步加载根据异常次数排序的tab页列表 | 185 | //同步加载根据异常次数排序的tab页列表 |
157 | var errorObj = new Array(); | 186 | var errorObj = new Array(); |
158 | for (var i = 0; i < data.length; i++) { | 187 | for (var i = 0; i < data.length; i++) { |
@@ -163,36 +192,38 @@ | @@ -163,36 +192,38 @@ | ||
163 | return b.errorCount - a.errorCount; | 192 | return b.errorCount - a.errorCount; |
164 | }); | 193 | }); |
165 | $("#infoTable1").table("loadLoaclData", errorObj); | 194 | $("#infoTable1").table("loadLoaclData", errorObj); |
195 | + | ||
196 | + return costObj; | ||
166 | } | 197 | } |
167 | }, | 198 | }, |
168 | columns: [{ | 199 | columns: [{ |
169 | title: "接口名", | 200 | title: "接口名", |
170 | - field: "ip", | 201 | + field: "apiName", |
171 | width: "10%", | 202 | width: "10%", |
172 | - sortable: true, | ||
173 | - formatter: function (value, rowData, rowIndex) { | ||
174 | - var div = $("<div>"); | ||
175 | - var editBtn = $("<button>").addClass("btn btn-xs btn-success").html(rowData.ip).appendTo(div); | ||
176 | - editBtn.click(function () { | ||
177 | - var dialog = $("<div>").appendTo($("body")); | ||
178 | - dialog.dialog({ | ||
179 | - backdrop: "static", | ||
180 | - title: "API详情", | ||
181 | - href: contextPath + "jsp/javaMonitor/javaIpInfoList.jsp", | ||
182 | - height: "80%", | ||
183 | - width: "60%", | ||
184 | - buttons: [{ | ||
185 | - text: "关闭", | ||
186 | - className: "btn-info", | ||
187 | - onclick: function () { | ||
188 | - $(dialog).dialog("hide"); | ||
189 | - } | ||
190 | - }] | ||
191 | - }); | ||
192 | - | ||
193 | - }); | ||
194 | - return div; | ||
195 | - } | 203 | + sortable: true |
204 | +// formatter: function (value, rowData, rowIndex) { | ||
205 | +// var div = $("<div>"); | ||
206 | +// var editBtn = $("<button>").addClass("btn btn-xs btn-success").html(rowData.ip).appendTo(div); | ||
207 | +// editBtn.click(function () { | ||
208 | +// var dialog = $("<div>").appendTo($("body")); | ||
209 | +// dialog.dialog({ | ||
210 | +// backdrop: "static", | ||
211 | +// title: "API详情", | ||
212 | +// href: contextPath + "jsp/javaMonitor/javaIpInfoList.jsp", | ||
213 | +// height: "80%", | ||
214 | +// width: "60%", | ||
215 | +// buttons: [{ | ||
216 | +// text: "关闭", | ||
217 | +// className: "btn-info", | ||
218 | +// onclick: function () { | ||
219 | +// $(dialog).dialog("hide"); | ||
220 | +// } | ||
221 | +// }] | ||
222 | +// }); | ||
223 | +// | ||
224 | +// }); | ||
225 | +// return div; | ||
226 | +// } | ||
196 | }, { | 227 | }, { |
197 | title: "总请求次数", | 228 | title: "总请求次数", |
198 | field: "totalCount", | 229 | field: "totalCount", |
@@ -282,14 +313,15 @@ | @@ -282,14 +313,15 @@ | ||
282 | sortable: true, //是否启用排序 | 313 | sortable: true, //是否启用排序 |
283 | sortOrder: "desc", | 314 | sortOrder: "desc", |
284 | columns: [{ | 315 | columns: [{ |
285 | - title: "IP", | ||
286 | - field: "ip", | 316 | + title: "接口名", |
317 | + field: "apiName", | ||
287 | width: "10%", | 318 | width: "10%", |
288 | sortable: true | 319 | sortable: true |
289 | }, { | 320 | }, { |
290 | - title: "网络归属", | ||
291 | - field: "type", | ||
292 | - width: "10%" | 321 | + title: "总请求次数", |
322 | + field: "totalCount", | ||
323 | + width: "10%", | ||
324 | + sortable: true | ||
293 | }, { | 325 | }, { |
294 | title: "请求异常次数", | 326 | title: "请求异常次数", |
295 | field: "errorCount", | 327 | field: "errorCount", |
@@ -33,15 +33,15 @@ | @@ -33,15 +33,15 @@ | ||
33 | <h5>Java服务监控曲线</h5> | 33 | <h5>Java服务监控曲线</h5> |
34 | </div> | 34 | </div> |
35 | <div class="widget-content nopadding"> | 35 | <div class="widget-content nopadding"> |
36 | - <div class="widget-title" style="height: 300px;"> | 36 | + <div class="widget-title" style="height: 400px;"> |
37 | <div class="col-sm-5 control-label" role="form" id="chartterDiv" | 37 | <div class="col-sm-5 control-label" role="form" id="chartterDiv" |
38 | - style=" margin-top: 12px;margin-left: 10px;float: left;"> | ||
39 | - <div id="costCharts" class="input-group" style="float: left;height: 280px;width: 720px"> | 38 | + style=" margin-top: 12px;margin-left: 10px;"> |
39 | + <div id="costCharts" class="input-group" style="height: 380px;width: 760px"> | ||
40 | </div> | 40 | </div> |
41 | </div> | 41 | </div> |
42 | <div class="col-sm-5 control-label" role="form" id="chartterDiv1" | 42 | <div class="col-sm-5 control-label" role="form" id="chartterDiv1" |
43 | style=" margin-top: 12px;margin-left: 25px;float: left;"> | 43 | style=" margin-top: 12px;margin-left: 25px;float: left;"> |
44 | - <div id="timesCharts" class="input-group" style="float: left;height: 280px;width: 720px"> | 44 | + <div id="timesCharts" class="input-group" style="height: 380px;width: 760px;margin-left: 100px"> |
45 | </div> | 45 | </div> |
46 | </div> | 46 | </div> |
47 | </div> | 47 | </div> |
@@ -285,8 +285,8 @@ | @@ -285,8 +285,8 @@ | ||
285 | sortOrder:"desc", | 285 | sortOrder:"desc", |
286 | loadFilter: function (data) { | 286 | loadFilter: function (data) { |
287 | //记录下开始时间和结束时间 | 287 | //记录下开始时间和结束时间 |
288 | - paramObj.startTime = data.startTime; | ||
289 | - paramObj.endTime = data.endTime; | 288 | + paramObj.startTime = data.data.startTime; |
289 | + paramObj.endTime = data.data.endTime; | ||
290 | return defaultLoadFilter(data).content; | 290 | return defaultLoadFilter(data).content; |
291 | }, | 291 | }, |
292 | onLoadSuccess: function (data) { | 292 | onLoadSuccess: function (data) { |
@@ -410,12 +410,12 @@ | @@ -410,12 +410,12 @@ | ||
410 | field: "cpuRate", | 410 | field: "cpuRate", |
411 | width: "10%" | 411 | width: "10%" |
412 | },{ | 412 | },{ |
413 | - title: "可用内存/总内存(M)", | 413 | + title: "可用内存/总内存(MB)", |
414 | field: "memoryRate", | 414 | field: "memoryRate", |
415 | width: "10%" | 415 | width: "10%" |
416 | 416 | ||
417 | },{ | 417 | },{ |
418 | - title: "带宽(IN/OUT)(kbps)", | 418 | + title: "带宽(IN/OUT)(KBps)", |
419 | field: "bandwidth", | 419 | field: "bandwidth", |
420 | width: "10%" | 420 | width: "10%" |
421 | 421 | ||
@@ -528,7 +528,7 @@ | @@ -528,7 +528,7 @@ | ||
528 | field: "cpuRate", | 528 | field: "cpuRate", |
529 | width: "10%" | 529 | width: "10%" |
530 | },{ | 530 | },{ |
531 | - title: "可用内存/总内存(M)", | 531 | + title: "可用内存/总内存(MB)", |
532 | field: "memoryRate", | 532 | field: "memoryRate", |
533 | // formatter: function (value, rowData, rowIndex) { | 533 | // formatter: function (value, rowData, rowIndex) { |
534 | // if (rowData.apiToggle == 0) | 534 | // if (rowData.apiToggle == 0) |
@@ -539,7 +539,7 @@ | @@ -539,7 +539,7 @@ | ||
539 | width: "10%" | 539 | width: "10%" |
540 | 540 | ||
541 | },{ | 541 | },{ |
542 | - title: "带宽(IN/OUT)(kbps)", | 542 | + title: "带宽(IN/OUT)(KBps)", |
543 | field: "bandwidth", | 543 | field: "bandwidth", |
544 | width: "15%" | 544 | width: "15%" |
545 | 545 | ||
@@ -649,7 +649,7 @@ | @@ -649,7 +649,7 @@ | ||
649 | field: "cpuRate", | 649 | field: "cpuRate", |
650 | width: "10%" | 650 | width: "10%" |
651 | },{ | 651 | },{ |
652 | - title: "可用内存/总内存(M)", | 652 | + title: "可用内存/总内存(MB)", |
653 | field: "memoryRate", | 653 | field: "memoryRate", |
654 | // formatter: function (value, rowData, rowIndex) { | 654 | // formatter: function (value, rowData, rowIndex) { |
655 | // if (rowData.apiToggle == 0) | 655 | // if (rowData.apiToggle == 0) |
@@ -660,7 +660,7 @@ | @@ -660,7 +660,7 @@ | ||
660 | width: "10%" | 660 | width: "10%" |
661 | 661 | ||
662 | },{ | 662 | },{ |
663 | - title: "带宽(IN/OUT)(kbps)", | 663 | + title: "带宽(IN/OUT)(KBps)", |
664 | field: "bandwidth", | 664 | field: "bandwidth", |
665 | width: "15%" | 665 | width: "15%" |
666 | 666 | ||
@@ -677,8 +677,6 @@ | @@ -677,8 +677,6 @@ | ||
677 | 677 | ||
678 | //新增 | 678 | //新增 |
679 | $("#searchJavaInfoBtn").click(function() { | 679 | $("#searchJavaInfoBtn").click(function() { |
680 | -// paramObj.markingPustId = 0; | ||
681 | -// paramObj.markingPushFlag = '1'; | ||
682 | var url = contextPath + "/javaMonitor/toJavaApiInfoList"; | 680 | var url = contextPath + "/javaMonitor/toJavaApiInfoList"; |
683 | var serviceType = $("#searchApiName").val(); | 681 | var serviceType = $("#searchApiName").val(); |
684 | var serviceName = $("#searchApiName").select("getText"); | 682 | var serviceName = $("#searchApiName").select("getText"); |
-
Please register or login to post a comment