uses cpu.ClocksPerSec as the multiplication factor

This commit is contained in:
renaynay 2020-05-12 17:06:34 +02:00
parent 9d51ba19db
commit f11d4d5930
No known key found for this signature in database
GPG key ID: 6557F5413D663EDB

View file

@ -33,7 +33,7 @@ func ReadCPUStats(stats *CPUStats) {
} }
// requesting all cpu times will always return an array with only one time stats entry // requesting all cpu times will always return an array with only one time stats entry
timeStat := timeStats[0] timeStat := timeStats[0]
stats.GlobalTime = int64((timeStat.User + timeStat.Nice + timeStat.System)) stats.GlobalTime = int64((timeStat.User + timeStat.Nice + timeStat.System) * cpu.ClocksPerSec)
stats.GlobalWait = int64((timeStat.Iowait)) stats.GlobalWait = int64((timeStat.Iowait) * cpu.ClocksPerSec)
stats.LocalTime = getProcessCPUTime() stats.LocalTime = getProcessCPUTime()
} }