Set numCPUs correctly in non-linux environment (#653)
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
package prometheus
|
package prometheus
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/mackerelio/go-osstat/cpu"
|
"github.com/mackerelio/go-osstat/cpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -22,5 +24,7 @@ func getCPUStats() (cpuLoad float32, numCPUs uint32, err error) {
|
|||||||
lastCPUTotal = cpuInfo.Total
|
lastCPUTotal = cpuInfo.Total
|
||||||
lastCPUIdle = cpuInfo.Idle
|
lastCPUIdle = cpuInfo.Idle
|
||||||
|
|
||||||
|
numCPUs = uint32(runtime.NumCPU())
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user