Set numCPUs correctly in non-linux environment
package prometheus
import (
+ "runtime"
+
"github.com/mackerelio/go-osstat/cpu"
)
@@ -22,5 +24,7 @@ func getCPUStats() (cpuLoad float32, numCPUs uint32, err error) {
lastCPUTotal = cpuInfo.Total
lastCPUIdle = cpuInfo.Idle
+ numCPUs = uint32(runtime.NumCPU())
+
return
}
