fix:首页流量带宽问题修正(取最近15分钟范围有数据),增加端口流量统计条件(可按协议tcp或udp)
This commit is contained in:
2
db/201901-update.sql
Normal file
2
db/201901-update.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
--活跃端口统计增加传输层协议属性
|
||||||
|
alter table traffic_port_active_statistic add trans_proto int(11) default 0 comment '6-tcp 17 -udp';
|
||||||
@@ -34,10 +34,10 @@
|
|||||||
<select id="getNetFlowPortInfoNew" resultType="java.util.HashMap">
|
<select id="getNetFlowPortInfoNew" resultType="java.util.HashMap">
|
||||||
SELECT SUM(total_traffic.inoctets) AS inoctets ,SUM(total_traffic.outoctets) AS outoctets FROM (
|
SELECT SUM(total_traffic.inoctets) AS inoctets ,SUM(total_traffic.outoctets) AS outoctets FROM (
|
||||||
SELECT IFNULL(SUM(c2s_byte_len),0) inoctets ,IFNULL(SUM(s2c_byte_len),0) outoctets FROM traffic_trans_statistic
|
SELECT IFNULL(SUM(c2s_byte_len),0) inoctets ,IFNULL(SUM(s2c_byte_len),0) outoctets FROM traffic_trans_statistic
|
||||||
where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=1 ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=1
|
where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=1 and stat_time > DATE_SUB(now(), INTERVAL 15 MINUTE) ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=1
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT IFNULL(SUM(c2s_byte_len),0) inoctets ,IFNULL(SUM(s2c_byte_len),0) outoctets FROM traffic_trans_statistic
|
SELECT IFNULL(SUM(c2s_byte_len),0) inoctets ,IFNULL(SUM(s2c_byte_len),0) outoctets FROM traffic_trans_statistic
|
||||||
where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=2 ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=2
|
where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=2 and stat_time > DATE_SUB(now(), INTERVAL 15 MINUTE) ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=2
|
||||||
) total_traffic
|
) total_traffic
|
||||||
</select>
|
</select>
|
||||||
<!-- 获取近五分钟的带宽根据ip46,协议 tcp,udp变化 -->
|
<!-- 获取近五分钟的带宽根据ip46,协议 tcp,udp变化 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user