Imlement analytics per track statistics (#281)

New tests for telemetry + implementation of per track statistics
This commit is contained in:
Artur Shellunts
2021-12-29 19:29:24 +01:00
committed by GitHub
parent 9d78619ca3
commit 828d490755
10 changed files with 559 additions and 154 deletions
@@ -59,12 +59,13 @@ func (t *telemetryServiceInternal) ParticipantJoined(ctx context.Context, room *
})
t.analytics.SendEvent(ctx, &livekit.AnalyticsEvent{
Type: livekit.AnalyticsEventType_PARTICIPANT_JOINED,
Timestamp: timestamppb.Now(),
RoomSid: room.Sid,
Participant: participant,
Room: room,
SdkType: clientInfo.GetSdk(),
Type: livekit.AnalyticsEventType_PARTICIPANT_JOINED,
Timestamp: timestamppb.Now(),
RoomSid: room.Sid,
ParticipantId: participant.Sid,
Participant: participant,
Room: room,
SdkType: clientInfo.GetSdk(),
})
}
@@ -115,7 +116,7 @@ func (t *telemetryServiceInternal) TrackUnpublished(ctx context.Context, partici
t.RUnlock()
if w != nil {
roomID = w.roomID
w.RemoveBuffer(ssrc)
w.RemoveBuffer(track.GetSid())
roomName = w.roomName
}