Merge branch 'develop' of gitea.bywaystudios.com:pet_home/pet_home_server into develop
This commit is contained in:
commit
f8084e8baf
@ -226,7 +226,12 @@ func ReqServerInfo(args []interface{}) error {
|
||||
// 3. 获取 CPU 使用率(一秒内采样)
|
||||
cpuPercent, err := cpu.Percent(time.Second, false)
|
||||
if err == nil && len(cpuPercent) > 0 {
|
||||
res["CPU"] = fmt.Sprintf("%.2f%%", cpuPercent[0])
|
||||
res["CPU"] = cpuPercent[0]
|
||||
}
|
||||
if vmStat != nil {
|
||||
res["FreeMem"] = vmStat.Available / (1024 * 1024)
|
||||
} else {
|
||||
res["FreeMem"] = 0
|
||||
}
|
||||
res["Version"] = conf.Server.Version
|
||||
AdminPlayerBack(a, res)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user