From f11d4d59309160835a5879f6d6df329e78d4e39c Mon Sep 17 00:00:00 2001 From: renaynay <41963722+renaynay@users.noreply.github.com> Date: Tue, 12 May 2020 17:06:34 +0200 Subject: [PATCH] uses cpu.ClocksPerSec as the multiplication factor --- metrics/cpu_enabled.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metrics/cpu_enabled.go b/metrics/cpu_enabled.go index 71c3922329..52a3c2e966 100644 --- a/metrics/cpu_enabled.go +++ b/metrics/cpu_enabled.go @@ -33,7 +33,7 @@ func ReadCPUStats(stats *CPUStats) { } // requesting all cpu times will always return an array with only one time stats entry timeStat := timeStats[0] - stats.GlobalTime = int64((timeStat.User + timeStat.Nice + timeStat.System)) - stats.GlobalWait = int64((timeStat.Iowait)) + stats.GlobalTime = int64((timeStat.User + timeStat.Nice + timeStat.System) * cpu.ClocksPerSec) + stats.GlobalWait = int64((timeStat.Iowait) * cpu.ClocksPerSec) stats.LocalTime = getProcessCPUTime() }