replace entire nodeStats object (#393)

This commit is contained in:
David Colburn
2022-01-31 17:09:36 -07:00
committed by GitHub
parent 745939ec24
commit 3d132730f9
6 changed files with 66 additions and 67 deletions
+3 -2
View File
@@ -19,11 +19,12 @@ func (s *SystemLoadSelector) filterNodes(nodes []*livekit.Node) ([]*livekit.Node
nodesLowLoad := make([]*livekit.Node, 0)
for _, node := range nodes {
numCpus := node.Stats.NumCpus
stats := node.Stats
numCpus := stats.NumCpus
if numCpus == 0 {
numCpus = 1
}
if node.Stats.LoadAvgLast1Min/float32(numCpus) < s.SysloadLimit {
if stats.LoadAvgLast1Min/float32(numCpus) < s.SysloadLimit {
nodesLowLoad = append(nodesLowLoad, node)
}
}