优化业务流量存储

This commit is contained in:
gaoyutao
2026-03-17 17:59:08 +08:00
parent 00b2230773
commit fb27c1c0e0
@@ -205,7 +205,7 @@ public class MessageHandler {
// 1. 构建快速查找的Map,使用MAC地址+网卡名称作为唯一键
Map<String, InitialNetBusinessTrafficTemp> tempMap = tempList.stream()
.collect(Collectors.toMap(
tempItem -> generateKey(tempItem.getMac(), tempItem.getName()),
tempItem -> tempItem.getProcessName(),
Function.identity(),
(existing, replacement) -> existing
));
@@ -233,7 +233,7 @@ public class MessageHandler {
iface.setIpv6OutSpeed(null);
// 使用MAC地址+网卡名称作为查找键
String key = generateKey(iface.getMac(), iface.getName());
String key = iface.getProcessName();
InitialNetBusinessTrafficTemp tempInfo = tempMap.get(key);
if (tempInfo != null) {
// 计算总流入速率