1、优化子网卡流量图形展示。

2、优化接口名称存储逻辑,减少死锁。
3、增加cpu利用率内存利用率字段。
This commit is contained in:
gaoyutao
2025-12-17 18:18:19 +08:00
parent 597b5dad01
commit 343028ade5
12 changed files with 286 additions and 95 deletions
@@ -298,7 +298,8 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
showRealation.put("totalNetInTraffic", name+"总入站流量");
showRealation.put("totalNetOutTraffic", name+"总出站流量");
}
resultMap.put("showRealation", showRealation);
Map<String, String> sortedShowRealation = EchartsMoreDataUtils.sortInterfaceMap(showRealation, name, hasSubInterface);
resultMap.put("showRealation", sortedShowRealation);
return resultMap;
} catch (Exception e){
@@ -350,8 +351,8 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
// 展示关系
Map<String, String> showRealation = new HashMap<>();
interfaceDataMap.put(name, mainList);
showRealation.put(name + "netInSpeedData", name + "IPv4入站流量");
showRealation.put(name + "netOutSpeedData", name + "IPv4出站流量");
showRealation.put(name + "netInTraffic", name + "IPv4入站流量");
showRealation.put(name + "netOutTraffic", name + "IPv4出站流量");
boolean hasSubInterface = false;
// 如果是Ethernet类型,查询子网卡
@@ -370,8 +371,8 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
if (childTrafficList != null && !childTrafficList.isEmpty()) {
interfaceDataMap.put(child.getInterfaceName(), childTrafficList);
showRealation.put(child.getInterfaceName() + "netInSpeedData", child.getInterfaceName() + "IPv4入站流量");
showRealation.put(child.getInterfaceName() + "netOutSpeedData", child.getInterfaceName() + "IPv4出站流量");
showRealation.put(child.getInterfaceName() + "netInTraffic", child.getInterfaceName() + "IPv4入站流量");
showRealation.put(child.getInterfaceName() + "netOutTraffic", child.getInterfaceName() + "IPv4出站流量");
}
}
}
@@ -400,10 +401,11 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
resultMap.put("unit", unit);
if (!showRealation.isEmpty() && hasSubInterface) {
showRealation.put("totalNetInSpeedData", name + "IPv4总入站流量");
showRealation.put("totalNetOutSpeedData", name + "IPv4总出站流量");
showRealation.put("totalNetInTraffic", name + "IPv4总入站流量");
showRealation.put("totalNetOutTraffic", name + "IPv4总出站流量");
}
resultMap.put("showRealation", showRealation);
Map<String, String> sortedShowRealation = EchartsMoreDataUtils.sortInterfaceMap(showRealation, name, hasSubInterface);
resultMap.put("showRealation", sortedShowRealation);
return resultMap;
} catch (Exception e) {
@@ -429,8 +431,8 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
// 展示关系
Map<String, String> showRealation = new HashMap<>();
interfaceDataMap.put(name, mainList);
showRealation.put(name + "netInSpeedData", name + "IPv6入站流量");
showRealation.put(name + "netOutSpeedData", name + "IPv6出站流量");
showRealation.put(name + "netInTraffic", name + "IPv6入站流量");
showRealation.put(name + "netOutTraffic", name + "IPv6出站流量");
boolean hasSubInterface = false;
// 如果是Ethernet类型,查询子网卡
@@ -449,8 +451,8 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
if (childTrafficList != null && !childTrafficList.isEmpty()) {
interfaceDataMap.put(child.getInterfaceName(), childTrafficList);
showRealation.put(child.getInterfaceName() + "netInSpeedData", child.getInterfaceName() + "IPv6入站流量");
showRealation.put(child.getInterfaceName() + "netOutSpeedData", child.getInterfaceName() + "IPv6出站流量");
showRealation.put(child.getInterfaceName() + "netInTraffic", child.getInterfaceName() + "IPv6入站流量");
showRealation.put(child.getInterfaceName() + "netOutTraffic", child.getInterfaceName() + "IPv6出站流量");
}
}
}
@@ -479,10 +481,11 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
resultMap.put("unit", unit);
if (!showRealation.isEmpty() && hasSubInterface) {
showRealation.put("totalNetInSpeedData", name + "IPv6总入站流量");
showRealation.put("totalNetOutSpeedData", name + "IPv6总出站流量");
showRealation.put("totalNetInTraffic", name + "IPv6总入站流量");
showRealation.put("totalNetOutTraffic", name + "IPv6总出站流量");
}
resultMap.put("showRealation", showRealation);
Map<String, String> sortedShowRealation = EchartsMoreDataUtils.sortInterfaceMap(showRealation, name, hasSubInterface);
resultMap.put("showRealation", sortedShowRealation);
return resultMap;
} catch (Exception e) {
@@ -538,8 +541,8 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
// 展示关系
Map<String, String> showRealation = new HashMap<>();
interfaceDataMap.put(name, mainList);
showRealation.put(name + "netInSpeedData", name + "入站流量");
showRealation.put(name + "netOutSpeedData", name + "出站流量");
showRealation.put(name + "netInTraffic", name + "入站流量");
showRealation.put(name + "netOutTraffic", name + "出站流量");
boolean hasSubInterface = false;
// 如果是Ethernet类型,查询子网卡
@@ -558,8 +561,8 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
if (childTrafficList != null && !childTrafficList.isEmpty()) {
interfaceDataMap.put(child.getInterfaceName(), childTrafficList);
showRealation.put(child.getInterfaceName() + "netInSpeedData", child.getInterfaceName() + "入站流量");
showRealation.put(child.getInterfaceName() + "netOutSpeedData", child.getInterfaceName() + "出站流量");
showRealation.put(child.getInterfaceName() + "netInTraffic", child.getInterfaceName() + "入站流量");
showRealation.put(child.getInterfaceName() + "netOutTraffic", child.getInterfaceName() + "出站流量");
}
}
}
@@ -588,10 +591,11 @@ public class InitialBandwidthTrafficServiceImpl implements IInitialBandwidthTraf
resultMap.put("unit", unit);
if (!showRealation.isEmpty() && hasSubInterface) {
showRealation.put("totalNetInSpeedData", name + "总入站流量");
showRealation.put("totalNetOutSpeedData", name + "总出站流量");
showRealation.put("totalNetInTraffic", name + "总入站流量");
showRealation.put("totalNetOutTraffic", name + "总出站流量");
}
resultMap.put("showRealation", showRealation);
Map<String, String> sortedShowRealation = EchartsMoreDataUtils.sortInterfaceMap(showRealation, name, hasSubInterface);
resultMap.put("showRealation", sortedShowRealation);
return resultMap;
} catch (Exception e) {