修改流量统计参数

This commit is contained in:
zhanghongqing
2018-11-16 11:08:50 +08:00
parent 1394e0a39f
commit 0412708c99
3 changed files with 5 additions and 5 deletions

View File

@@ -13,6 +13,6 @@ public interface NtcTotalReportDao {
NtcTotalReport getMaxReportTime();
Map getMaxRecvTime();
List<Map> getTotalReportList(@Param("reportTime") Date reportTime);
List<Map> getNetFlowPortInfoNew(@Param("statTime") Date recvTime);
List<Map> getNetFlowPortInfoNew(@Param("statTime") Date statTime);
// List<Map> getNetFlowPortInfoOld(@Param("recvTime") Date recvTime);
}

View File

@@ -22,7 +22,7 @@
</select>
<!-- 获取带宽最近时间并且有效 -->
<select id="getMaxRecvTime" resultType="java.util.HashMap">
SELECT MAX(stat_time) recvTime FROM traffic_trans_statistic
SELECT MAX(stat_time) statTime FROM traffic_trans_statistic
</select>
<select id="getTotalReportList" resultType="java.util.HashMap">
SELECT SUM(reject_num) rejectNum,SUM(monitor_num) monitorNum,SUM(c2s_pkt_num) c2sPktNum,SUM(s2c_pkt_num) s2cPktNum,SUM(c2s_byte_len) c2sByteLen,SUM(s2c_byte_len) s2cByteLen,SUM(new_uni_conn_num) newUniConnNum,SUM(live_conn_num) liveConnNum,
@@ -35,7 +35,7 @@
</select>
<!-- 获取上个时间段的数据 -->
<!-- <select id="getNetFlowPortInfoOld" resultType="java.util.HashMap">
SELECT IFNULL(SUM(INOCTETS),0) inoctets ,IFNULL(SUM(OUTOCTETS),0) outoctets FROM galaxy.TRAFFIC_NETFLOW_PORT_INFO
SELECT IFNULL(SUM(INOCTETS),0) inoctets ,IFNULL(SUM(OUTOCTETS),0) outoctets FROM TRAFFIC_NETFLOW_PORT_INFO
where RECV_TIME = DATE_SUB(#{recvTime},INTERVAL 5 MINUTE)
</select>-->
</mapper>

View File

@@ -59,8 +59,8 @@ public class DashboardService extends BaseService{
Map maxRecvtTime = ntcTotalReportDao.getMaxRecvTime();
List<Map> newData = new ArrayList<Map>();
// List<Map> oldData = new ArrayList<Map>();
if(maxRecvtTime!=null&&maxRecvtTime.get("recvTime")!=null) {
Date recvTime = (Date) maxRecvtTime.get("recvTime");
if(maxRecvtTime!=null&&maxRecvtTime.get("statTime")!=null) {
Date recvTime = (Date) maxRecvtTime.get("statTime");
newData = ntcTotalReportDao.getNetFlowPortInfoNew(recvTime);
// oldData = ntcTotalReportDao.getNetFlowPortInfoOld(recvTime);
}