@@ -144,7 +144,7 @@ export enum ConnectionState {
144144}
145145
146146const CONNECTION_RECONCILE_FREQUENCY_MS = 4 * 1000 ;
147- const STATS_LOG_FREQUENCY_MS = 30 * 1000 ;
147+ const STATS_LOG_FREQUENCY_MS = 5 * 1000 ;
148148
149149/**
150150 * In LiveKit, a room is the logical grouping for a list of participants.
@@ -2616,8 +2616,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
26162616 }
26172617
26182618 /**
2619- * Dumps the raw stats of both peer connections. They cover every track of the
2620- * room as well as the transports, so nothing is collected per track.
2619+ * Dumps stats of both peer connections.
26212620 */
26222621 private logWebRTCStats = async ( ) => {
26232622 const pcManager = this . engine ?. pcManager ;
@@ -2629,9 +2628,13 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
26292628 pcManager . publisher . getStats ( ) ,
26302629 pcManager . subscriber ?. getStats ( ) ,
26312630 ] ) ;
2632- this . statsLog . info ( 'webrtc stats' , {
2633- publisher : publisher && summarizeStatsReport ( publisher ) ,
2634- subscriber : subscriber && summarizeStatsReport ( subscriber ) ,
2631+ const publisherStats = publisher && summarizeStatsReport ( publisher ) ;
2632+ const subscriberStats = subscriber && summarizeStatsReport ( subscriber ) ;
2633+ this . statsLog . info ( `webrtc stats` , {
2634+ publisher : publisherStats ?. connection ,
2635+ subscriber : subscriberStats ?. connection ,
2636+ inbound : [ ...( publisherStats ?. inbound ?? [ ] ) , ...( subscriberStats ?. inbound ?? [ ] ) ] ,
2637+ outbound : publisherStats ?. outbound ,
26352638 } ) ;
26362639 } catch ( error ) {
26372640 this . statsLog . debug ( 'could not collect webrtc stats' , { error } ) ;
0 commit comments