mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 13:25:42 +00:00
Set numCPUs correctly in non-linux environment (#653)
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user