首页改造,完成cpu,内存,网络图

This commit is contained in:
648540858
2022-10-20 18:03:40 +08:00
parent 95d367702a
commit 3ffe205082
18 changed files with 711 additions and 758 deletions

View File

@@ -22,14 +22,14 @@ public class SystemInfoTimerTask {
@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);
} catch (InterruptedException e) {
logger.error("[获取系统信息失败] {}", e.getMessage());