优化业务流量存储
This commit is contained in:
@@ -205,7 +205,7 @@ public class MessageHandler {
|
|||||||
// 1. 构建快速查找的Map,使用MAC地址+网卡名称作为唯一键
|
// 1. 构建快速查找的Map,使用MAC地址+网卡名称作为唯一键
|
||||||
Map<String, InitialNetBusinessTrafficTemp> tempMap = tempList.stream()
|
Map<String, InitialNetBusinessTrafficTemp> tempMap = tempList.stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
tempItem -> generateKey(tempItem.getMac(), tempItem.getName()),
|
tempItem -> tempItem.getProcessName(),
|
||||||
Function.identity(),
|
Function.identity(),
|
||||||
(existing, replacement) -> existing
|
(existing, replacement) -> existing
|
||||||
));
|
));
|
||||||
@@ -233,7 +233,7 @@ public class MessageHandler {
|
|||||||
iface.setIpv6OutSpeed(null);
|
iface.setIpv6OutSpeed(null);
|
||||||
|
|
||||||
// 使用MAC地址+网卡名称作为查找键
|
// 使用MAC地址+网卡名称作为查找键
|
||||||
String key = generateKey(iface.getMac(), iface.getName());
|
String key = iface.getProcessName();
|
||||||
InitialNetBusinessTrafficTemp tempInfo = tempMap.get(key);
|
InitialNetBusinessTrafficTemp tempInfo = tempMap.get(key);
|
||||||
if (tempInfo != null) {
|
if (tempInfo != null) {
|
||||||
// 计算总流入速率
|
// 计算总流入速率
|
||||||
|
|||||||
Reference in New Issue
Block a user