protocol 0.8 (#95)

* protocol 0.8

* merge new selector
This commit is contained in:
David Colburn
2021-08-27 13:16:33 -05:00
committed by GitHub
parent c437152e2b
commit 8a44fad307
57 changed files with 89 additions and 199 deletions
+1 -2
View File
@@ -1,9 +1,8 @@
package routing
import (
livekit "github.com/livekit/protocol/proto"
"google.golang.org/protobuf/proto"
livekit "github.com/livekit/livekit-server/proto"
)
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
+1 -1
View File
@@ -4,11 +4,11 @@ import (
"sync"
"time"
livekit "github.com/livekit/protocol/proto"
"github.com/livekit/protocol/utils"
"google.golang.org/protobuf/proto"
"github.com/livekit/livekit-server/pkg/logger"
livekit "github.com/livekit/livekit-server/proto"
)
// a router of messages on the same node, basic implementation for local testing
+2 -1
View File
@@ -4,8 +4,9 @@ import (
"sync"
"testing"
livekit "github.com/livekit/protocol/proto"
"github.com/livekit/livekit-server/pkg/routing"
livekit "github.com/livekit/livekit-server/proto"
)
func TestMessageChannel_WriteMessageClosed(t *testing.T) {
+2 -2
View File
@@ -8,10 +8,10 @@ import (
"time"
"github.com/jxskiss/base62"
livekit "github.com/livekit/protocol/proto"
"github.com/livekit/protocol/utils"
"github.com/livekit/livekit-server/pkg/config"
livekit "github.com/livekit/livekit-server/proto"
"github.com/livekit/protocol/utils"
)
type NodeStats struct {
+2 -3
View File
@@ -4,10 +4,9 @@ import (
"context"
"github.com/go-redis/redis/v8"
"google.golang.org/protobuf/proto"
livekit "github.com/livekit/livekit-server/proto"
livekit "github.com/livekit/protocol/proto"
"github.com/livekit/protocol/utils"
"google.golang.org/protobuf/proto"
)
const (
+2 -2
View File
@@ -5,13 +5,13 @@ import (
"time"
"github.com/go-redis/redis/v8"
livekit "github.com/livekit/protocol/proto"
"github.com/livekit/protocol/utils"
"github.com/pkg/errors"
"google.golang.org/protobuf/proto"
"github.com/livekit/livekit-server/pkg/logger"
"github.com/livekit/livekit-server/pkg/utils/stats"
livekit "github.com/livekit/livekit-server/proto"
"github.com/livekit/protocol/utils"
)
const (
@@ -5,7 +5,7 @@ import (
"sync"
"github.com/livekit/livekit-server/pkg/routing"
livekit "github.com/livekit/livekit-server/proto"
livekit "github.com/livekit/protocol/proto"
)
type FakeNodeSelector struct {
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"sync"
"github.com/livekit/livekit-server/pkg/routing"
livekit "github.com/livekit/livekit-server/proto"
livekit "github.com/livekit/protocol/proto"
)
type FakeRouter struct {
+1 -1
View File
@@ -1,7 +1,7 @@
package routing
import (
livekit "github.com/livekit/livekit-server/proto"
livekit "github.com/livekit/protocol/proto"
"github.com/thoas/go-funk"
)
+2 -2
View File
@@ -1,7 +1,7 @@
package routing
import (
livekit "github.com/livekit/livekit-server/proto"
livekit "github.com/livekit/protocol/proto"
"github.com/thoas/go-funk"
)
@@ -15,7 +15,7 @@ func (s *SystemLoadSelector) SelectNode(nodes []*livekit.Node, room *livekit.Roo
return nil, ErrNoAvailableNodes
}
nodesLowLoad := []*livekit.Node{}
nodesLowLoad := make([]*livekit.Node, 0)
for _, node := range nodes {
numCpus := node.Stats.NumCpus
if numCpus == 0 {
+3 -2
View File
@@ -4,9 +4,10 @@ import (
"testing"
"time"
"github.com/livekit/livekit-server/pkg/routing"
livekit "github.com/livekit/livekit-server/proto"
livekit "github.com/livekit/protocol/proto"
"github.com/stretchr/testify/require"
"github.com/livekit/livekit-server/pkg/routing"
)
var (
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"strings"
"time"
livekit "github.com/livekit/livekit-server/proto"
livekit "github.com/livekit/protocol/proto"
"github.com/thoas/go-funk"
)
+3 -2
View File
@@ -4,9 +4,10 @@ import (
"testing"
"time"
"github.com/livekit/livekit-server/pkg/routing"
livekit "github.com/livekit/livekit-server/proto"
livekit "github.com/livekit/protocol/proto"
"github.com/stretchr/testify/require"
"github.com/livekit/livekit-server/pkg/routing"
)
func TestIsAvailable(t *testing.T) {