Key telemetry stats worker using combination of roomID, participantID (#4323)
* Key telemetry stats work using combination of roomID, participantID With forwarded participant, the same participantID can existing in two rooms. NOTE: This does not yet allow a participant session to report its events/track stats into multiple rooms. That would require regitering multiple listeners (from rooms a participant is forwarded to). * missed file * data channel stats * PR comments + pass in room name so that telemetry events have proper room name also
This commit is contained in:
+52
-28
@@ -188,7 +188,7 @@ func (t *telemetryService) ParticipantLeft(ctx context.Context,
|
||||
) {
|
||||
t.enqueue(func() {
|
||||
isConnected := false
|
||||
if worker, ok := t.getWorker(livekit.ParticipantID(participant.Sid)); ok {
|
||||
if worker, ok := t.getWorker(livekit.RoomID(room.Sid), livekit.ParticipantID(participant.Sid)); ok {
|
||||
isConnected = worker.IsConnected()
|
||||
if worker.Close(guard) {
|
||||
prometheus.SubParticipant()
|
||||
@@ -224,13 +224,15 @@ func (t *telemetryService) ParticipantLeft(ctx context.Context,
|
||||
|
||||
func (t *telemetryService) TrackPublishRequested(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
identity livekit.ParticipantIdentity,
|
||||
track *livekit.TrackInfo,
|
||||
) {
|
||||
t.enqueue(func() {
|
||||
prometheus.RecordTrackPublishAttempt(track.Type.String())
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
ev := newTrackEvent(livekit.AnalyticsEventType_TRACK_PUBLISH_REQUESTED, room, participantID, track)
|
||||
if ev.Participant != nil {
|
||||
ev.Participant.Identity = string(identity)
|
||||
@@ -241,6 +243,8 @@ func (t *telemetryService) TrackPublishRequested(
|
||||
|
||||
func (t *telemetryService) TrackPublished(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
identity livekit.ParticipantIdentity,
|
||||
track *livekit.TrackInfo,
|
||||
@@ -253,7 +257,7 @@ func (t *telemetryService) TrackPublished(
|
||||
return
|
||||
}
|
||||
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
participant := &livekit.ParticipantInfo{
|
||||
Sid: string(participantID),
|
||||
Identity: string(identity),
|
||||
@@ -271,22 +275,30 @@ func (t *telemetryService) TrackPublished(
|
||||
})
|
||||
}
|
||||
|
||||
func (t *telemetryService) TrackPublishedUpdate(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo) {
|
||||
func (t *telemetryService) TrackPublishedUpdate(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
track *livekit.TrackInfo,
|
||||
) {
|
||||
t.enqueue(func() {
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
t.SendEvent(ctx, newTrackEvent(livekit.AnalyticsEventType_TRACK_PUBLISHED_UPDATE, room, participantID, track))
|
||||
})
|
||||
}
|
||||
|
||||
func (t *telemetryService) TrackMaxSubscribedVideoQuality(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
track *livekit.TrackInfo,
|
||||
mime mime.MimeType,
|
||||
maxQuality livekit.VideoQuality,
|
||||
) {
|
||||
t.enqueue(func() {
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
ev := newTrackEvent(livekit.AnalyticsEventType_TRACK_MAX_SUBSCRIBED_VIDEO_QUALITY, room, participantID, track)
|
||||
ev.MaxSubscribedVideoQuality = maxQuality
|
||||
ev.Mime = mime.String()
|
||||
@@ -296,13 +308,15 @@ func (t *telemetryService) TrackMaxSubscribedVideoQuality(
|
||||
|
||||
func (t *telemetryService) TrackSubscribeRequested(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
track *livekit.TrackInfo,
|
||||
) {
|
||||
t.enqueue(func() {
|
||||
prometheus.RecordTrackSubscribeAttempt()
|
||||
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
ev := newTrackEvent(livekit.AnalyticsEventType_TRACK_SUBSCRIBE_REQUESTED, room, participantID, track)
|
||||
t.SendEvent(ctx, ev)
|
||||
})
|
||||
@@ -310,6 +324,8 @@ func (t *telemetryService) TrackSubscribeRequested(
|
||||
|
||||
func (t *telemetryService) TrackSubscribed(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
track *livekit.TrackInfo,
|
||||
publisher *livekit.ParticipantInfo,
|
||||
@@ -322,7 +338,7 @@ func (t *telemetryService) TrackSubscribed(
|
||||
return
|
||||
}
|
||||
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
ev := newTrackEvent(livekit.AnalyticsEventType_TRACK_SUBSCRIBED, room, participantID, track)
|
||||
ev.Publisher = publisher
|
||||
t.SendEvent(ctx, ev)
|
||||
@@ -331,6 +347,8 @@ func (t *telemetryService) TrackSubscribed(
|
||||
|
||||
func (t *telemetryService) TrackSubscribeFailed(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
trackID livekit.TrackID,
|
||||
err error,
|
||||
@@ -339,7 +357,7 @@ func (t *telemetryService) TrackSubscribeFailed(
|
||||
t.enqueue(func() {
|
||||
prometheus.RecordTrackSubscribeFailure(err, isUserError)
|
||||
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
ev := newTrackEvent(livekit.AnalyticsEventType_TRACK_SUBSCRIBE_FAILED, room, participantID, &livekit.TrackInfo{
|
||||
Sid: string(trackID),
|
||||
})
|
||||
@@ -350,6 +368,8 @@ func (t *telemetryService) TrackSubscribeFailed(
|
||||
|
||||
func (t *telemetryService) TrackUnsubscribed(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
track *livekit.TrackInfo,
|
||||
shouldSendEvent bool,
|
||||
@@ -358,7 +378,7 @@ func (t *telemetryService) TrackUnsubscribed(
|
||||
prometheus.RecordTrackUnsubscribed(track.Type.String())
|
||||
|
||||
if shouldSendEvent {
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
t.SendEvent(ctx, newTrackEvent(livekit.AnalyticsEventType_TRACK_UNSUBSCRIBED, room, participantID, track))
|
||||
}
|
||||
})
|
||||
@@ -366,6 +386,8 @@ func (t *telemetryService) TrackUnsubscribed(
|
||||
|
||||
func (t *telemetryService) TrackUnpublished(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
identity livekit.ParticipantIdentity,
|
||||
track *livekit.TrackInfo,
|
||||
@@ -377,7 +399,7 @@ func (t *telemetryService) TrackUnpublished(
|
||||
return
|
||||
}
|
||||
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
participant := &livekit.ParticipantInfo{
|
||||
Sid: string(participantID),
|
||||
Identity: string(identity),
|
||||
@@ -395,28 +417,34 @@ func (t *telemetryService) TrackUnpublished(
|
||||
|
||||
func (t *telemetryService) TrackMuted(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
track *livekit.TrackInfo,
|
||||
) {
|
||||
t.enqueue(func() {
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
t.SendEvent(ctx, newTrackEvent(livekit.AnalyticsEventType_TRACK_MUTED, room, participantID, track))
|
||||
})
|
||||
}
|
||||
|
||||
func (t *telemetryService) TrackUnmuted(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
track *livekit.TrackInfo,
|
||||
) {
|
||||
t.enqueue(func() {
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
t.SendEvent(ctx, newTrackEvent(livekit.AnalyticsEventType_TRACK_UNMUTED, room, participantID, track))
|
||||
})
|
||||
}
|
||||
|
||||
func (t *telemetryService) TrackPublishRTPStats(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
trackID livekit.TrackID,
|
||||
mimeType mime.MimeType,
|
||||
@@ -424,7 +452,7 @@ func (t *telemetryService) TrackPublishRTPStats(
|
||||
stats *livekit.RTPStats,
|
||||
) {
|
||||
t.enqueue(func() {
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
ev := newRoomEvent(livekit.AnalyticsEventType_TRACK_PUBLISH_STATS, room)
|
||||
ev.ParticipantId = string(participantID)
|
||||
ev.TrackId = string(trackID)
|
||||
@@ -437,13 +465,15 @@ func (t *telemetryService) TrackPublishRTPStats(
|
||||
|
||||
func (t *telemetryService) TrackSubscribeRTPStats(
|
||||
ctx context.Context,
|
||||
roomID livekit.RoomID,
|
||||
roomName livekit.RoomName,
|
||||
participantID livekit.ParticipantID,
|
||||
trackID livekit.TrackID,
|
||||
mimeType mime.MimeType,
|
||||
stats *livekit.RTPStats,
|
||||
) {
|
||||
t.enqueue(func() {
|
||||
room := t.getRoomDetails(participantID)
|
||||
room := toMinimalRoomProto(roomID, roomName)
|
||||
ev := newRoomEvent(livekit.AnalyticsEventType_TRACK_SUBSCRIBE_STATS, room)
|
||||
ev.ParticipantId = string(participantID)
|
||||
ev.TrackId = string(trackID)
|
||||
@@ -560,19 +590,6 @@ func (t *telemetryService) Webhook(ctx context.Context, webhookInfo *livekit.Web
|
||||
})
|
||||
}
|
||||
|
||||
// returns a livekit.Room with only name and sid filled out
|
||||
// returns nil if room is not found
|
||||
func (t *telemetryService) getRoomDetails(participantID livekit.ParticipantID) *livekit.Room {
|
||||
if worker, ok := t.getWorker(participantID); ok {
|
||||
return &livekit.Room{
|
||||
Sid: string(worker.roomID),
|
||||
Name: string(worker.roomName),
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func newRoomEvent(event livekit.AnalyticsEventType, room *livekit.Room) *livekit.AnalyticsEvent {
|
||||
ev := &livekit.AnalyticsEvent{
|
||||
Type: event,
|
||||
@@ -623,3 +640,10 @@ func newIngressEvent(event livekit.AnalyticsEventType, ingress *livekit.IngressI
|
||||
Ingress: ingress,
|
||||
}
|
||||
}
|
||||
|
||||
func toMinimalRoomProto(roomID livekit.RoomID, roomName livekit.RoomName) *livekit.Room {
|
||||
return &livekit.Room{
|
||||
Sid: string(roomID),
|
||||
Name: string(roomName),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +103,8 @@ func Test_OnTrackUpdate_EventIsSent(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
roomID := "room1"
|
||||
roomName := "RoomName"
|
||||
partID := "part1"
|
||||
trackID := "track1"
|
||||
layer := &livekit.VideoLayer{
|
||||
@@ -122,7 +124,7 @@ func Test_OnTrackUpdate_EventIsSent(t *testing.T) {
|
||||
}
|
||||
|
||||
// do
|
||||
fixture.sut.TrackPublishedUpdate(context.Background(), livekit.ParticipantID(partID), trackInfo)
|
||||
fixture.sut.TrackPublishedUpdate(context.Background(), livekit.RoomID(roomID), livekit.RoomName(roomName), livekit.ParticipantID(partID), trackInfo)
|
||||
time.Sleep(time.Millisecond * 500)
|
||||
|
||||
// test
|
||||
@@ -226,7 +228,7 @@ func Test_OnTrackSubscribed_EventIsSent(t *testing.T) {
|
||||
require.Equal(t, room, event.Room)
|
||||
|
||||
// do
|
||||
fixture.sut.TrackSubscribed(context.Background(), livekit.ParticipantID(partSID), trackInfo, publisherInfo, true)
|
||||
fixture.sut.TrackSubscribed(context.Background(), livekit.RoomID(room.Sid), livekit.RoomName(room.Name), livekit.ParticipantID(partSID), trackInfo, publisherInfo, true)
|
||||
time.Sleep(time.Millisecond * 500)
|
||||
|
||||
require.Eventually(t, func() bool {
|
||||
|
||||
@@ -1,279 +0,0 @@
|
||||
// Copyright 2023 LiveKit, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package telemetry
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/frostbyte73/core"
|
||||
"go.uber.org/atomic"
|
||||
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/observability/roomobs"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
type BytesTrackType string
|
||||
|
||||
const (
|
||||
BytesTrackTypeData BytesTrackType = "DT"
|
||||
BytesTrackTypeSignal BytesTrackType = "SG"
|
||||
)
|
||||
|
||||
// -------------------------------
|
||||
|
||||
type TrafficTotals struct {
|
||||
At time.Time
|
||||
SendBytes uint64
|
||||
SendMessages uint32
|
||||
RecvBytes uint64
|
||||
RecvMessages uint32
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
|
||||
// stats for signal and data channel
|
||||
type BytesTrackStats struct {
|
||||
country string
|
||||
trackID livekit.TrackID
|
||||
pID livekit.ParticipantID
|
||||
send, recv atomic.Uint64
|
||||
sendMessages, recvMessages atomic.Uint32
|
||||
totalSendBytes, totalRecvBytes atomic.Uint64
|
||||
totalSendMessages, totalRecvMessages atomic.Uint32
|
||||
telemetry TelemetryService
|
||||
reporter roomobs.TrackReporter
|
||||
done core.Fuse
|
||||
}
|
||||
|
||||
func NewBytesTrackStats(
|
||||
country string,
|
||||
trackID livekit.TrackID,
|
||||
pID livekit.ParticipantID,
|
||||
telemetry TelemetryService,
|
||||
participantReporter roomobs.ParticipantSessionReporter,
|
||||
) *BytesTrackStats {
|
||||
s := &BytesTrackStats{
|
||||
country: country,
|
||||
trackID: trackID,
|
||||
pID: pID,
|
||||
telemetry: telemetry,
|
||||
reporter: participantReporter.WithTrack(trackID.String()),
|
||||
}
|
||||
go s.worker()
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *BytesTrackStats) AddBytes(bytes uint64, isSend bool) {
|
||||
if isSend {
|
||||
s.send.Add(bytes)
|
||||
s.sendMessages.Inc()
|
||||
s.totalSendBytes.Add(bytes)
|
||||
s.totalSendMessages.Inc()
|
||||
|
||||
s.reporter.Tx(func(tx roomobs.TrackTx) {
|
||||
tx.ReportType(roomobs.TrackTypeData)
|
||||
tx.ReportSendBytes(uint32(bytes))
|
||||
tx.ReportSendPackets(1)
|
||||
})
|
||||
} else {
|
||||
s.recv.Add(bytes)
|
||||
s.recvMessages.Inc()
|
||||
s.totalRecvBytes.Add(bytes)
|
||||
s.totalRecvMessages.Inc()
|
||||
|
||||
s.reporter.Tx(func(tx roomobs.TrackTx) {
|
||||
tx.ReportType(roomobs.TrackTypeData)
|
||||
tx.ReportRecvBytes(uint32(bytes))
|
||||
tx.ReportRecvPackets(1)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (s *BytesTrackStats) GetTrafficTotals() *TrafficTotals {
|
||||
return &TrafficTotals{
|
||||
At: time.Now(),
|
||||
SendBytes: s.totalSendBytes.Load(),
|
||||
SendMessages: s.totalSendMessages.Load(),
|
||||
RecvBytes: s.totalRecvBytes.Load(),
|
||||
RecvMessages: s.totalRecvMessages.Load(),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *BytesTrackStats) Stop() {
|
||||
s.done.Break()
|
||||
}
|
||||
|
||||
func (s *BytesTrackStats) report() {
|
||||
if recv := s.recv.Swap(0); recv > 0 {
|
||||
packets := s.recvMessages.Swap(0)
|
||||
s.telemetry.TrackStats(
|
||||
StatsKeyForData(s.country, livekit.StreamType_UPSTREAM, s.pID, s.trackID),
|
||||
&livekit.AnalyticsStat{
|
||||
Streams: []*livekit.AnalyticsStream{
|
||||
{
|
||||
PrimaryBytes: recv,
|
||||
PrimaryPackets: packets,
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
if send := s.send.Swap(0); send > 0 {
|
||||
packets := s.sendMessages.Swap(0)
|
||||
s.telemetry.TrackStats(
|
||||
StatsKeyForData(s.country, livekit.StreamType_DOWNSTREAM, s.pID, s.trackID),
|
||||
&livekit.AnalyticsStat{
|
||||
Streams: []*livekit.AnalyticsStream{
|
||||
{
|
||||
PrimaryBytes: send,
|
||||
PrimaryPackets: packets,
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *BytesTrackStats) worker() {
|
||||
ticker := time.NewTicker(5 * time.Second)
|
||||
defer func() {
|
||||
ticker.Stop()
|
||||
s.report()
|
||||
}()
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-s.done.Watch():
|
||||
return
|
||||
case <-ticker.C:
|
||||
s.report()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
type BytesSignalStats struct {
|
||||
BytesTrackStats
|
||||
ctx context.Context
|
||||
|
||||
guard *ReferenceGuard
|
||||
|
||||
participantResolver roomobs.ParticipantReporterResolver
|
||||
trackResolver roomobs.KeyResolver
|
||||
|
||||
mu sync.Mutex
|
||||
ri *livekit.Room
|
||||
pi *livekit.ParticipantInfo
|
||||
stopped chan struct{}
|
||||
}
|
||||
|
||||
func NewBytesSignalStats(
|
||||
ctx context.Context,
|
||||
telemetry TelemetryService,
|
||||
) *BytesSignalStats {
|
||||
projectReporter := telemetry.RoomProjectReporter(ctx)
|
||||
participantReporter, participantReporterResolver := roomobs.DeferredParticipantReporter(projectReporter)
|
||||
trackReporter, trackReporterResolver := participantReporter.WithDeferredTrack()
|
||||
return &BytesSignalStats{
|
||||
BytesTrackStats: BytesTrackStats{
|
||||
telemetry: telemetry,
|
||||
reporter: trackReporter,
|
||||
},
|
||||
ctx: ctx,
|
||||
guard: &ReferenceGuard{},
|
||||
participantResolver: participantReporterResolver,
|
||||
trackResolver: trackReporterResolver,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *BytesSignalStats) ResolveRoom(ri *livekit.Room) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if s.ri == nil && ri.GetSid() != "" {
|
||||
s.ri = &livekit.Room{
|
||||
Sid: ri.Sid,
|
||||
Name: ri.Name,
|
||||
}
|
||||
s.maybeStart()
|
||||
}
|
||||
}
|
||||
|
||||
func (s *BytesSignalStats) ResolveParticipant(pi *livekit.ParticipantInfo) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if s.pi == nil && pi != nil {
|
||||
s.pi = &livekit.ParticipantInfo{
|
||||
Sid: pi.Sid,
|
||||
Identity: pi.Identity,
|
||||
}
|
||||
s.maybeStart()
|
||||
}
|
||||
}
|
||||
|
||||
func (s *BytesSignalStats) Reset() {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if s.stopped != nil {
|
||||
s.done.Break()
|
||||
<-s.stopped
|
||||
s.stopped = nil
|
||||
s.done = core.Fuse{}
|
||||
s.guard = &ReferenceGuard{}
|
||||
}
|
||||
s.ri = nil
|
||||
s.pi = nil
|
||||
|
||||
s.participantResolver.Reset()
|
||||
s.trackResolver.Reset()
|
||||
}
|
||||
|
||||
func (s *BytesSignalStats) maybeStart() {
|
||||
if s.ri == nil || s.pi == nil {
|
||||
return
|
||||
}
|
||||
|
||||
s.pID = livekit.ParticipantID(s.pi.Sid)
|
||||
s.trackID = BytesTrackIDForParticipantID(BytesTrackTypeSignal, s.pID)
|
||||
|
||||
s.participantResolver.Resolve(
|
||||
livekit.RoomName(s.ri.Name),
|
||||
livekit.RoomID(s.ri.Sid),
|
||||
livekit.ParticipantIdentity(s.pi.Identity),
|
||||
livekit.ParticipantID(s.pi.Sid),
|
||||
)
|
||||
s.trackResolver.Resolve(string(s.trackID))
|
||||
|
||||
s.telemetry.ParticipantJoined(s.ctx, s.ri, s.pi, nil, nil, false, s.guard)
|
||||
s.stopped = make(chan struct{})
|
||||
go s.worker()
|
||||
}
|
||||
|
||||
func (s *BytesSignalStats) worker() {
|
||||
s.BytesTrackStats.worker()
|
||||
s.telemetry.ParticipantLeft(s.ctx, s.ri, s.pi, false, s.guard)
|
||||
close(s.stopped)
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
func BytesTrackIDForParticipantID(typ BytesTrackType, participantID livekit.ParticipantID) livekit.TrackID {
|
||||
return livekit.TrackID(fmt.Sprintf("%s%s%s", utils.TrackPrefix, typ, participantID))
|
||||
}
|
||||
@@ -62,7 +62,7 @@ func StatsKeyForData(
|
||||
}
|
||||
}
|
||||
|
||||
func (t *telemetryService) TrackStats(key StatsKey, stat *livekit.AnalyticsStat) {
|
||||
func (t *telemetryService) TrackStats(roomID livekit.RoomID, _roomName livekit.RoomName, key StatsKey, stat *livekit.AnalyticsStat) {
|
||||
t.enqueue(func() {
|
||||
direction := prometheus.Incoming
|
||||
if key.streamType == livekit.StreamType_DOWNSTREAM {
|
||||
@@ -107,7 +107,7 @@ func (t *telemetryService) TrackStats(key StatsKey, stat *livekit.AnalyticsStat)
|
||||
prometheus.IncrementBytes(key.country, direction, retransmitBytes, true)
|
||||
}
|
||||
|
||||
if worker, ok := t.getWorker(key.participantID); ok {
|
||||
if worker, ok := t.getWorker(roomID, key.participantID); ok {
|
||||
worker.OnTrackStat(key.trackID, key.streamType, stat)
|
||||
}
|
||||
})
|
||||
|
||||
+32
-32
@@ -58,7 +58,7 @@ func Test_ParticipantAndRoomDataAreSentWithAnalytics(t *testing.T) {
|
||||
// do
|
||||
packet := 33
|
||||
stat := &livekit.AnalyticsStat{Streams: []*livekit.AnalyticsStream{{PrimaryBytes: uint64(packet)}}}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, ""), stat)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, ""), stat)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -77,7 +77,7 @@ func Test_OnDownstreamPackets(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
room := &livekit.Room{}
|
||||
room := &livekit.Room{Sid: "RoomSid", Name: "RoomName"}
|
||||
partSID := livekit.ParticipantID("part1")
|
||||
clientInfo := &livekit.ClientInfo{Sdk: 2}
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: string(partSID)}
|
||||
@@ -91,7 +91,7 @@ func Test_OnDownstreamPackets(t *testing.T) {
|
||||
trackID := livekit.TrackID("trackID")
|
||||
for i := range packets {
|
||||
stat := &livekit.AnalyticsStat{Streams: []*livekit.AnalyticsStream{{PrimaryBytes: uint64(packets[i]), PrimaryPackets: uint32(1)}}}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID), stat)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID), stat)
|
||||
}
|
||||
|
||||
// flush
|
||||
@@ -111,7 +111,7 @@ func Test_OnDownstreamPackets_SeveralTracks(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
room := &livekit.Room{}
|
||||
room := &livekit.Room{Sid: "RoomSid", Name: "RoomName"}
|
||||
partSID := livekit.ParticipantID("part1")
|
||||
clientInfo := &livekit.ClientInfo{Sdk: 2}
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: string(partSID)}
|
||||
@@ -122,12 +122,12 @@ func Test_OnDownstreamPackets_SeveralTracks(t *testing.T) {
|
||||
packet1 := 33
|
||||
trackID1 := livekit.TrackID("trackID1")
|
||||
stat1 := &livekit.AnalyticsStat{Streams: []*livekit.AnalyticsStream{{PrimaryBytes: uint64(packet1), PrimaryPackets: 1}}}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID1), stat1)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID1), stat1)
|
||||
|
||||
packet2 := 23
|
||||
trackID2 := livekit.TrackID("trackID2")
|
||||
stat2 := &livekit.AnalyticsStat{Streams: []*livekit.AnalyticsStream{{PrimaryBytes: uint64(packet2), PrimaryPackets: 1}}}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID2), stat2)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID2), stat2)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -158,7 +158,7 @@ func Test_OnDownStreamStat(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
room := &livekit.Room{}
|
||||
room := &livekit.Room{Sid: "RoomSid", Name: "RoomName"}
|
||||
partSID := livekit.ParticipantID("part1")
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: string(partSID)}
|
||||
guard := &telemetry.ReferenceGuard{}
|
||||
@@ -179,7 +179,7 @@ func Test_OnDownStreamStat(t *testing.T) {
|
||||
},
|
||||
}
|
||||
trackID := livekit.TrackID("trackID1")
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID), stat1)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID), stat1)
|
||||
|
||||
stat2 := &livekit.AnalyticsStat{
|
||||
Streams: []*livekit.AnalyticsStream{
|
||||
@@ -195,7 +195,7 @@ func Test_OnDownStreamStat(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID), stat2)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID), stat2)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -218,7 +218,7 @@ func Test_PacketLostDiffShouldBeSentToTelemetry(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
room := &livekit.Room{}
|
||||
room := &livekit.Room{Sid: "RoomSid", Name: "RoomName"}
|
||||
partSID := livekit.ParticipantID("part1")
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: string(partSID)}
|
||||
guard := &telemetry.ReferenceGuard{}
|
||||
@@ -235,7 +235,7 @@ func Test_PacketLostDiffShouldBeSentToTelemetry(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID), stat1) // there should be bytes reported so that stats are sent
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID), stat1) // there should be bytes reported so that stats are sent
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -249,7 +249,7 @@ func Test_PacketLostDiffShouldBeSentToTelemetry(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID), stat2)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID), stat2)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -271,7 +271,7 @@ func Test_OnDownStreamRTCP_SeveralTracks(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
room := &livekit.Room{}
|
||||
room := &livekit.Room{Sid: "RoomSid", Name: "RoomName"}
|
||||
partSID := livekit.ParticipantID("part1")
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: string(partSID)}
|
||||
guard := &telemetry.ReferenceGuard{}
|
||||
@@ -288,7 +288,7 @@ func Test_OnDownStreamRTCP_SeveralTracks(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID1), stat1) // there should be bytes reported so that stats are sent
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID1), stat1) // there should be bytes reported so that stats are sent
|
||||
|
||||
stat2 := &livekit.AnalyticsStat{
|
||||
Streams: []*livekit.AnalyticsStream{
|
||||
@@ -299,7 +299,7 @@ func Test_OnDownStreamRTCP_SeveralTracks(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID1), stat2)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID1), stat2)
|
||||
|
||||
stat3 := &livekit.AnalyticsStat{
|
||||
Streams: []*livekit.AnalyticsStream{
|
||||
@@ -310,7 +310,7 @@ func Test_OnDownStreamRTCP_SeveralTracks(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID2), stat3)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, trackID2), stat3)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -341,7 +341,7 @@ func Test_OnUpstreamStat(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
room := &livekit.Room{}
|
||||
room := &livekit.Room{Sid: "RoomSid", Name: "RoomName"}
|
||||
partSID := livekit.ParticipantID("part1")
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: string(partSID)}
|
||||
guard := &telemetry.ReferenceGuard{}
|
||||
@@ -364,7 +364,7 @@ func Test_OnUpstreamStat(t *testing.T) {
|
||||
}
|
||||
trackID := livekit.TrackID("trackID")
|
||||
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID), stat1)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID), stat1)
|
||||
|
||||
stat2 := &livekit.AnalyticsStat{
|
||||
Streams: []*livekit.AnalyticsStream{
|
||||
@@ -380,7 +380,7 @@ func Test_OnUpstreamStat(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID), stat2)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID), stat2)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -403,7 +403,7 @@ func Test_OnUpstreamRTCP_SeveralTracks(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
room := &livekit.Room{}
|
||||
room := &livekit.Room{Sid: "RoomSid", Name: "RoomName"}
|
||||
partSID := livekit.ParticipantID("part1")
|
||||
identity := livekit.ParticipantIdentity("part1Identity")
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: string(partSID), Identity: string(identity)}
|
||||
@@ -424,8 +424,8 @@ func Test_OnUpstreamRTCP_SeveralTracks(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID1), stat1)
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID2), stat1) // using same buffer is not correct but for test it is fine
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID1), stat1)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID2), stat1) // using same buffer is not correct but for test it is fine
|
||||
|
||||
// do
|
||||
totalBytes++
|
||||
@@ -439,7 +439,7 @@ func Test_OnUpstreamRTCP_SeveralTracks(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID1), stat2)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID1), stat2)
|
||||
|
||||
stat3 := &livekit.AnalyticsStat{
|
||||
Streams: []*livekit.AnalyticsStream{
|
||||
@@ -450,7 +450,7 @@ func Test_OnUpstreamRTCP_SeveralTracks(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID2), stat3)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID2), stat3)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -479,7 +479,7 @@ func Test_OnUpstreamRTCP_SeveralTracks(t *testing.T) {
|
||||
require.True(t, found2)
|
||||
|
||||
// remove 1 track - track stats were flushed above, so no more calls to SendStats
|
||||
fixture.sut.TrackUnpublished(context.Background(), partSID, identity, &livekit.TrackInfo{Sid: string(trackID2)}, true)
|
||||
fixture.sut.TrackUnpublished(context.Background(), livekit.RoomID(room.Sid), livekit.RoomName(room.Name), partSID, identity, &livekit.TrackInfo{Sid: string(trackID2)}, true)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -509,7 +509,7 @@ func Test_AddUpTrack(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
room := &livekit.Room{}
|
||||
room := &livekit.Room{Sid: "RoomSid", Name: "RoomName"}
|
||||
partSID := livekit.ParticipantID("part1")
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: string(partSID)}
|
||||
guard := &telemetry.ReferenceGuard{}
|
||||
@@ -528,7 +528,7 @@ func Test_AddUpTrack(t *testing.T) {
|
||||
},
|
||||
}
|
||||
trackID := livekit.TrackID("trackID")
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID), stat)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID), stat)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -547,7 +547,7 @@ func Test_AddUpTrack_SeveralBuffers_Simulcast(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
room := &livekit.Room{}
|
||||
room := &livekit.Room{Sid: "RoomSid", Name: "RoomName"}
|
||||
partSID := livekit.ParticipantID("part1")
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: string(partSID)}
|
||||
guard := &telemetry.ReferenceGuard{}
|
||||
@@ -567,7 +567,7 @@ func Test_AddUpTrack_SeveralBuffers_Simulcast(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID), stat1)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, trackID), stat1)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
@@ -587,7 +587,7 @@ func Test_BothDownstreamAndUpstreamStatsAreSentTogether(t *testing.T) {
|
||||
fixture := createFixture()
|
||||
|
||||
// prepare
|
||||
room := &livekit.Room{}
|
||||
room := &livekit.Room{Sid: "RoomSid", Name: "RoomName"}
|
||||
partSID := livekit.ParticipantID("part1")
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: string(partSID)}
|
||||
guard := &telemetry.ReferenceGuard{}
|
||||
@@ -603,7 +603,7 @@ func Test_BothDownstreamAndUpstreamStatsAreSentTogether(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, "trackID"), stat1)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_UPSTREAM, partSID, "trackID"), stat1)
|
||||
// downstream bytes
|
||||
stat2 := &livekit.AnalyticsStat{
|
||||
Streams: []*livekit.AnalyticsStream{
|
||||
@@ -613,7 +613,7 @@ func Test_BothDownstreamAndUpstreamStatsAreSentTogether(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
fixture.sut.TrackStats(telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, "trackID1"), stat2)
|
||||
fixture.sut.TrackStats(livekit.RoomID(room.Sid), livekit.RoomName(room.Name), telemetry.StatsKeyForData("test", livekit.StreamType_DOWNSTREAM, partSID, "trackID1"), stat2)
|
||||
|
||||
// flush
|
||||
fixture.flush()
|
||||
|
||||
@@ -169,119 +169,147 @@ type FakeTelemetryService struct {
|
||||
arg1 context.Context
|
||||
arg2 []*livekit.AnalyticsStat
|
||||
}
|
||||
TrackMaxSubscribedVideoQualityStub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo, mime.MimeType, livekit.VideoQuality)
|
||||
TrackMaxSubscribedVideoQualityStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo, mime.MimeType, livekit.VideoQuality)
|
||||
trackMaxSubscribedVideoQualityMutex sync.RWMutex
|
||||
trackMaxSubscribedVideoQualityArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
arg4 mime.MimeType
|
||||
arg5 livekit.VideoQuality
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
arg6 mime.MimeType
|
||||
arg7 livekit.VideoQuality
|
||||
}
|
||||
TrackMutedStub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo)
|
||||
TrackMutedStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo)
|
||||
trackMutedMutex sync.RWMutex
|
||||
trackMutedArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
}
|
||||
TrackPublishRTPStatsStub func(context.Context, livekit.ParticipantID, livekit.TrackID, mime.MimeType, int, *livekit.RTPStats)
|
||||
TrackPublishRTPStatsStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.TrackID, mime.MimeType, int, *livekit.RTPStats)
|
||||
trackPublishRTPStatsMutex sync.RWMutex
|
||||
trackPublishRTPStatsArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.TrackID
|
||||
arg4 mime.MimeType
|
||||
arg5 int
|
||||
arg6 *livekit.RTPStats
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.TrackID
|
||||
arg6 mime.MimeType
|
||||
arg7 int
|
||||
arg8 *livekit.RTPStats
|
||||
}
|
||||
TrackPublishRequestedStub func(context.Context, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo)
|
||||
TrackPublishRequestedStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo)
|
||||
trackPublishRequestedMutex sync.RWMutex
|
||||
trackPublishRequestedArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.ParticipantIdentity
|
||||
arg4 *livekit.TrackInfo
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.ParticipantIdentity
|
||||
arg6 *livekit.TrackInfo
|
||||
}
|
||||
TrackPublishedStub func(context.Context, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool)
|
||||
TrackPublishedStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool)
|
||||
trackPublishedMutex sync.RWMutex
|
||||
trackPublishedArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.ParticipantIdentity
|
||||
arg4 *livekit.TrackInfo
|
||||
arg5 bool
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.ParticipantIdentity
|
||||
arg6 *livekit.TrackInfo
|
||||
arg7 bool
|
||||
}
|
||||
TrackPublishedUpdateStub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo)
|
||||
TrackPublishedUpdateStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo)
|
||||
trackPublishedUpdateMutex sync.RWMutex
|
||||
trackPublishedUpdateArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
}
|
||||
TrackStatsStub func(telemetry.StatsKey, *livekit.AnalyticsStat)
|
||||
TrackStatsStub func(livekit.RoomID, livekit.RoomName, telemetry.StatsKey, *livekit.AnalyticsStat)
|
||||
trackStatsMutex sync.RWMutex
|
||||
trackStatsArgsForCall []struct {
|
||||
arg1 telemetry.StatsKey
|
||||
arg2 *livekit.AnalyticsStat
|
||||
arg1 livekit.RoomID
|
||||
arg2 livekit.RoomName
|
||||
arg3 telemetry.StatsKey
|
||||
arg4 *livekit.AnalyticsStat
|
||||
}
|
||||
TrackSubscribeFailedStub func(context.Context, livekit.ParticipantID, livekit.TrackID, error, bool)
|
||||
TrackSubscribeFailedStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.TrackID, error, bool)
|
||||
trackSubscribeFailedMutex sync.RWMutex
|
||||
trackSubscribeFailedArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.TrackID
|
||||
arg4 error
|
||||
arg5 bool
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.TrackID
|
||||
arg6 error
|
||||
arg7 bool
|
||||
}
|
||||
TrackSubscribeRTPStatsStub func(context.Context, livekit.ParticipantID, livekit.TrackID, mime.MimeType, *livekit.RTPStats)
|
||||
TrackSubscribeRTPStatsStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.TrackID, mime.MimeType, *livekit.RTPStats)
|
||||
trackSubscribeRTPStatsMutex sync.RWMutex
|
||||
trackSubscribeRTPStatsArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.TrackID
|
||||
arg4 mime.MimeType
|
||||
arg5 *livekit.RTPStats
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.TrackID
|
||||
arg6 mime.MimeType
|
||||
arg7 *livekit.RTPStats
|
||||
}
|
||||
TrackSubscribeRequestedStub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo)
|
||||
TrackSubscribeRequestedStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo)
|
||||
trackSubscribeRequestedMutex sync.RWMutex
|
||||
trackSubscribeRequestedArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
}
|
||||
TrackSubscribedStub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo, *livekit.ParticipantInfo, bool)
|
||||
TrackSubscribedStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo, *livekit.ParticipantInfo, bool)
|
||||
trackSubscribedMutex sync.RWMutex
|
||||
trackSubscribedArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
arg4 *livekit.ParticipantInfo
|
||||
arg5 bool
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
arg6 *livekit.ParticipantInfo
|
||||
arg7 bool
|
||||
}
|
||||
TrackUnmutedStub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo)
|
||||
TrackUnmutedStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo)
|
||||
trackUnmutedMutex sync.RWMutex
|
||||
trackUnmutedArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
}
|
||||
TrackUnpublishedStub func(context.Context, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool)
|
||||
TrackUnpublishedStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool)
|
||||
trackUnpublishedMutex sync.RWMutex
|
||||
trackUnpublishedArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.ParticipantIdentity
|
||||
arg4 *livekit.TrackInfo
|
||||
arg5 bool
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.ParticipantIdentity
|
||||
arg6 *livekit.TrackInfo
|
||||
arg7 bool
|
||||
}
|
||||
TrackUnsubscribedStub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo, bool)
|
||||
TrackUnsubscribedStub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo, bool)
|
||||
trackUnsubscribedMutex sync.RWMutex
|
||||
trackUnsubscribedArgsForCall []struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
arg4 bool
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
arg6 bool
|
||||
}
|
||||
WebhookStub func(context.Context, *livekit.WebhookInfo)
|
||||
webhookMutex sync.RWMutex
|
||||
@@ -1092,20 +1120,22 @@ func (fake *FakeTelemetryService) SendStatsArgsForCall(i int) (context.Context,
|
||||
return argsForCall.arg1, argsForCall.arg2
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackMaxSubscribedVideoQuality(arg1 context.Context, arg2 livekit.ParticipantID, arg3 *livekit.TrackInfo, arg4 mime.MimeType, arg5 livekit.VideoQuality) {
|
||||
func (fake *FakeTelemetryService) TrackMaxSubscribedVideoQuality(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 *livekit.TrackInfo, arg6 mime.MimeType, arg7 livekit.VideoQuality) {
|
||||
fake.trackMaxSubscribedVideoQualityMutex.Lock()
|
||||
fake.trackMaxSubscribedVideoQualityArgsForCall = append(fake.trackMaxSubscribedVideoQualityArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
arg4 mime.MimeType
|
||||
arg5 livekit.VideoQuality
|
||||
}{arg1, arg2, arg3, arg4, arg5})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
arg6 mime.MimeType
|
||||
arg7 livekit.VideoQuality
|
||||
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
stub := fake.TrackMaxSubscribedVideoQualityStub
|
||||
fake.recordInvocation("TrackMaxSubscribedVideoQuality", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||
fake.recordInvocation("TrackMaxSubscribedVideoQuality", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
fake.trackMaxSubscribedVideoQualityMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackMaxSubscribedVideoQualityStub(arg1, arg2, arg3, arg4, arg5)
|
||||
fake.TrackMaxSubscribedVideoQualityStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1115,31 +1145,33 @@ func (fake *FakeTelemetryService) TrackMaxSubscribedVideoQualityCallCount() int
|
||||
return len(fake.trackMaxSubscribedVideoQualityArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackMaxSubscribedVideoQualityCalls(stub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo, mime.MimeType, livekit.VideoQuality)) {
|
||||
func (fake *FakeTelemetryService) TrackMaxSubscribedVideoQualityCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo, mime.MimeType, livekit.VideoQuality)) {
|
||||
fake.trackMaxSubscribedVideoQualityMutex.Lock()
|
||||
defer fake.trackMaxSubscribedVideoQualityMutex.Unlock()
|
||||
fake.TrackMaxSubscribedVideoQualityStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackMaxSubscribedVideoQualityArgsForCall(i int) (context.Context, livekit.ParticipantID, *livekit.TrackInfo, mime.MimeType, livekit.VideoQuality) {
|
||||
func (fake *FakeTelemetryService) TrackMaxSubscribedVideoQualityArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo, mime.MimeType, livekit.VideoQuality) {
|
||||
fake.trackMaxSubscribedVideoQualityMutex.RLock()
|
||||
defer fake.trackMaxSubscribedVideoQualityMutex.RUnlock()
|
||||
argsForCall := fake.trackMaxSubscribedVideoQualityArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6, argsForCall.arg7
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackMuted(arg1 context.Context, arg2 livekit.ParticipantID, arg3 *livekit.TrackInfo) {
|
||||
func (fake *FakeTelemetryService) TrackMuted(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 *livekit.TrackInfo) {
|
||||
fake.trackMutedMutex.Lock()
|
||||
fake.trackMutedArgsForCall = append(fake.trackMutedArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
}{arg1, arg2, arg3})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
}{arg1, arg2, arg3, arg4, arg5})
|
||||
stub := fake.TrackMutedStub
|
||||
fake.recordInvocation("TrackMuted", []interface{}{arg1, arg2, arg3})
|
||||
fake.recordInvocation("TrackMuted", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||
fake.trackMutedMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackMutedStub(arg1, arg2, arg3)
|
||||
fake.TrackMutedStub(arg1, arg2, arg3, arg4, arg5)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1149,34 +1181,36 @@ func (fake *FakeTelemetryService) TrackMutedCallCount() int {
|
||||
return len(fake.trackMutedArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackMutedCalls(stub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo)) {
|
||||
func (fake *FakeTelemetryService) TrackMutedCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo)) {
|
||||
fake.trackMutedMutex.Lock()
|
||||
defer fake.trackMutedMutex.Unlock()
|
||||
fake.TrackMutedStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackMutedArgsForCall(i int) (context.Context, livekit.ParticipantID, *livekit.TrackInfo) {
|
||||
func (fake *FakeTelemetryService) TrackMutedArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo) {
|
||||
fake.trackMutedMutex.RLock()
|
||||
defer fake.trackMutedMutex.RUnlock()
|
||||
argsForCall := fake.trackMutedArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishRTPStats(arg1 context.Context, arg2 livekit.ParticipantID, arg3 livekit.TrackID, arg4 mime.MimeType, arg5 int, arg6 *livekit.RTPStats) {
|
||||
func (fake *FakeTelemetryService) TrackPublishRTPStats(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 livekit.TrackID, arg6 mime.MimeType, arg7 int, arg8 *livekit.RTPStats) {
|
||||
fake.trackPublishRTPStatsMutex.Lock()
|
||||
fake.trackPublishRTPStatsArgsForCall = append(fake.trackPublishRTPStatsArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.TrackID
|
||||
arg4 mime.MimeType
|
||||
arg5 int
|
||||
arg6 *livekit.RTPStats
|
||||
}{arg1, arg2, arg3, arg4, arg5, arg6})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.TrackID
|
||||
arg6 mime.MimeType
|
||||
arg7 int
|
||||
arg8 *livekit.RTPStats
|
||||
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8})
|
||||
stub := fake.TrackPublishRTPStatsStub
|
||||
fake.recordInvocation("TrackPublishRTPStats", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6})
|
||||
fake.recordInvocation("TrackPublishRTPStats", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8})
|
||||
fake.trackPublishRTPStatsMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackPublishRTPStatsStub(arg1, arg2, arg3, arg4, arg5, arg6)
|
||||
fake.TrackPublishRTPStatsStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1186,32 +1220,34 @@ func (fake *FakeTelemetryService) TrackPublishRTPStatsCallCount() int {
|
||||
return len(fake.trackPublishRTPStatsArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishRTPStatsCalls(stub func(context.Context, livekit.ParticipantID, livekit.TrackID, mime.MimeType, int, *livekit.RTPStats)) {
|
||||
func (fake *FakeTelemetryService) TrackPublishRTPStatsCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.TrackID, mime.MimeType, int, *livekit.RTPStats)) {
|
||||
fake.trackPublishRTPStatsMutex.Lock()
|
||||
defer fake.trackPublishRTPStatsMutex.Unlock()
|
||||
fake.TrackPublishRTPStatsStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishRTPStatsArgsForCall(i int) (context.Context, livekit.ParticipantID, livekit.TrackID, mime.MimeType, int, *livekit.RTPStats) {
|
||||
func (fake *FakeTelemetryService) TrackPublishRTPStatsArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.TrackID, mime.MimeType, int, *livekit.RTPStats) {
|
||||
fake.trackPublishRTPStatsMutex.RLock()
|
||||
defer fake.trackPublishRTPStatsMutex.RUnlock()
|
||||
argsForCall := fake.trackPublishRTPStatsArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6, argsForCall.arg7, argsForCall.arg8
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishRequested(arg1 context.Context, arg2 livekit.ParticipantID, arg3 livekit.ParticipantIdentity, arg4 *livekit.TrackInfo) {
|
||||
func (fake *FakeTelemetryService) TrackPublishRequested(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 livekit.ParticipantIdentity, arg6 *livekit.TrackInfo) {
|
||||
fake.trackPublishRequestedMutex.Lock()
|
||||
fake.trackPublishRequestedArgsForCall = append(fake.trackPublishRequestedArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.ParticipantIdentity
|
||||
arg4 *livekit.TrackInfo
|
||||
}{arg1, arg2, arg3, arg4})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.ParticipantIdentity
|
||||
arg6 *livekit.TrackInfo
|
||||
}{arg1, arg2, arg3, arg4, arg5, arg6})
|
||||
stub := fake.TrackPublishRequestedStub
|
||||
fake.recordInvocation("TrackPublishRequested", []interface{}{arg1, arg2, arg3, arg4})
|
||||
fake.recordInvocation("TrackPublishRequested", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6})
|
||||
fake.trackPublishRequestedMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackPublishRequestedStub(arg1, arg2, arg3, arg4)
|
||||
fake.TrackPublishRequestedStub(arg1, arg2, arg3, arg4, arg5, arg6)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1221,33 +1257,35 @@ func (fake *FakeTelemetryService) TrackPublishRequestedCallCount() int {
|
||||
return len(fake.trackPublishRequestedArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishRequestedCalls(stub func(context.Context, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo)) {
|
||||
func (fake *FakeTelemetryService) TrackPublishRequestedCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo)) {
|
||||
fake.trackPublishRequestedMutex.Lock()
|
||||
defer fake.trackPublishRequestedMutex.Unlock()
|
||||
fake.TrackPublishRequestedStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishRequestedArgsForCall(i int) (context.Context, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo) {
|
||||
func (fake *FakeTelemetryService) TrackPublishRequestedArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo) {
|
||||
fake.trackPublishRequestedMutex.RLock()
|
||||
defer fake.trackPublishRequestedMutex.RUnlock()
|
||||
argsForCall := fake.trackPublishRequestedArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublished(arg1 context.Context, arg2 livekit.ParticipantID, arg3 livekit.ParticipantIdentity, arg4 *livekit.TrackInfo, arg5 bool) {
|
||||
func (fake *FakeTelemetryService) TrackPublished(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 livekit.ParticipantIdentity, arg6 *livekit.TrackInfo, arg7 bool) {
|
||||
fake.trackPublishedMutex.Lock()
|
||||
fake.trackPublishedArgsForCall = append(fake.trackPublishedArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.ParticipantIdentity
|
||||
arg4 *livekit.TrackInfo
|
||||
arg5 bool
|
||||
}{arg1, arg2, arg3, arg4, arg5})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.ParticipantIdentity
|
||||
arg6 *livekit.TrackInfo
|
||||
arg7 bool
|
||||
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
stub := fake.TrackPublishedStub
|
||||
fake.recordInvocation("TrackPublished", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||
fake.recordInvocation("TrackPublished", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
fake.trackPublishedMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackPublishedStub(arg1, arg2, arg3, arg4, arg5)
|
||||
fake.TrackPublishedStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1257,31 +1295,33 @@ func (fake *FakeTelemetryService) TrackPublishedCallCount() int {
|
||||
return len(fake.trackPublishedArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishedCalls(stub func(context.Context, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool)) {
|
||||
func (fake *FakeTelemetryService) TrackPublishedCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool)) {
|
||||
fake.trackPublishedMutex.Lock()
|
||||
defer fake.trackPublishedMutex.Unlock()
|
||||
fake.TrackPublishedStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishedArgsForCall(i int) (context.Context, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool) {
|
||||
func (fake *FakeTelemetryService) TrackPublishedArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool) {
|
||||
fake.trackPublishedMutex.RLock()
|
||||
defer fake.trackPublishedMutex.RUnlock()
|
||||
argsForCall := fake.trackPublishedArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6, argsForCall.arg7
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishedUpdate(arg1 context.Context, arg2 livekit.ParticipantID, arg3 *livekit.TrackInfo) {
|
||||
func (fake *FakeTelemetryService) TrackPublishedUpdate(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 *livekit.TrackInfo) {
|
||||
fake.trackPublishedUpdateMutex.Lock()
|
||||
fake.trackPublishedUpdateArgsForCall = append(fake.trackPublishedUpdateArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
}{arg1, arg2, arg3})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
}{arg1, arg2, arg3, arg4, arg5})
|
||||
stub := fake.TrackPublishedUpdateStub
|
||||
fake.recordInvocation("TrackPublishedUpdate", []interface{}{arg1, arg2, arg3})
|
||||
fake.recordInvocation("TrackPublishedUpdate", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||
fake.trackPublishedUpdateMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackPublishedUpdateStub(arg1, arg2, arg3)
|
||||
fake.TrackPublishedUpdateStub(arg1, arg2, arg3, arg4, arg5)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1291,30 +1331,32 @@ func (fake *FakeTelemetryService) TrackPublishedUpdateCallCount() int {
|
||||
return len(fake.trackPublishedUpdateArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishedUpdateCalls(stub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo)) {
|
||||
func (fake *FakeTelemetryService) TrackPublishedUpdateCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo)) {
|
||||
fake.trackPublishedUpdateMutex.Lock()
|
||||
defer fake.trackPublishedUpdateMutex.Unlock()
|
||||
fake.TrackPublishedUpdateStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackPublishedUpdateArgsForCall(i int) (context.Context, livekit.ParticipantID, *livekit.TrackInfo) {
|
||||
func (fake *FakeTelemetryService) TrackPublishedUpdateArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo) {
|
||||
fake.trackPublishedUpdateMutex.RLock()
|
||||
defer fake.trackPublishedUpdateMutex.RUnlock()
|
||||
argsForCall := fake.trackPublishedUpdateArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackStats(arg1 telemetry.StatsKey, arg2 *livekit.AnalyticsStat) {
|
||||
func (fake *FakeTelemetryService) TrackStats(arg1 livekit.RoomID, arg2 livekit.RoomName, arg3 telemetry.StatsKey, arg4 *livekit.AnalyticsStat) {
|
||||
fake.trackStatsMutex.Lock()
|
||||
fake.trackStatsArgsForCall = append(fake.trackStatsArgsForCall, struct {
|
||||
arg1 telemetry.StatsKey
|
||||
arg2 *livekit.AnalyticsStat
|
||||
}{arg1, arg2})
|
||||
arg1 livekit.RoomID
|
||||
arg2 livekit.RoomName
|
||||
arg3 telemetry.StatsKey
|
||||
arg4 *livekit.AnalyticsStat
|
||||
}{arg1, arg2, arg3, arg4})
|
||||
stub := fake.TrackStatsStub
|
||||
fake.recordInvocation("TrackStats", []interface{}{arg1, arg2})
|
||||
fake.recordInvocation("TrackStats", []interface{}{arg1, arg2, arg3, arg4})
|
||||
fake.trackStatsMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackStatsStub(arg1, arg2)
|
||||
fake.TrackStatsStub(arg1, arg2, arg3, arg4)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1324,33 +1366,35 @@ func (fake *FakeTelemetryService) TrackStatsCallCount() int {
|
||||
return len(fake.trackStatsArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackStatsCalls(stub func(telemetry.StatsKey, *livekit.AnalyticsStat)) {
|
||||
func (fake *FakeTelemetryService) TrackStatsCalls(stub func(livekit.RoomID, livekit.RoomName, telemetry.StatsKey, *livekit.AnalyticsStat)) {
|
||||
fake.trackStatsMutex.Lock()
|
||||
defer fake.trackStatsMutex.Unlock()
|
||||
fake.TrackStatsStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackStatsArgsForCall(i int) (telemetry.StatsKey, *livekit.AnalyticsStat) {
|
||||
func (fake *FakeTelemetryService) TrackStatsArgsForCall(i int) (livekit.RoomID, livekit.RoomName, telemetry.StatsKey, *livekit.AnalyticsStat) {
|
||||
fake.trackStatsMutex.RLock()
|
||||
defer fake.trackStatsMutex.RUnlock()
|
||||
argsForCall := fake.trackStatsArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribeFailed(arg1 context.Context, arg2 livekit.ParticipantID, arg3 livekit.TrackID, arg4 error, arg5 bool) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribeFailed(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 livekit.TrackID, arg6 error, arg7 bool) {
|
||||
fake.trackSubscribeFailedMutex.Lock()
|
||||
fake.trackSubscribeFailedArgsForCall = append(fake.trackSubscribeFailedArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.TrackID
|
||||
arg4 error
|
||||
arg5 bool
|
||||
}{arg1, arg2, arg3, arg4, arg5})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.TrackID
|
||||
arg6 error
|
||||
arg7 bool
|
||||
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
stub := fake.TrackSubscribeFailedStub
|
||||
fake.recordInvocation("TrackSubscribeFailed", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||
fake.recordInvocation("TrackSubscribeFailed", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
fake.trackSubscribeFailedMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackSubscribeFailedStub(arg1, arg2, arg3, arg4, arg5)
|
||||
fake.TrackSubscribeFailedStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1360,33 +1404,35 @@ func (fake *FakeTelemetryService) TrackSubscribeFailedCallCount() int {
|
||||
return len(fake.trackSubscribeFailedArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribeFailedCalls(stub func(context.Context, livekit.ParticipantID, livekit.TrackID, error, bool)) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribeFailedCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.TrackID, error, bool)) {
|
||||
fake.trackSubscribeFailedMutex.Lock()
|
||||
defer fake.trackSubscribeFailedMutex.Unlock()
|
||||
fake.TrackSubscribeFailedStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribeFailedArgsForCall(i int) (context.Context, livekit.ParticipantID, livekit.TrackID, error, bool) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribeFailedArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.TrackID, error, bool) {
|
||||
fake.trackSubscribeFailedMutex.RLock()
|
||||
defer fake.trackSubscribeFailedMutex.RUnlock()
|
||||
argsForCall := fake.trackSubscribeFailedArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6, argsForCall.arg7
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRTPStats(arg1 context.Context, arg2 livekit.ParticipantID, arg3 livekit.TrackID, arg4 mime.MimeType, arg5 *livekit.RTPStats) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRTPStats(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 livekit.TrackID, arg6 mime.MimeType, arg7 *livekit.RTPStats) {
|
||||
fake.trackSubscribeRTPStatsMutex.Lock()
|
||||
fake.trackSubscribeRTPStatsArgsForCall = append(fake.trackSubscribeRTPStatsArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.TrackID
|
||||
arg4 mime.MimeType
|
||||
arg5 *livekit.RTPStats
|
||||
}{arg1, arg2, arg3, arg4, arg5})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.TrackID
|
||||
arg6 mime.MimeType
|
||||
arg7 *livekit.RTPStats
|
||||
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
stub := fake.TrackSubscribeRTPStatsStub
|
||||
fake.recordInvocation("TrackSubscribeRTPStats", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||
fake.recordInvocation("TrackSubscribeRTPStats", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
fake.trackSubscribeRTPStatsMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackSubscribeRTPStatsStub(arg1, arg2, arg3, arg4, arg5)
|
||||
fake.TrackSubscribeRTPStatsStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1396,31 +1442,33 @@ func (fake *FakeTelemetryService) TrackSubscribeRTPStatsCallCount() int {
|
||||
return len(fake.trackSubscribeRTPStatsArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRTPStatsCalls(stub func(context.Context, livekit.ParticipantID, livekit.TrackID, mime.MimeType, *livekit.RTPStats)) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRTPStatsCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.TrackID, mime.MimeType, *livekit.RTPStats)) {
|
||||
fake.trackSubscribeRTPStatsMutex.Lock()
|
||||
defer fake.trackSubscribeRTPStatsMutex.Unlock()
|
||||
fake.TrackSubscribeRTPStatsStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRTPStatsArgsForCall(i int) (context.Context, livekit.ParticipantID, livekit.TrackID, mime.MimeType, *livekit.RTPStats) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRTPStatsArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.TrackID, mime.MimeType, *livekit.RTPStats) {
|
||||
fake.trackSubscribeRTPStatsMutex.RLock()
|
||||
defer fake.trackSubscribeRTPStatsMutex.RUnlock()
|
||||
argsForCall := fake.trackSubscribeRTPStatsArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6, argsForCall.arg7
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRequested(arg1 context.Context, arg2 livekit.ParticipantID, arg3 *livekit.TrackInfo) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRequested(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 *livekit.TrackInfo) {
|
||||
fake.trackSubscribeRequestedMutex.Lock()
|
||||
fake.trackSubscribeRequestedArgsForCall = append(fake.trackSubscribeRequestedArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
}{arg1, arg2, arg3})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
}{arg1, arg2, arg3, arg4, arg5})
|
||||
stub := fake.TrackSubscribeRequestedStub
|
||||
fake.recordInvocation("TrackSubscribeRequested", []interface{}{arg1, arg2, arg3})
|
||||
fake.recordInvocation("TrackSubscribeRequested", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||
fake.trackSubscribeRequestedMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackSubscribeRequestedStub(arg1, arg2, arg3)
|
||||
fake.TrackSubscribeRequestedStub(arg1, arg2, arg3, arg4, arg5)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1430,33 +1478,35 @@ func (fake *FakeTelemetryService) TrackSubscribeRequestedCallCount() int {
|
||||
return len(fake.trackSubscribeRequestedArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRequestedCalls(stub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo)) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRequestedCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo)) {
|
||||
fake.trackSubscribeRequestedMutex.Lock()
|
||||
defer fake.trackSubscribeRequestedMutex.Unlock()
|
||||
fake.TrackSubscribeRequestedStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRequestedArgsForCall(i int) (context.Context, livekit.ParticipantID, *livekit.TrackInfo) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribeRequestedArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo) {
|
||||
fake.trackSubscribeRequestedMutex.RLock()
|
||||
defer fake.trackSubscribeRequestedMutex.RUnlock()
|
||||
argsForCall := fake.trackSubscribeRequestedArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribed(arg1 context.Context, arg2 livekit.ParticipantID, arg3 *livekit.TrackInfo, arg4 *livekit.ParticipantInfo, arg5 bool) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribed(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 *livekit.TrackInfo, arg6 *livekit.ParticipantInfo, arg7 bool) {
|
||||
fake.trackSubscribedMutex.Lock()
|
||||
fake.trackSubscribedArgsForCall = append(fake.trackSubscribedArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
arg4 *livekit.ParticipantInfo
|
||||
arg5 bool
|
||||
}{arg1, arg2, arg3, arg4, arg5})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
arg6 *livekit.ParticipantInfo
|
||||
arg7 bool
|
||||
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
stub := fake.TrackSubscribedStub
|
||||
fake.recordInvocation("TrackSubscribed", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||
fake.recordInvocation("TrackSubscribed", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
fake.trackSubscribedMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackSubscribedStub(arg1, arg2, arg3, arg4, arg5)
|
||||
fake.TrackSubscribedStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1466,31 +1516,33 @@ func (fake *FakeTelemetryService) TrackSubscribedCallCount() int {
|
||||
return len(fake.trackSubscribedArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribedCalls(stub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo, *livekit.ParticipantInfo, bool)) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribedCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo, *livekit.ParticipantInfo, bool)) {
|
||||
fake.trackSubscribedMutex.Lock()
|
||||
defer fake.trackSubscribedMutex.Unlock()
|
||||
fake.TrackSubscribedStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackSubscribedArgsForCall(i int) (context.Context, livekit.ParticipantID, *livekit.TrackInfo, *livekit.ParticipantInfo, bool) {
|
||||
func (fake *FakeTelemetryService) TrackSubscribedArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo, *livekit.ParticipantInfo, bool) {
|
||||
fake.trackSubscribedMutex.RLock()
|
||||
defer fake.trackSubscribedMutex.RUnlock()
|
||||
argsForCall := fake.trackSubscribedArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6, argsForCall.arg7
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackUnmuted(arg1 context.Context, arg2 livekit.ParticipantID, arg3 *livekit.TrackInfo) {
|
||||
func (fake *FakeTelemetryService) TrackUnmuted(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 *livekit.TrackInfo) {
|
||||
fake.trackUnmutedMutex.Lock()
|
||||
fake.trackUnmutedArgsForCall = append(fake.trackUnmutedArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
}{arg1, arg2, arg3})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
}{arg1, arg2, arg3, arg4, arg5})
|
||||
stub := fake.TrackUnmutedStub
|
||||
fake.recordInvocation("TrackUnmuted", []interface{}{arg1, arg2, arg3})
|
||||
fake.recordInvocation("TrackUnmuted", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||
fake.trackUnmutedMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackUnmutedStub(arg1, arg2, arg3)
|
||||
fake.TrackUnmutedStub(arg1, arg2, arg3, arg4, arg5)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1500,33 +1552,35 @@ func (fake *FakeTelemetryService) TrackUnmutedCallCount() int {
|
||||
return len(fake.trackUnmutedArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackUnmutedCalls(stub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo)) {
|
||||
func (fake *FakeTelemetryService) TrackUnmutedCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo)) {
|
||||
fake.trackUnmutedMutex.Lock()
|
||||
defer fake.trackUnmutedMutex.Unlock()
|
||||
fake.TrackUnmutedStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackUnmutedArgsForCall(i int) (context.Context, livekit.ParticipantID, *livekit.TrackInfo) {
|
||||
func (fake *FakeTelemetryService) TrackUnmutedArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo) {
|
||||
fake.trackUnmutedMutex.RLock()
|
||||
defer fake.trackUnmutedMutex.RUnlock()
|
||||
argsForCall := fake.trackUnmutedArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackUnpublished(arg1 context.Context, arg2 livekit.ParticipantID, arg3 livekit.ParticipantIdentity, arg4 *livekit.TrackInfo, arg5 bool) {
|
||||
func (fake *FakeTelemetryService) TrackUnpublished(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 livekit.ParticipantIdentity, arg6 *livekit.TrackInfo, arg7 bool) {
|
||||
fake.trackUnpublishedMutex.Lock()
|
||||
fake.trackUnpublishedArgsForCall = append(fake.trackUnpublishedArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 livekit.ParticipantIdentity
|
||||
arg4 *livekit.TrackInfo
|
||||
arg5 bool
|
||||
}{arg1, arg2, arg3, arg4, arg5})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 livekit.ParticipantIdentity
|
||||
arg6 *livekit.TrackInfo
|
||||
arg7 bool
|
||||
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
stub := fake.TrackUnpublishedStub
|
||||
fake.recordInvocation("TrackUnpublished", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||
fake.recordInvocation("TrackUnpublished", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7})
|
||||
fake.trackUnpublishedMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackUnpublishedStub(arg1, arg2, arg3, arg4, arg5)
|
||||
fake.TrackUnpublishedStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1536,32 +1590,34 @@ func (fake *FakeTelemetryService) TrackUnpublishedCallCount() int {
|
||||
return len(fake.trackUnpublishedArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackUnpublishedCalls(stub func(context.Context, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool)) {
|
||||
func (fake *FakeTelemetryService) TrackUnpublishedCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool)) {
|
||||
fake.trackUnpublishedMutex.Lock()
|
||||
defer fake.trackUnpublishedMutex.Unlock()
|
||||
fake.TrackUnpublishedStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackUnpublishedArgsForCall(i int) (context.Context, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool) {
|
||||
func (fake *FakeTelemetryService) TrackUnpublishedArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, livekit.ParticipantIdentity, *livekit.TrackInfo, bool) {
|
||||
fake.trackUnpublishedMutex.RLock()
|
||||
defer fake.trackUnpublishedMutex.RUnlock()
|
||||
argsForCall := fake.trackUnpublishedArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6, argsForCall.arg7
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackUnsubscribed(arg1 context.Context, arg2 livekit.ParticipantID, arg3 *livekit.TrackInfo, arg4 bool) {
|
||||
func (fake *FakeTelemetryService) TrackUnsubscribed(arg1 context.Context, arg2 livekit.RoomID, arg3 livekit.RoomName, arg4 livekit.ParticipantID, arg5 *livekit.TrackInfo, arg6 bool) {
|
||||
fake.trackUnsubscribedMutex.Lock()
|
||||
fake.trackUnsubscribedArgsForCall = append(fake.trackUnsubscribedArgsForCall, struct {
|
||||
arg1 context.Context
|
||||
arg2 livekit.ParticipantID
|
||||
arg3 *livekit.TrackInfo
|
||||
arg4 bool
|
||||
}{arg1, arg2, arg3, arg4})
|
||||
arg2 livekit.RoomID
|
||||
arg3 livekit.RoomName
|
||||
arg4 livekit.ParticipantID
|
||||
arg5 *livekit.TrackInfo
|
||||
arg6 bool
|
||||
}{arg1, arg2, arg3, arg4, arg5, arg6})
|
||||
stub := fake.TrackUnsubscribedStub
|
||||
fake.recordInvocation("TrackUnsubscribed", []interface{}{arg1, arg2, arg3, arg4})
|
||||
fake.recordInvocation("TrackUnsubscribed", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6})
|
||||
fake.trackUnsubscribedMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.TrackUnsubscribedStub(arg1, arg2, arg3, arg4)
|
||||
fake.TrackUnsubscribedStub(arg1, arg2, arg3, arg4, arg5, arg6)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1571,17 +1627,17 @@ func (fake *FakeTelemetryService) TrackUnsubscribedCallCount() int {
|
||||
return len(fake.trackUnsubscribedArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackUnsubscribedCalls(stub func(context.Context, livekit.ParticipantID, *livekit.TrackInfo, bool)) {
|
||||
func (fake *FakeTelemetryService) TrackUnsubscribedCalls(stub func(context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo, bool)) {
|
||||
fake.trackUnsubscribedMutex.Lock()
|
||||
defer fake.trackUnsubscribedMutex.Unlock()
|
||||
fake.TrackUnsubscribedStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) TrackUnsubscribedArgsForCall(i int) (context.Context, livekit.ParticipantID, *livekit.TrackInfo, bool) {
|
||||
func (fake *FakeTelemetryService) TrackUnsubscribedArgsForCall(i int) (context.Context, livekit.RoomID, livekit.RoomName, livekit.ParticipantID, *livekit.TrackInfo, bool) {
|
||||
fake.trackUnsubscribedMutex.RLock()
|
||||
defer fake.trackUnsubscribedMutex.RUnlock()
|
||||
argsForCall := fake.trackUnsubscribedArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6
|
||||
}
|
||||
|
||||
func (fake *FakeTelemetryService) Webhook(arg1 context.Context, arg2 *livekit.WebhookInfo) {
|
||||
|
||||
@@ -31,11 +31,12 @@ import (
|
||||
//counterfeiter:generate . TelemetryService
|
||||
type TelemetryService interface {
|
||||
// TrackStats is called periodically for each track in both directions (published/subscribed)
|
||||
TrackStats(key StatsKey, stat *livekit.AnalyticsStat)
|
||||
TrackStats(roomID livekit.RoomID, roomName livekit.RoomName, key StatsKey, stat *livekit.AnalyticsStat)
|
||||
|
||||
// events
|
||||
RoomStarted(ctx context.Context, room *livekit.Room)
|
||||
RoomEnded(ctx context.Context, room *livekit.Room)
|
||||
|
||||
// ParticipantJoined - a participant establishes signal connection to a room
|
||||
ParticipantJoined(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, clientInfo *livekit.ClientInfo, clientMeta *livekit.AnalyticsClientMeta, shouldSendEvent bool, guard *ReferenceGuard)
|
||||
// ParticipantActive - a participant establishes media connection
|
||||
@@ -45,40 +46,46 @@ type TelemetryService interface {
|
||||
// ParticipantLeft - the participant leaves the room, only sent if ParticipantActive has been called before
|
||||
ParticipantLeft(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, shouldSendEvent bool, guard *ReferenceGuard)
|
||||
// TrackPublishRequested - a publication attempt has been received
|
||||
TrackPublishRequested(ctx context.Context, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo)
|
||||
TrackPublishRequested(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo)
|
||||
// TrackPublished - a publication attempt has been successful
|
||||
TrackPublished(ctx context.Context, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool)
|
||||
TrackPublished(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool)
|
||||
// TrackUnpublished - a participant unpublished a track
|
||||
TrackUnpublished(ctx context.Context, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool)
|
||||
TrackUnpublished(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool)
|
||||
// TrackSubscribeRequested - a participant requested to subscribe to a track
|
||||
TrackSubscribeRequested(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo)
|
||||
TrackSubscribeRequested(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)
|
||||
// TrackSubscribed - a participant subscribed to a track successfully
|
||||
TrackSubscribed(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo, publisher *livekit.ParticipantInfo, shouldSendEvent bool)
|
||||
TrackSubscribed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, publisher *livekit.ParticipantInfo, shouldSendEvent bool)
|
||||
// TrackUnsubscribed - a participant unsubscribed from a track successfully
|
||||
TrackUnsubscribed(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo, shouldSendEvent bool)
|
||||
TrackUnsubscribed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, shouldSendEvent bool)
|
||||
// TrackSubscribeFailed - failure to subscribe to a track
|
||||
TrackSubscribeFailed(ctx context.Context, participantID livekit.ParticipantID, trackID livekit.TrackID, err error, isUserError bool)
|
||||
TrackSubscribeFailed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, err error, isUserError bool)
|
||||
// TrackMuted - the publisher has muted the Track
|
||||
TrackMuted(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo)
|
||||
TrackMuted(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)
|
||||
// TrackUnmuted - the publisher has muted the Track
|
||||
TrackUnmuted(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo)
|
||||
TrackUnmuted(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)
|
||||
// TrackPublishedUpdate - track metadata has been updated
|
||||
TrackPublishedUpdate(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo)
|
||||
TrackPublishedUpdate(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)
|
||||
// TrackMaxSubscribedVideoQuality - publisher is notified of the max quality subscribers desire
|
||||
TrackMaxSubscribedVideoQuality(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo, mime mime.MimeType, maxQuality livekit.VideoQuality)
|
||||
TrackPublishRTPStats(ctx context.Context, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, layer int, stats *livekit.RTPStats)
|
||||
TrackSubscribeRTPStats(ctx context.Context, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, stats *livekit.RTPStats)
|
||||
TrackMaxSubscribedVideoQuality(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, mime mime.MimeType, maxQuality livekit.VideoQuality)
|
||||
TrackPublishRTPStats(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, layer int, stats *livekit.RTPStats)
|
||||
TrackSubscribeRTPStats(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, stats *livekit.RTPStats)
|
||||
|
||||
EgressStarted(ctx context.Context, info *livekit.EgressInfo)
|
||||
EgressUpdated(ctx context.Context, info *livekit.EgressInfo)
|
||||
EgressEnded(ctx context.Context, info *livekit.EgressInfo)
|
||||
|
||||
IngressCreated(ctx context.Context, info *livekit.IngressInfo)
|
||||
IngressDeleted(ctx context.Context, info *livekit.IngressInfo)
|
||||
IngressStarted(ctx context.Context, info *livekit.IngressInfo)
|
||||
IngressUpdated(ctx context.Context, info *livekit.IngressInfo)
|
||||
IngressEnded(ctx context.Context, info *livekit.IngressInfo)
|
||||
|
||||
LocalRoomState(ctx context.Context, info *livekit.AnalyticsNodeRooms)
|
||||
|
||||
Report(ctx context.Context, reportInfo *livekit.ReportInfo)
|
||||
|
||||
APICall(ctx context.Context, apiCallInfo *livekit.APICallInfo)
|
||||
|
||||
Webhook(ctx context.Context, webhookInfo *livekit.WebhookInfo)
|
||||
|
||||
// helpers
|
||||
@@ -95,9 +102,10 @@ type NullTelemetryService struct {
|
||||
NullAnalyticService
|
||||
}
|
||||
|
||||
func (n NullTelemetryService) TrackStats(key StatsKey, stat *livekit.AnalyticsStat) {}
|
||||
func (n NullTelemetryService) RoomStarted(ctx context.Context, room *livekit.Room) {}
|
||||
func (n NullTelemetryService) RoomEnded(ctx context.Context, room *livekit.Room) {}
|
||||
func (n NullTelemetryService) TrackStats(roomID livekit.RoomID, roomName livekit.RoomName, key StatsKey, stat *livekit.AnalyticsStat) {
|
||||
}
|
||||
func (n NullTelemetryService) RoomStarted(ctx context.Context, room *livekit.Room) {}
|
||||
func (n NullTelemetryService) RoomEnded(ctx context.Context, room *livekit.Room) {}
|
||||
func (n NullTelemetryService) ParticipantJoined(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, clientInfo *livekit.ClientInfo, clientMeta *livekit.AnalyticsClientMeta, shouldSendEvent bool, guard *ReferenceGuard) {
|
||||
}
|
||||
func (n NullTelemetryService) ParticipantActive(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, clientMeta *livekit.AnalyticsClientMeta, isMigration bool, guard *ReferenceGuard) {
|
||||
@@ -106,31 +114,31 @@ func (n NullTelemetryService) ParticipantResumed(ctx context.Context, room *live
|
||||
}
|
||||
func (n NullTelemetryService) ParticipantLeft(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, shouldSendEvent bool, guard *ReferenceGuard) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackPublishRequested(ctx context.Context, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo) {
|
||||
func (n NullTelemetryService) TrackPublishRequested(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackPublished(ctx context.Context, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool) {
|
||||
func (n NullTelemetryService) TrackPublished(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackUnpublished(ctx context.Context, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool) {
|
||||
func (n NullTelemetryService) TrackUnpublished(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackSubscribeRequested(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo) {
|
||||
func (n NullTelemetryService) TrackSubscribeRequested(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackSubscribed(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo, publisher *livekit.ParticipantInfo, shouldSendEvent bool) {
|
||||
func (n NullTelemetryService) TrackSubscribed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, publisher *livekit.ParticipantInfo, shouldSendEvent bool) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackUnsubscribed(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo, shouldSendEvent bool) {
|
||||
func (n NullTelemetryService) TrackUnsubscribed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, shouldSendEvent bool) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackSubscribeFailed(ctx context.Context, participantID livekit.ParticipantID, trackID livekit.TrackID, err error, isUserError bool) {
|
||||
func (n NullTelemetryService) TrackSubscribeFailed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, err error, isUserError bool) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackMuted(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo) {
|
||||
func (n NullTelemetryService) TrackMuted(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackUnmuted(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo) {
|
||||
func (n NullTelemetryService) TrackUnmuted(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackPublishedUpdate(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo) {
|
||||
func (n NullTelemetryService) TrackPublishedUpdate(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackMaxSubscribedVideoQuality(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo, mime mime.MimeType, maxQuality livekit.VideoQuality) {
|
||||
func (n NullTelemetryService) TrackMaxSubscribedVideoQuality(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, mime mime.MimeType, maxQuality livekit.VideoQuality) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackPublishRTPStats(ctx context.Context, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, layer int, stats *livekit.RTPStats) {
|
||||
func (n NullTelemetryService) TrackPublishRTPStats(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, layer int, stats *livekit.RTPStats) {
|
||||
}
|
||||
func (n NullTelemetryService) TrackSubscribeRTPStats(ctx context.Context, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, stats *livekit.RTPStats) {
|
||||
func (n NullTelemetryService) TrackSubscribeRTPStats(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, stats *livekit.RTPStats) {
|
||||
}
|
||||
func (n NullTelemetryService) EgressStarted(ctx context.Context, info *livekit.EgressInfo) {}
|
||||
func (n NullTelemetryService) EgressUpdated(ctx context.Context, info *livekit.EgressInfo) {}
|
||||
@@ -157,6 +165,11 @@ const (
|
||||
telemetryStatsUpdateInterval = time.Second * 30
|
||||
)
|
||||
|
||||
type statsWorkerKey struct {
|
||||
roomID livekit.RoomID
|
||||
participantID livekit.ParticipantID
|
||||
}
|
||||
|
||||
type telemetryService struct {
|
||||
AnalyticsService
|
||||
|
||||
@@ -164,7 +177,7 @@ type telemetryService struct {
|
||||
jobsQueue *utils.OpsQueue
|
||||
|
||||
workersMu sync.RWMutex
|
||||
workers map[livekit.ParticipantID]*StatsWorker
|
||||
workers map[statsWorkerKey]*StatsWorker
|
||||
workerList *StatsWorker
|
||||
|
||||
flushMu sync.Mutex
|
||||
@@ -180,7 +193,7 @@ func NewTelemetryService(notifier webhook.QueuedNotifier, analytics AnalyticsSer
|
||||
FlushOnStop: true,
|
||||
Logger: logger.GetLogger(),
|
||||
}),
|
||||
workers: make(map[livekit.ParticipantID]*StatsWorker),
|
||||
workers: make(map[statsWorkerKey]*StatsWorker),
|
||||
}
|
||||
if t.notifier != nil {
|
||||
t.notifier.RegisterProcessedHook(func(ctx context.Context, whi *livekit.WebhookInfo) {
|
||||
@@ -234,8 +247,9 @@ func (t *telemetryService) FlushStats() {
|
||||
if reap != nil {
|
||||
t.workersMu.Lock()
|
||||
for reap != nil {
|
||||
if reap == t.workers[reap.participantID] {
|
||||
delete(t.workers, reap.participantID)
|
||||
key := statsWorkerKey{reap.roomID, reap.participantID}
|
||||
if reap == t.workers[key] {
|
||||
delete(t.workers, key)
|
||||
}
|
||||
reap = reap.next
|
||||
}
|
||||
@@ -253,11 +267,11 @@ func (t *telemetryService) enqueue(op func()) {
|
||||
t.jobsQueue.Enqueue(op)
|
||||
}
|
||||
|
||||
func (t *telemetryService) getWorker(participantID livekit.ParticipantID) (worker *StatsWorker, ok bool) {
|
||||
func (t *telemetryService) getWorker(roomID livekit.RoomID, participantID livekit.ParticipantID) (worker *StatsWorker, ok bool) {
|
||||
t.workersMu.RLock()
|
||||
defer t.workersMu.RUnlock()
|
||||
|
||||
worker, ok = t.workers[participantID]
|
||||
worker, ok = t.workers[statsWorkerKey{roomID, participantID}]
|
||||
return
|
||||
}
|
||||
|
||||
@@ -272,7 +286,8 @@ func (t *telemetryService) getOrCreateWorker(
|
||||
t.workersMu.Lock()
|
||||
defer t.workersMu.Unlock()
|
||||
|
||||
worker, ok := t.workers[participantID]
|
||||
key := statsWorkerKey{roomID, participantID}
|
||||
worker, ok := t.workers[key]
|
||||
if ok && !worker.Closed(guard) {
|
||||
return worker, true
|
||||
}
|
||||
@@ -295,7 +310,7 @@ func (t *telemetryService) getOrCreateWorker(
|
||||
worker.SetConnected()
|
||||
}
|
||||
|
||||
t.workers[participantID] = worker
|
||||
t.workers[key] = worker
|
||||
|
||||
worker.next = t.workerList
|
||||
t.workerList = worker
|
||||
|
||||
Reference in New Issue
Block a user