From a4ec4177a6b57c270c0f0255d0b9d32b2f93567d Mon Sep 17 00:00:00 2001 From: Ben Aldrich Date: Fri, 4 Sep 2015 18:48:20 -0600 Subject: [PATCH] Fix cpu percent on windows Tested on windows 7: When divided by 100 you get cpu percentage of %0.14 when task manager shows %14. Once this is removed they match. --- cpu/cpu_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/cpu_windows.go b/cpu/cpu_windows.go index 34199b7b..96f4c70f 100644 --- a/cpu/cpu_windows.go +++ b/cpu/cpu_windows.go @@ -99,7 +99,7 @@ func CPUPercent(interval time.Duration, percpu bool) ([]float64, error) { if l.LoadPercentage == nil { continue } - ret = append(ret, float64(*l.LoadPercentage)/100.0) + ret = append(ret, float64(*l.LoadPercentage)) } return ret, nil }