Fix node stats updates on Windows (#1748)

Because we aren't able to get CPU count/load info on Windows, they are
stubbed out to return placeholders. This restores compatibility to run
on Windows.
This commit is contained in:
David Zhao
2023-05-29 10:53:08 -07:00
committed by GitHub
parent fdfd830394
commit 956735ae05
6 changed files with 88 additions and 61 deletions
+1 -2
View File
@@ -3,7 +3,6 @@ package prometheus
import (
"time"
"github.com/mackerelio/go-osstat/loadavg"
"github.com/mackerelio/go-osstat/memory"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/atomic"
@@ -100,7 +99,7 @@ func Init(nodeID string, nodeType livekit.NodeType, env string) {
}
func GetUpdatedNodeStats(prev *livekit.NodeStats, prevAverage *livekit.NodeStats) (*livekit.NodeStats, bool, error) {
loadAvg, err := loadavg.Get()
loadAvg, err := getLoadAvg()
if err != nil {
return nil, false, err
}