1、内存利用率图标增加内存已用字段。

2、ping丢包率虚拟网卡模式累加。
This commit is contained in:
gaoyutao
2026-02-03 18:46:51 +08:00
parent 180c522ca3
commit f8e0ab1b2a
8 changed files with 159 additions and 89 deletions
@@ -90,8 +90,15 @@ public class EchartsDataUtils {
// 计算稀疏间隔
long totalTimeRange = endDate.getTime() - startDate.getTime();
long sparseInterval = totalTimeRange > 12L * 30 * 24 * 60 * 60 * 1000 ?
30L * 24 * 60 * 60 * 1000 : 2L * 24 * 60 * 60 * 1000;
long sparseInterval;
if (totalTimeRange > 12L * 30 * 24 * 60 * 60 * 1000) { // 大于12个月
sparseInterval = 30L * 24 * 60 * 60 * 1000; // 30天间隔
} else if (totalTimeRange <= 24L * 60 * 60 * 1000) { // 小于等于24小时
sparseInterval = 5L * 60 * 1000; // 5分钟间隔
} else { // 其他情况(大于24小时,小于等于12个月)
sparseInterval = 2L * 24 * 60 * 60 * 1000; // 2天间隔
}
// 核心修改:生成X轴时间序列
List<Date> xAxisTimes = generateXAxisTimeSeries(
@@ -323,6 +330,16 @@ public class EchartsDataUtils {
if (normalizedStart < startMillis) {
calendar.add(Calendar.MILLISECOND, (int)interval);
}
} else {
// 对齐到下一分钟的0秒
// 先将秒和毫秒清零
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
// 如果当前时间不是整分钟,就跳到下一分钟
if (calendar.getTime().before(start)) {
calendar.add(Calendar.MINUTE, 1);
}
}
// 包含开始时间
@@ -182,9 +182,15 @@ public class EchartsMoreDataUtils {
// 计算稀疏间隔
long totalTimeRange = endDate.getTime() - startDate.getTime();
long sparseInterval = totalTimeRange > 12L * 30 * 24 * 60 * 60 * 1000 ?
30L * 24 * 60 * 60 * 1000 : 2L * 24 * 60 * 60 * 1000;
long sparseInterval;
if (totalTimeRange > 12L * 30 * 24 * 60 * 60 * 1000) { // 大于12个月
sparseInterval = 30L * 24 * 60 * 60 * 1000; // 30天间隔
} else if (totalTimeRange <= 24L * 60 * 60 * 1000) { // 小于等于24小时
sparseInterval = 5L * 60 * 1000; // 5分钟间隔
} else { // 其他情况(大于24小时,小于等于12个月)
sparseInterval = 2L * 24 * 60 * 60 * 1000; // 2天间隔
}
// 使用默认的5分钟作为数据期间间隔
long dataInterval = 300000L;
@@ -421,7 +427,7 @@ public class EchartsMoreDataUtils {
*/
private static long normalizeTime(Date time, long interval) {
long timeMillis = time.getTime();
return (timeMillis / interval) * interval;
return ((timeMillis + interval - 1) / interval) * interval;
}
public static Map<String, String> sortInterfaceMap(Map<String, String> interfaceMap, String mainName, boolean hasSub) {
List<Map.Entry<String, String>> list = new ArrayList<>(interfaceMap.entrySet());