store cpu load in node stats (#524)

* store cpu load in node stats

* num cpus uint32

* cpu load selector test

* dep update
This commit is contained in:
Mathew Kamkar
2022-03-16 14:51:22 -07:00
committed by GitHub
parent 33f9726b79
commit cac6d22a72
11 changed files with 146 additions and 27 deletions
+4 -1
View File
@@ -4,9 +4,10 @@ import (
"testing"
"time"
"github.com/livekit/protocol/livekit"
"github.com/stretchr/testify/require"
"github.com/livekit/protocol/livekit"
"github.com/livekit/livekit-server/pkg/routing/selector"
)
@@ -16,6 +17,7 @@ var (
Stats: &livekit.NodeStats{
UpdatedAt: time.Now().Unix(),
NumCpus: 1,
CpuLoad: 0.1,
LoadAvgLast1Min: 0.0,
},
}
@@ -25,6 +27,7 @@ var (
Stats: &livekit.NodeStats{
UpdatedAt: time.Now().Unix(),
NumCpus: 1,
CpuLoad: 0.99,
LoadAvgLast1Min: 2.0,
},
}