新增流量统计带宽详情页面,IPv4,6,Tcp,udp为条件统计
This commit is contained in:
@@ -9,15 +9,15 @@ public class TrafficIpActiveStatistic{
|
||||
@ExcelField(title="Area",sort=20)
|
||||
String areaId;
|
||||
@ExcelField(title="Number",sort=30)
|
||||
Integer linkNum;
|
||||
Long linkNum;
|
||||
@ExcelField(title="C2S(Pkt)",sort=40)
|
||||
Integer c2sPktNum;
|
||||
Long c2sPktNum;
|
||||
@ExcelField(title="S2C(Pkt)",sort=50)
|
||||
Integer s2cPktNum;
|
||||
Long s2cPktNum;
|
||||
@ExcelField(title="C2S(Byte)",sort=60)
|
||||
Integer c2sByteLen;
|
||||
Long c2sByteLen;
|
||||
@ExcelField(title="S2C(Byte)",sort=70)
|
||||
Integer s2cByteLen;
|
||||
Long s2cByteLen;
|
||||
@ExcelField(title="Time",sort=80)
|
||||
String statTime;
|
||||
|
||||
@@ -48,34 +48,34 @@ public class TrafficIpActiveStatistic{
|
||||
public void setAreaId(String areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
public Integer getLinkNum() {
|
||||
public Long getLinkNum() {
|
||||
return linkNum;
|
||||
}
|
||||
public void setLinkNum(Integer linkNum) {
|
||||
public void setLinkNum(Long linkNum) {
|
||||
this.linkNum = linkNum;
|
||||
}
|
||||
public Integer getC2sPktNum() {
|
||||
public Long getC2sPktNum() {
|
||||
return c2sPktNum;
|
||||
}
|
||||
public void setC2sPktNum(Integer c2sPktNum) {
|
||||
public void setC2sPktNum(Long c2sPktNum) {
|
||||
this.c2sPktNum = c2sPktNum;
|
||||
}
|
||||
public Integer getS2cPktNum() {
|
||||
public Long getS2cPktNum() {
|
||||
return s2cPktNum;
|
||||
}
|
||||
public void setS2cPktNum(Integer s2cPktNum) {
|
||||
public void setS2cPktNum(Long s2cPktNum) {
|
||||
this.s2cPktNum = s2cPktNum;
|
||||
}
|
||||
public Integer getC2sByteLen() {
|
||||
public Long getC2sByteLen() {
|
||||
return c2sByteLen;
|
||||
}
|
||||
public void setC2sByteLen(Integer c2sByteLen) {
|
||||
public void setC2sByteLen(Long c2sByteLen) {
|
||||
this.c2sByteLen = c2sByteLen;
|
||||
}
|
||||
public Integer getS2cByteLen() {
|
||||
public Long getS2cByteLen() {
|
||||
return s2cByteLen;
|
||||
}
|
||||
public void setS2cByteLen(Integer s2cByteLen) {
|
||||
public void setS2cByteLen(Long s2cByteLen) {
|
||||
this.s2cByteLen = s2cByteLen;
|
||||
}
|
||||
|
||||
|
||||
@@ -697,6 +697,7 @@ public final class Constants {
|
||||
public static final String TRAFFIC_IPACTIVE_FIVEMINUTE=Configurations.getStringProperty("trafficIpActiveFiveMinute","trafficIpActiveFiveMinute");
|
||||
public static final String TRAFFIC_IPACTIVE_ONEHOUR=Configurations.getStringProperty("trafficIpActiveOneHour","trafficIpActiveOneHour");
|
||||
public static final String NTC_RADIUS_REPORT=Configurations.getStringProperty("ntcRadiusReport","ntcRadiusReport");
|
||||
public static final String TRAFFIC_BANDWIDTH_TRANS=Configurations.getStringProperty("trafficBandwidthTrans","trafficBandwidthTrans");
|
||||
|
||||
/**
|
||||
* httpclient 工具超时时间设置
|
||||
|
||||
@@ -171,7 +171,6 @@ public class DashboardController extends BaseController{
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}
|
||||
|
||||
|
||||
model.addAttribute("ipActiveList", ipActiveList);
|
||||
return "/dashboard/trafficIpActiveList";
|
||||
}
|
||||
@@ -661,29 +660,13 @@ public class DashboardController extends BaseController{
|
||||
ip.setId(i);
|
||||
ip.setIpAddr(3+i+".1.1."+i);
|
||||
ip.setAreaId("11");
|
||||
ip.setLinkNum(1212);
|
||||
ip.setLinkNum(1212l);
|
||||
list.add(ip);
|
||||
}
|
||||
page.setList(list);
|
||||
model.addAttribute("page", page);
|
||||
return "/dashboard/trafficWebTypeList";
|
||||
}
|
||||
@RequestMapping(value="bandwidthList")
|
||||
public String bandwidthList( HttpServletRequest request, HttpServletResponse response, Model model){
|
||||
PageLog<TrafficIpActiveStatistic> page = new PageLog<TrafficIpActiveStatistic>(request, response);
|
||||
List list = new ArrayList();
|
||||
for (int i = 1; i < 10; i++) {
|
||||
TrafficIpActiveStatistic ip = new TrafficIpActiveStatistic();
|
||||
ip.setId(i);
|
||||
ip.setIpAddr(3+i+".1.1."+i);
|
||||
ip.setAreaId("11");
|
||||
ip.setLinkNum(1212);
|
||||
list.add(ip);
|
||||
}
|
||||
page.setList(list);
|
||||
model.addAttribute("page", page);
|
||||
return "/dashboard/trafficBandwidthList";
|
||||
}
|
||||
|
||||
////////////////////////////////////////test
|
||||
@RequestMapping(value="showChart")
|
||||
|
||||
@@ -6,15 +6,23 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.beust.jcommander.internal.Maps;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
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.StringUtil;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -97,5 +105,52 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
}
|
||||
return m;
|
||||
}
|
||||
/**
|
||||
* 根据ip46,协议tcp,udp查询带宽 间隔5分钟数据
|
||||
*/
|
||||
@RequestMapping(value="bandwidthTrans")
|
||||
@ResponseBody
|
||||
public Map ipActiveMinuteList(@RequestParam("addrType")String addrType,@RequestParam("transType")Integer transType){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
Map map = new HashMap();
|
||||
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS;
|
||||
if(!StringUtil.isBlank(addrType)){
|
||||
url=url+"?addrType="+addrType;
|
||||
}
|
||||
if(transType!=null){
|
||||
url=url+"?transType="+transType;
|
||||
}
|
||||
try {
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.info("带宽1小时,间隔5分钟数据"+fromJsonList);
|
||||
List list = (ArrayList) fromJsonList.get("data");
|
||||
if(!StringUtil.isEmpty(list)){
|
||||
map=(Map) list.get(0);
|
||||
}
|
||||
return map;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("带宽详情数据获取错误"+e);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping(value="bandwidthList")
|
||||
public String bandwidthList( HttpServletRequest request, HttpServletResponse response, Model model){
|
||||
PageLog<TrafficIpActiveStatistic> page = new PageLog<TrafficIpActiveStatistic>(request, response);
|
||||
List list = new ArrayList();
|
||||
for (int i = 1; i < 10; i++) {
|
||||
TrafficIpActiveStatistic ip = new TrafficIpActiveStatistic();
|
||||
ip.setId(i);
|
||||
ip.setIpAddr(3+i+".1.1."+i);
|
||||
ip.setAreaId("11");
|
||||
ip.setLinkNum(1212l);
|
||||
list.add(ip);
|
||||
}
|
||||
page.setList(list);
|
||||
model.addAttribute("page", page);
|
||||
return "/dashboard/trafficBandwidthList";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user