项目初始化

This commit is contained in:
2026-03-26 18:13:38 +08:00
parent 2d131c9d70
commit 4d7b887136
2 changed files with 23 additions and 5 deletions

View File

@@ -21,8 +21,7 @@ public class SysAnalysisController {
public List<ChartInfo> getHostInfo() {
List<ChartInfo> chartInfoList = new ArrayList<>();
CpuInfo cpuInfo = OshiUtil.getCpuInfo();
long uptimeMs = OshiUtil.getOs().getSystemUptime();
String runTime = DateUtil.formatBetween(uptimeMs);
String runTime = DateUtil.formatBetween(OshiUtil.getOs().getSystemUptime() * 1000);
// 系统使用率(红色)
chartInfoList.add(new ChartInfo("sys", "系统使用率", cpuInfo.getSys(), KeyUtil.getColor(), runTime));
// 用户使用率(蓝色)
@@ -34,7 +33,7 @@ public class SysAnalysisController {
// CPU总使用率粉色
chartInfoList.add(new ChartInfo("used", "CPU总使用率", cpuInfo.getUsed(), KeyUtil.getColor(), runTime));
// 系统运行时间(紫色)
chartInfoList.add(new ChartInfo("time", "系统运行时", 0, KeyUtil.getColor(), runTime));
chartInfoList.add(new ChartInfo("time", "服务器运行时", 0, KeyUtil.getColor(), runTime));
return chartInfoList;
}
}