initialize prometheus metrics in test files (#2267)
This commit is contained in:
@@ -31,10 +31,15 @@ import (
|
|||||||
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
|
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
|
||||||
"github.com/livekit/livekit-server/pkg/sfu/audio"
|
"github.com/livekit/livekit-server/pkg/sfu/audio"
|
||||||
"github.com/livekit/livekit-server/pkg/telemetry"
|
"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/telemetry/telemetryfakes"
|
||||||
"github.com/livekit/livekit-server/pkg/testutils"
|
"github.com/livekit/livekit-server/pkg/testutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
prometheus.Init("test", livekit.NodeType_SERVER, "test")
|
||||||
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
numParticipants = 3
|
numParticipants = 3
|
||||||
defaultDelay = 10 * time.Millisecond
|
defaultDelay = 10 * time.Millisecond
|
||||||
|
|||||||
@@ -21,13 +21,8 @@ import (
|
|||||||
|
|
||||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||||
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
|
"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 {
|
func NewMockParticipant(identity livekit.ParticipantIdentity, protocol types.ProtocolVersion, hidden bool, publisher bool) *typesfakes.FakeLocalParticipant {
|
||||||
p := &typesfakes.FakeLocalParticipant{}
|
p := &typesfakes.FakeLocalParticipant{}
|
||||||
sid := utils.NewGuid(utils.ParticipantPrefix)
|
sid := utils.NewGuid(utils.ParticipantPrefix)
|
||||||
|
|||||||
Reference in New Issue
Block a user