From d4f6ec39b7e0421757a6b9d1a68b1c4610ea2e8c Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期四, 14 三月 2024 14:54:20 +0800 Subject: [PATCH] 优化CivilCode缓存 --- src/main/java/com/genersoft/iot/vmp/conf/SystemInfoTimerTask.java | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/SystemInfoTimerTask.java b/src/main/java/com/genersoft/iot/vmp/conf/SystemInfoTimerTask.java index 74a90c2..40803cd 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/SystemInfoTimerTask.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/SystemInfoTimerTask.java @@ -9,6 +9,7 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import java.util.List; import java.util.Map; /** @@ -22,18 +23,22 @@ @Autowired private IRedisCatchStorage redisCatchStorage; - @Scheduled(fixedRate = 1000) //姣�1绉掓墽琛屼竴娆� + @Scheduled(fixedRate = 2000) //姣�1绉掓墽琛屼竴娆� public void execute(){ try { double cpuInfo = SystemInfoUtils.getCpuInfo(); redisCatchStorage.addCpuInfo(cpuInfo); double memInfo = SystemInfoUtils.getMemInfo(); redisCatchStorage.addMemInfo(memInfo); - Map<String, String> networkInterfaces = SystemInfoUtils.getNetworkInterfaces(); + Map<String, Double> networkInterfaces = SystemInfoUtils.getNetworkInterfaces(); redisCatchStorage.addNetInfo(networkInterfaces); + List<Map<String, Object>> diskInfo =SystemInfoUtils.getDiskInfo(); + redisCatchStorage.addDiskInfo(diskInfo); } catch (InterruptedException e) { logger.error("[鑾峰彇绯荤粺淇℃伅澶辫触] {}", e.getMessage()); } } + + } -- Gitblit v1.8.0