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:
@@ -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)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user