From 890f0bfc677bdc62e78337ea2ef8f1648eff1861 Mon Sep 17 00:00:00 2001 From: Paul Wells Date: Mon, 27 Nov 2023 21:31:39 -0800 Subject: [PATCH] initialize prometheus metrics in test files (#2267) --- pkg/rtc/room_test.go | 5 +++++ pkg/rtc/testutils.go | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/rtc/room_test.go b/pkg/rtc/room_test.go index 36322cbc1..81dfe90c8 100644 --- a/pkg/rtc/room_test.go +++ b/pkg/rtc/room_test.go @@ -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 diff --git a/pkg/rtc/testutils.go b/pkg/rtc/testutils.go index fe5c10ad6..845cc4629 100644 --- a/pkg/rtc/testutils.go +++ b/pkg/rtc/testutils.go @@ -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)