项目初始化
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user