修改流量统计日志级别为debug,新增更新协议类型码表sql,流量统计超时时间设置为1分钟
This commit is contained in:
@@ -71,7 +71,7 @@ public class DashboardController extends BaseController{
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
list = (ArrayList) fromJsonList.get("data");
|
||||
logger.info("活跃端口数据"+fromJsonList);
|
||||
logger.debug("活跃端口数据"+fromJsonList);
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -92,7 +92,7 @@ public class DashboardController extends BaseController{
|
||||
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.info("活跃IP数据"+fromJsonList);
|
||||
logger.debug("活跃IP数据"+fromJsonList);
|
||||
list = (ArrayList) fromJsonList.get("data");
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
@@ -114,7 +114,7 @@ public class DashboardController extends BaseController{
|
||||
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_FIVEMINUTE);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.info("活跃IP1小时,间隔5分钟数据"+fromJsonList);
|
||||
logger.debug("活跃IP1小时,间隔5分钟数据"+fromJsonList);
|
||||
list = (ArrayList) fromJsonList.get("data");
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
@@ -163,7 +163,7 @@ public class DashboardController extends BaseController{
|
||||
|
||||
Gson gson = getIntGson();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());
|
||||
logger.info("活跃IP1小时"+fromJsonList);
|
||||
logger.debug("活跃IP1小时"+fromJsonList);
|
||||
ipActiveList = gson.fromJson(fromJsonList.get("data").toString(), new TypeToken<List<TrafficIpActiveStatistic>>() {}.getType()) ;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -246,7 +246,7 @@ public class DashboardController extends BaseController{
|
||||
}
|
||||
resultList.add(map);
|
||||
}
|
||||
logger.info("协议统计"+fromJsonList);
|
||||
logger.debug("协议统计"+fromJsonList);
|
||||
return resultList;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -285,7 +285,7 @@ public class DashboardController extends BaseController{
|
||||
}
|
||||
resultList.add(map);
|
||||
}
|
||||
logger.info("app流量分析"+fromJsonList);
|
||||
logger.debug("app流量分析"+fromJsonList);
|
||||
return resultList;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -324,7 +324,7 @@ public class DashboardController extends BaseController{
|
||||
}
|
||||
resultList.add(map);
|
||||
}
|
||||
logger.info("终端用户-获取操作系统列表"+fromJsonList);
|
||||
logger.debug("终端用户-获取操作系统列表"+fromJsonList);
|
||||
return resultList;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -382,7 +382,7 @@ public class DashboardController extends BaseController{
|
||||
resultList.add(map);
|
||||
}
|
||||
}
|
||||
logger.info("终端用户-获取操作系统下浏览器类型"+fromJsonList);
|
||||
logger.debug("终端用户-获取操作系统下浏览器类型"+fromJsonList);
|
||||
return resultList;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -421,7 +421,7 @@ public class DashboardController extends BaseController{
|
||||
resultList.add(map);
|
||||
}
|
||||
}
|
||||
logger.info("终端用户-获取浏览器列表"+fromJsonList);
|
||||
logger.debug("终端用户-获取浏览器列表"+fromJsonList);
|
||||
return resultList;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -478,7 +478,7 @@ public class DashboardController extends BaseController{
|
||||
resultList.add(map);
|
||||
}
|
||||
}
|
||||
logger.info("终端用户-获取浏览器下操作系统类型"+fromJsonList);
|
||||
logger.debug("终端用户-获取浏览器下操作系统类型"+fromJsonList);
|
||||
return resultList;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -523,7 +523,7 @@ public class DashboardController extends BaseController{
|
||||
resultList.add(map);
|
||||
}
|
||||
}
|
||||
logger.info("http网站流量分析数据:"+fromJsonList);
|
||||
logger.debug("http网站流量分析数据:"+fromJsonList);
|
||||
return resultList;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -573,7 +573,7 @@ public class DashboardController extends BaseController{
|
||||
}
|
||||
}
|
||||
|
||||
logger.info("http某个网站子域名流量统计"+fromJsonList);
|
||||
logger.debug("http某个网站子域名流量统计"+fromJsonList);
|
||||
return resultList;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -640,7 +640,7 @@ public class DashboardController extends BaseController{
|
||||
resultList.add(map);
|
||||
}
|
||||
}
|
||||
logger.info("http网站主题流量分析数据:"+fromJsonList);
|
||||
logger.debug("http网站主题流量分析数据:"+fromJsonList);
|
||||
return resultList;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -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