add cpu and memery total info

This commit is contained in:
liuzhihang1
2025-02-25 15:05:38 +08:00
parent 0f41d11aec
commit 4f96d04f88
10 changed files with 25 additions and 9 deletions

View File

@@ -283,7 +283,7 @@ func (p *ProcessBase) monitorHanler() {
}
p.AddRecordTime()
p.AddCpuUsage(cpuPercent)
p.AddMemUsage(float64(memInfo.RSS) / 1024.0)
p.AddMemUsage(float64(memInfo.RSS >> 10))
// log.Logger.Debugw("进程资源使用率获取成功", "cpu", cpuPercent, "mem", memInfo.RSS)
select {
case <-ticker.C: