1、所有流量表新增字段ping丢包率。
2、开发ping丢包率图形接口。
This commit is contained in:
+2
@@ -149,5 +149,7 @@ public class EpsInitialTrafficData extends BaseEntity {
|
|||||||
private String totalIpv6OutSpeed;
|
private String totalIpv6OutSpeed;
|
||||||
/** IPv6 */
|
/** IPv6 */
|
||||||
private String ipV6;
|
private String ipV6;
|
||||||
|
/** ping丢包率 */
|
||||||
|
private Double pingDropped;
|
||||||
|
|
||||||
}
|
}
|
||||||
+14
-5
@@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
total_ipv6_in_speed VARCHAR(50) COMMENT 'IPv6接收总流量',
|
total_ipv6_in_speed VARCHAR(50) COMMENT 'IPv6接收总流量',
|
||||||
total_ipv6_out_speed VARCHAR(50) COMMENT 'IPv6发送总流量',
|
total_ipv6_out_speed VARCHAR(50) COMMENT 'IPv6发送总流量',
|
||||||
ipV6 VARCHAR(50) COMMENT 'IPv6地址',
|
ipV6 VARCHAR(50) COMMENT 'IPv6地址',
|
||||||
|
ping_dropped double COMMENT 'ping丢包率',
|
||||||
PRIMARY KEY (id),
|
PRIMARY KEY (id),
|
||||||
UNIQUE KEY uk_client_mac_name_time (client_id, mac, name, create_time),
|
UNIQUE KEY uk_client_mac_name_time (client_id, mac, name, create_time),
|
||||||
INDEX idx_name_time (`name`,create_time)
|
INDEX idx_name_time (`name`,create_time)
|
||||||
@@ -77,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
total_ipv6_in_speed VARCHAR(50) COMMENT 'IPv6接收总流量',
|
total_ipv6_in_speed VARCHAR(50) COMMENT 'IPv6接收总流量',
|
||||||
total_ipv6_out_speed VARCHAR(50) COMMENT 'IPv6发送总流量',
|
total_ipv6_out_speed VARCHAR(50) COMMENT 'IPv6发送总流量',
|
||||||
ipV6 VARCHAR(50) COMMENT 'IPv6地址',
|
ipV6 VARCHAR(50) COMMENT 'IPv6地址',
|
||||||
|
ping_dropped double COMMENT 'ping丢包率',
|
||||||
PRIMARY KEY (id),
|
PRIMARY KEY (id),
|
||||||
UNIQUE KEY uk_client_mac_name_time (client_id, mac, name, create_time),
|
UNIQUE KEY uk_client_mac_name_time (client_id, mac, name, create_time),
|
||||||
INDEX idx_name_time (`name`,create_time)
|
INDEX idx_name_time (`name`,create_time)
|
||||||
@@ -258,7 +260,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
total_ipv4_out_speed,
|
total_ipv4_out_speed,
|
||||||
total_ipv6_in_speed,
|
total_ipv6_in_speed,
|
||||||
total_ipv6_out_speed,
|
total_ipv6_out_speed,
|
||||||
ipV6
|
ipV6,
|
||||||
|
ping_dropped
|
||||||
) VALUES (
|
) VALUES (
|
||||||
#{name},
|
#{name},
|
||||||
#{mac},
|
#{mac},
|
||||||
@@ -290,7 +293,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{totalIpv4OutSpeed},
|
#{totalIpv4OutSpeed},
|
||||||
#{totalIpv6InSpeed},
|
#{totalIpv6InSpeed},
|
||||||
#{totalIpv6OutSpeed},
|
#{totalIpv6OutSpeed},
|
||||||
#{ipV6}
|
#{ipV6},
|
||||||
|
#{pingDropped}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -330,7 +334,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
total_ipv4_out_speed,
|
total_ipv4_out_speed,
|
||||||
total_ipv6_in_speed,
|
total_ipv6_in_speed,
|
||||||
total_ipv6_out_speed,
|
total_ipv6_out_speed,
|
||||||
ipV6
|
ipV6,
|
||||||
|
ping_dropped
|
||||||
) VALUES
|
) VALUES
|
||||||
<foreach collection="dataList" item="data" separator=",">
|
<foreach collection="dataList" item="data" separator=",">
|
||||||
(
|
(
|
||||||
@@ -367,7 +372,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{data.totalIpv4OutSpeed,jdbcType=VARCHAR},
|
#{data.totalIpv4OutSpeed,jdbcType=VARCHAR},
|
||||||
#{data.totalIpv6InSpeed,jdbcType=VARCHAR},
|
#{data.totalIpv6InSpeed,jdbcType=VARCHAR},
|
||||||
#{data.totalIpv6OutSpeed,jdbcType=VARCHAR},
|
#{data.totalIpv6OutSpeed,jdbcType=VARCHAR},
|
||||||
#{data.ipV6,jdbcType=VARCHAR}
|
#{data.ipV6,jdbcType=VARCHAR},
|
||||||
|
#{data.pingDropped,jdbcType=DECIMAL}
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
@@ -398,6 +404,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
a.`machine_flow` AS machineFlow,
|
a.`machine_flow` AS machineFlow,
|
||||||
a.`speed` AS speed,
|
a.`speed` AS speed,
|
||||||
a.`duplex` AS duplex,
|
a.`duplex` AS duplex,
|
||||||
|
a.`ping_dropped` AS pingDropped,
|
||||||
a.business_id AS businessId,
|
a.business_id AS businessId,
|
||||||
a.business_name AS businessName,
|
a.business_name AS businessName,
|
||||||
a.service_sn AS serviceSn,
|
a.service_sn AS serviceSn,
|
||||||
@@ -473,7 +480,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
total_ipv4_out_speed AS totalIpv4OutSpeed,
|
total_ipv4_out_speed AS totalIpv4OutSpeed,
|
||||||
total_ipv6_in_speed AS totalIpv6InSpeed,
|
total_ipv6_in_speed AS totalIpv6InSpeed,
|
||||||
total_ipv6_out_speed AS totalIpv6OutSpeed,
|
total_ipv6_out_speed AS totalIpv6OutSpeed,
|
||||||
ipV6 AS ipV6
|
ipV6 AS ipV6,
|
||||||
|
`ping_dropped` AS pingDropped
|
||||||
FROM ${tableName}
|
FROM ${tableName}
|
||||||
<where>
|
<where>
|
||||||
<if test="startTime != null">
|
<if test="startTime != null">
|
||||||
@@ -485,6 +493,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</where>
|
</where>
|
||||||
ORDER BY create_time desc
|
ORDER BY create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateMachineTraffic" parameterType="EpsInitialTrafficData">
|
<update id="updateMachineTraffic" parameterType="EpsInitialTrafficData">
|
||||||
update ${tableName} set machine_flow=#{machineFlow} where client_id=#{clientId} and create_time=#{createTime}
|
update ${tableName} set machine_flow=#{machineFlow} where client_id=#{clientId} and create_time=#{createTime}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
+9
@@ -158,4 +158,13 @@ public class InitialBandwidthTrafficController extends BaseController
|
|||||||
return success(echartsData);
|
return success(echartsData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询eth0 Ping丢包率信息并封装为多折线ECharts图表数据
|
||||||
|
*/
|
||||||
|
@PostMapping("/pingDroppedEcharts")
|
||||||
|
public AjaxResult pingDroppedEcharts(@RequestBody InitialBandwidthTraffic initialBandwidthTraffic) {
|
||||||
|
Map<String, Object> echartsData = initialBandwidthTrafficService.pingDroppedEcharts(initialBandwidthTraffic);
|
||||||
|
return success(echartsData);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -1,5 +1,6 @@
|
|||||||
package com.tongran.rocketmq.domain;
|
package com.tongran.rocketmq.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.tongran.common.core.annotation.Excel;
|
import com.tongran.common.core.annotation.Excel;
|
||||||
import com.tongran.common.core.web.domain.BaseEntity;
|
import com.tongran.common.core.web.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -15,6 +16,7 @@ import java.util.Map;
|
|||||||
* @date 2025-08-20
|
* @date 2025-08-20
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class InitialBandwidthTraffic extends BaseEntity
|
public class InitialBandwidthTraffic extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -103,6 +105,8 @@ public class InitialBandwidthTraffic extends BaseEntity
|
|||||||
private String totalIpv6InSpeed;
|
private String totalIpv6InSpeed;
|
||||||
/** IPv6发送总流量 */
|
/** IPv6发送总流量 */
|
||||||
private String totalIpv6OutSpeed;
|
private String totalIpv6OutSpeed;
|
||||||
|
/** ping丢包率 */
|
||||||
|
private Double pingDropped;
|
||||||
/** 多个clientId */
|
/** 多个clientId */
|
||||||
private Map<String, List<String>> clientInterfaces;
|
private Map<String, List<String>> clientInterfaces;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -119,4 +119,6 @@ public interface IInitialBandwidthTrafficService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<String, Object> serverDetails(InitialBandwidthTraffic initialBandwidthTraffic);
|
Map<String, Object> serverDetails(InitialBandwidthTraffic initialBandwidthTraffic);
|
||||||
|
|
||||||
|
Map<String, Object> pingDroppedEcharts(InitialBandwidthTraffic initialBandwidthTraffic);
|
||||||
}
|
}
|
||||||
|
|||||||
+13
@@ -636,6 +636,19 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
|
|||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> pingDroppedEcharts(InitialBandwidthTraffic initialBandwidthTraffic) {
|
||||||
|
// 流量信息
|
||||||
|
List<InitialBandwidthTraffic> list = getListByTableName(initialBandwidthTraffic);
|
||||||
|
Map<String, Function<InitialBandwidthTraffic, ?>> extractors = new LinkedHashMap<>();
|
||||||
|
extractors.put("pingDropped", info -> info.getPingDropped());
|
||||||
|
|
||||||
|
return EchartsDataUtils.buildEchartsDataAutoPadding(
|
||||||
|
list, InitialBandwidthTraffic::getCreateTime, extractors,
|
||||||
|
initialBandwidthTraffic.getStartTime(), initialBandwidthTraffic.getEndTime()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建支持子网卡的批量echarts图表数据
|
* 构建支持子网卡的批量echarts图表数据
|
||||||
* @param initialBandwidthTraffic
|
* @param initialBandwidthTraffic
|
||||||
|
|||||||
@@ -146,11 +146,11 @@
|
|||||||
a.create_time as createTime,
|
a.create_time as createTime,
|
||||||
a.update_time as updateTime,
|
a.update_time as updateTime,
|
||||||
b.serial,
|
b.serial,
|
||||||
b.total,
|
TRUNCATE(IFNULL(b.total,0)/(1024 * 1024 * 1024), 0) as total,
|
||||||
b.write_speed as writeSpeed,
|
TRUNCATE(IFNULL(b.write_speed,0)/1024, 0) as writeSpeed,
|
||||||
b.read_speed as readSpeed,
|
TRUNCATE(IFNULL(b.read_speed,0)/1024, 0) as readSpeed,
|
||||||
b.type,
|
b.type,
|
||||||
b.used_space as usedSpace
|
TRUNCATE(IFNULL(b.used_space,0)/(1024 * 1024 * 1024), 0) as usedSpace
|
||||||
FROM all_disk_name a
|
FROM all_disk_name a
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT client_id, name, MAX(create_time) as max_create_time
|
SELECT client_id, name, MAX(create_time) as max_create_time
|
||||||
|
|||||||
+8
-6
@@ -112,14 +112,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
create_by, update_by, client_id, create_time,
|
create_by, update_by, client_id, create_time,
|
||||||
ipv4_in_speed, ipv4_out_speed, ipv6_in_speed, ipv6_out_speed,
|
ipv4_in_speed, ipv4_out_speed, ipv6_in_speed, ipv6_out_speed,
|
||||||
total_ipv4_in_speed, total_ipv4_out_speed, total_ipv6_in_speed, total_ipv6_out_speed,
|
total_ipv4_in_speed, total_ipv4_out_speed, total_ipv6_in_speed, total_ipv6_out_speed,
|
||||||
ipV6
|
ipV6, ping_dropped
|
||||||
) VALUES (
|
) VALUES (
|
||||||
#{name}, #{mac}, #{status}, #{type}, #{ipV4}, #{inDropped}, #{outDropped},
|
#{name}, #{mac}, #{status}, #{type}, #{ipV4}, #{inDropped}, #{outDropped},
|
||||||
#{inSpeed}, #{outSpeed}, #{totalInSpeed}, #{totalOutSpeed}, #{duplex}, #{speed},
|
#{inSpeed}, #{outSpeed}, #{totalInSpeed}, #{totalOutSpeed}, #{duplex}, #{speed},
|
||||||
#{createBy}, #{updateBy}, #{clientId}, #{createTime},
|
#{createBy}, #{updateBy}, #{clientId}, #{createTime},
|
||||||
#{ipv4InSpeed}, #{ipv4OutSpeed}, #{ipv6InSpeed}, #{ipv6OutSpeed},
|
#{ipv4InSpeed}, #{ipv4OutSpeed}, #{ipv6InSpeed}, #{ipv6OutSpeed},
|
||||||
#{totalIpv4InSpeed}, #{totalIpv4OutSpeed}, #{totalIpv6InSpeed}, #{totalIpv6OutSpeed},
|
#{totalIpv4InSpeed}, #{totalIpv4OutSpeed}, #{totalIpv6InSpeed}, #{totalIpv6OutSpeed},
|
||||||
#{ipV6}
|
#{ipV6}, #{pingDropped}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
create_by, update_by, client_id, create_time,
|
create_by, update_by, client_id, create_time,
|
||||||
ipv4_in_speed, ipv4_out_speed, ipv6_in_speed, ipv6_out_speed,
|
ipv4_in_speed, ipv4_out_speed, ipv6_in_speed, ipv6_out_speed,
|
||||||
total_ipv4_in_speed, total_ipv4_out_speed, total_ipv6_in_speed, total_ipv6_out_speed,
|
total_ipv4_in_speed, total_ipv4_out_speed, total_ipv6_in_speed, total_ipv6_out_speed,
|
||||||
ipV6
|
ipV6, ping_dropped
|
||||||
) VALUES
|
) VALUES
|
||||||
<foreach collection="list" item="item" separator=",">
|
<foreach collection="list" item="item" separator=",">
|
||||||
(
|
(
|
||||||
@@ -139,7 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{item.createBy}, #{item.updateBy}, #{item.clientId}, #{item.createTime},
|
#{item.createBy}, #{item.updateBy}, #{item.clientId}, #{item.createTime},
|
||||||
#{item.ipv4InSpeed}, #{item.ipv4OutSpeed}, #{item.ipv6InSpeed}, #{item.ipv6OutSpeed},
|
#{item.ipv4InSpeed}, #{item.ipv4OutSpeed}, #{item.ipv6InSpeed}, #{item.ipv6OutSpeed},
|
||||||
#{item.totalIpv4InSpeed}, #{item.totalIpv4OutSpeed}, #{item.totalIpv6InSpeed}, #{item.totalIpv6OutSpeed},
|
#{item.totalIpv4InSpeed}, #{item.totalIpv4OutSpeed}, #{item.totalIpv6InSpeed}, #{item.totalIpv6OutSpeed},
|
||||||
#{item.ipV6}
|
#{item.ipV6}, #{item.pingDropped}
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
@@ -173,7 +173,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
total_ipv4_out_speed as totalIpv4OutSpeed,
|
total_ipv4_out_speed as totalIpv4OutSpeed,
|
||||||
total_ipv6_in_speed as totalIpv6InSpeed,
|
total_ipv6_in_speed as totalIpv6InSpeed,
|
||||||
total_ipv6_out_speed as totalIpv6OutSpeed,
|
total_ipv6_out_speed as totalIpv6OutSpeed,
|
||||||
ipV6
|
ipV6,
|
||||||
|
ping_dropped as pingDropped
|
||||||
from ${tableName}
|
from ${tableName}
|
||||||
<where>
|
<where>
|
||||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||||
@@ -212,7 +213,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
total_ipv4_out_speed as totalIpv4OutSpeed,
|
total_ipv4_out_speed as totalIpv4OutSpeed,
|
||||||
total_ipv6_in_speed as totalIpv6InSpeed,
|
total_ipv6_in_speed as totalIpv6InSpeed,
|
||||||
total_ipv6_out_speed as totalIpv6OutSpeed,
|
total_ipv6_out_speed as totalIpv6OutSpeed,
|
||||||
ipV6
|
ipV6,
|
||||||
|
ping_dropped as pingDropped
|
||||||
from ${tableName}
|
from ${tableName}
|
||||||
<where>
|
<where>
|
||||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user