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:
Raja Subramanian
2026-02-16 13:56:13 +05:30
committed by GitHub
parent 2d40449faf
commit b81bac0ec3
21 changed files with 1256 additions and 414 deletions
+4 -2
View File
@@ -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 {