修改流量统计日志级别为debug,新增更新协议类型码表sql,流量统计超时时间设置为1分钟
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package com.nis.web.controller.dashboard;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -31,6 +35,7 @@ import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.PageLog;
|
||||
import com.nis.domain.dashboard.TrafficIpActiveStatistic;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -93,7 +98,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
m.put("inoctetsNum", inoctetsNum);
|
||||
m.put("outoctetsNum", outoctetsNum);
|
||||
|
||||
logger.info("统计流量信息数据"+fromJsonList);
|
||||
logger.debug("统计流量信息数据"+fromJsonList);
|
||||
return m;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -103,7 +108,14 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
}
|
||||
|
||||
@RequestMapping(value="bandwidthList")
|
||||
public String bandwidthList( HttpServletRequest request, HttpServletResponse response, Model model){
|
||||
public String bandwidthList(Model model){
|
||||
Calendar cal = Calendar. getInstance ();
|
||||
cal.setTime(new Date());
|
||||
String now = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format(cal.getTime());//获取到完整的时间
|
||||
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||
String oneHoursAgo = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format(cal.getTime());
|
||||
model.addAttribute("beginDate", oneHoursAgo);
|
||||
model.addAttribute("endDate", now);
|
||||
return "/dashboard/trafficBandwidthList";
|
||||
}
|
||||
/**
|
||||
@@ -128,7 +140,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.info(searchAction+"动作间隔5分钟数据"+fromJsonList);
|
||||
logger.debug(searchAction+"动作间隔5分钟数据"+fromJsonList);
|
||||
resultList = (ArrayList) fromJsonList.get("data");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -156,7 +168,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.info("带宽1小时,间隔5分钟数据"+fromJsonList);
|
||||
logger.debug("带宽1小时,间隔5分钟数据"+fromJsonList);
|
||||
List list = (ArrayList) fromJsonList.get("data");
|
||||
if(!StringUtil.isEmpty(list)){
|
||||
map=(Map) list.get(0);
|
||||
@@ -180,15 +192,20 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value="protocolList")
|
||||
@ResponseBody
|
||||
public List protocolList(){
|
||||
public List protocolList(Model model,@RequestParam(required=false)String searchFoundStartTime,@RequestParam(required=false)String searchFoundEndTime){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
List list = new ArrayList();
|
||||
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_PROTOCOL_LIST;
|
||||
try {
|
||||
if(!StringUtil.isBlank(searchFoundStartTime)&&!StringUtil.isBlank(searchFoundEndTime)){
|
||||
searchFoundStartTime=URLEncoder.encode(searchFoundStartTime, "UTF-8");
|
||||
searchFoundEndTime=URLEncoder.encode(searchFoundEndTime, "UTF-8");
|
||||
url+="?searchFoundStartTime="+searchFoundStartTime+"&searchFoundEndTime="+searchFoundEndTime;
|
||||
}
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.info("协议详情5分钟数据"+fromJsonList);
|
||||
logger.debug("协议详情5分钟数据"+fromJsonList);
|
||||
list = (ArrayList) fromJsonList.get("data");
|
||||
Long totalLink=0l;
|
||||
Long totalPackets=0l;
|
||||
@@ -229,19 +246,24 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
return "/dashboard/trafficAppTypeList";
|
||||
}
|
||||
/**
|
||||
* 协议详情统计图跟表
|
||||
* App详情统计图跟表
|
||||
*/
|
||||
@RequestMapping(value="appList")
|
||||
@ResponseBody
|
||||
public List appList(){
|
||||
public List appList(@RequestParam(value="searchFoundStartTime",required=false)String searchFoundStartTime,@RequestParam(value="searchFoundEndTime",required=false)String searchFoundEndTime){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
List list = new ArrayList();
|
||||
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_APP_LIST;
|
||||
try {
|
||||
if(!StringUtil.isBlank(searchFoundStartTime)&&!StringUtil.isBlank(searchFoundEndTime)){
|
||||
searchFoundStartTime=URLEncoder.encode(searchFoundStartTime, "UTF-8");
|
||||
searchFoundEndTime=URLEncoder.encode(searchFoundEndTime, "UTF-8");
|
||||
url+="?searchFoundStartTime="+searchFoundStartTime+"&searchFoundEndTime="+searchFoundEndTime;
|
||||
}
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.info("app详情5分钟数据"+fromJsonList);
|
||||
logger.debug("app详情5分钟数据"+fromJsonList);
|
||||
list = (ArrayList) fromJsonList.get("data");
|
||||
Long totalLink=0l;
|
||||
Long totalPackets=0l;
|
||||
|
||||
Reference in New Issue
Block a user