1、所有流量表新增字段ping丢包率。
2、开发ping丢包率图形接口。
This commit is contained in:
+2
@@ -149,5 +149,7 @@ public class EpsInitialTrafficData extends BaseEntity {
|
||||
private String totalIpv6OutSpeed;
|
||||
/** 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_out_speed VARCHAR(50) COMMENT 'IPv6发送总流量',
|
||||
ipV6 VARCHAR(50) COMMENT 'IPv6地址',
|
||||
ping_dropped double COMMENT 'ping丢包率',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY uk_client_mac_name_time (client_id, mac, 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_out_speed VARCHAR(50) COMMENT 'IPv6发送总流量',
|
||||
ipV6 VARCHAR(50) COMMENT 'IPv6地址',
|
||||
ping_dropped double COMMENT 'ping丢包率',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY uk_client_mac_name_time (client_id, mac, 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_ipv6_in_speed,
|
||||
total_ipv6_out_speed,
|
||||
ipV6
|
||||
ipV6,
|
||||
ping_dropped
|
||||
) VALUES (
|
||||
#{name},
|
||||
#{mac},
|
||||
@@ -290,7 +293,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{totalIpv4OutSpeed},
|
||||
#{totalIpv6InSpeed},
|
||||
#{totalIpv6OutSpeed},
|
||||
#{ipV6}
|
||||
#{ipV6},
|
||||
#{pingDropped}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -330,7 +334,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
total_ipv4_out_speed,
|
||||
total_ipv6_in_speed,
|
||||
total_ipv6_out_speed,
|
||||
ipV6
|
||||
ipV6,
|
||||
ping_dropped
|
||||
) VALUES
|
||||
<foreach collection="dataList" item="data" separator=",">
|
||||
(
|
||||
@@ -367,7 +372,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{data.totalIpv4OutSpeed,jdbcType=VARCHAR},
|
||||
#{data.totalIpv6InSpeed,jdbcType=VARCHAR},
|
||||
#{data.totalIpv6OutSpeed,jdbcType=VARCHAR},
|
||||
#{data.ipV6,jdbcType=VARCHAR}
|
||||
#{data.ipV6,jdbcType=VARCHAR},
|
||||
#{data.pingDropped,jdbcType=DECIMAL}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -398,6 +404,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.`machine_flow` AS machineFlow,
|
||||
a.`speed` AS speed,
|
||||
a.`duplex` AS duplex,
|
||||
a.`ping_dropped` AS pingDropped,
|
||||
a.business_id AS businessId,
|
||||
a.business_name AS businessName,
|
||||
a.service_sn AS serviceSn,
|
||||
@@ -473,7 +480,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
total_ipv4_out_speed AS totalIpv4OutSpeed,
|
||||
total_ipv6_in_speed AS totalIpv6InSpeed,
|
||||
total_ipv6_out_speed AS totalIpv6OutSpeed,
|
||||
ipV6 AS ipV6
|
||||
ipV6 AS ipV6,
|
||||
`ping_dropped` AS pingDropped
|
||||
FROM ${tableName}
|
||||
<where>
|
||||
<if test="startTime != null">
|
||||
@@ -485,6 +493,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</where>
|
||||
ORDER BY create_time desc
|
||||
</select>
|
||||
|
||||
<update id="updateMachineTraffic" parameterType="EpsInitialTrafficData">
|
||||
update ${tableName} set machine_flow=#{machineFlow} where client_id=#{clientId} and create_time=#{createTime}
|
||||
</update>
|
||||
|
||||
+9
@@ -158,4 +158,13 @@ public class InitialBandwidthTrafficController extends BaseController
|
||||
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;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.tongran.common.core.annotation.Excel;
|
||||
import com.tongran.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
@@ -15,6 +16,7 @@ import java.util.Map;
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class InitialBandwidthTraffic extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -103,6 +105,8 @@ public class InitialBandwidthTraffic extends BaseEntity
|
||||
private String totalIpv6InSpeed;
|
||||
/** IPv6发送总流量 */
|
||||
private String totalIpv6OutSpeed;
|
||||
/** ping丢包率 */
|
||||
private Double pingDropped;
|
||||
/** 多个clientId */
|
||||
private Map<String, List<String>> clientInterfaces;
|
||||
}
|
||||
|
||||
+2
@@ -119,4 +119,6 @@ public interface IInitialBandwidthTrafficService
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> serverDetails(InitialBandwidthTraffic initialBandwidthTraffic);
|
||||
|
||||
Map<String, Object> pingDroppedEcharts(InitialBandwidthTraffic initialBandwidthTraffic);
|
||||
}
|
||||
|
||||
+13
@@ -636,6 +636,19 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
|
||||
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图表数据
|
||||
* @param initialBandwidthTraffic
|
||||
|
||||
@@ -146,11 +146,11 @@
|
||||
a.create_time as createTime,
|
||||
a.update_time as updateTime,
|
||||
b.serial,
|
||||
b.total,
|
||||
b.write_speed as writeSpeed,
|
||||
b.read_speed as readSpeed,
|
||||
TRUNCATE(IFNULL(b.total,0)/(1024 * 1024 * 1024), 0) as total,
|
||||
TRUNCATE(IFNULL(b.write_speed,0)/1024, 0) as writeSpeed,
|
||||
TRUNCATE(IFNULL(b.read_speed,0)/1024, 0) as readSpeed,
|
||||
b.type,
|
||||
b.used_space as usedSpace
|
||||
TRUNCATE(IFNULL(b.used_space,0)/(1024 * 1024 * 1024), 0) as usedSpace
|
||||
FROM all_disk_name a
|
||||
LEFT JOIN (
|
||||
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,
|
||||
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,
|
||||
ipV6
|
||||
ipV6, ping_dropped
|
||||
) VALUES (
|
||||
#{name}, #{mac}, #{status}, #{type}, #{ipV4}, #{inDropped}, #{outDropped},
|
||||
#{inSpeed}, #{outSpeed}, #{totalInSpeed}, #{totalOutSpeed}, #{duplex}, #{speed},
|
||||
#{createBy}, #{updateBy}, #{clientId}, #{createTime},
|
||||
#{ipv4InSpeed}, #{ipv4OutSpeed}, #{ipv6InSpeed}, #{ipv6OutSpeed},
|
||||
#{totalIpv4InSpeed}, #{totalIpv4OutSpeed}, #{totalIpv6InSpeed}, #{totalIpv6OutSpeed},
|
||||
#{ipV6}
|
||||
#{ipV6}, #{pingDropped}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -130,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
create_by, update_by, client_id, create_time,
|
||||
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,
|
||||
ipV6
|
||||
ipV6, ping_dropped
|
||||
) VALUES
|
||||
<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.ipv4InSpeed}, #{item.ipv4OutSpeed}, #{item.ipv6InSpeed}, #{item.ipv6OutSpeed},
|
||||
#{item.totalIpv4InSpeed}, #{item.totalIpv4OutSpeed}, #{item.totalIpv6InSpeed}, #{item.totalIpv6OutSpeed},
|
||||
#{item.ipV6}
|
||||
#{item.ipV6}, #{item.pingDropped}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -173,7 +173,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
total_ipv4_out_speed as totalIpv4OutSpeed,
|
||||
total_ipv6_in_speed as totalIpv6InSpeed,
|
||||
total_ipv6_out_speed as totalIpv6OutSpeed,
|
||||
ipV6
|
||||
ipV6,
|
||||
ping_dropped as pingDropped
|
||||
from ${tableName}
|
||||
<where>
|
||||
<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_ipv6_in_speed as totalIpv6InSpeed,
|
||||
total_ipv6_out_speed as totalIpv6OutSpeed,
|
||||
ipV6
|
||||
ipV6,
|
||||
ping_dropped as pingDropped
|
||||
from ${tableName}
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
|
||||
Reference in New Issue
Block a user