initialize prometheus metrics in test files (#2267)

This commit is contained in:
Paul Wells
2023-11-27 21:31:39 -08:00
committed by GitHub
parent ca71b486a1
commit 890f0bfc67
2 changed files with 5 additions and 5 deletions

View File

@@ -31,10 +31,15 @@ import (
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
"github.com/livekit/livekit-server/pkg/sfu/audio"
"github.com/livekit/livekit-server/pkg/telemetry"
"github.com/livekit/livekit-server/pkg/telemetry/prometheus"
"github.com/livekit/livekit-server/pkg/telemetry/telemetryfakes"
"github.com/livekit/livekit-server/pkg/testutils"
)
func init() {
prometheus.Init("test", livekit.NodeType_SERVER, "test")
}
const (
numParticipants = 3
defaultDelay = 10 * time.Millisecond

View File

@@ -21,13 +21,8 @@ import (
"github.com/livekit/livekit-server/pkg/rtc/types"
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
"github.com/livekit/livekit-server/pkg/telemetry/prometheus"
)
func init() {
prometheus.Init("test", livekit.NodeType_SERVER, "test")
}
func NewMockParticipant(identity livekit.ParticipantIdentity, protocol types.ProtocolVersion, hidden bool, publisher bool) *typesfakes.FakeLocalParticipant {
p := &typesfakes.FakeLocalParticipant{}
sid := utils.NewGuid(utils.ParticipantPrefix)