mirror of
https://github.com/livekit/livekit.git
synced 2026-12-04 00:35:05 +00:00
Set numCPUs correctly in non-linux environment (#653)
This commit is contained in:
1 parent
b9ee0b5800
commit
4e5863496c
1 file changed
+4
@@ -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