mirror of
https://github.com/livekit/livekit.git
synced 2026-05-26 09:45:56 +00:00
cde8962709
Data tracks (the new _data_track datachannel) previously only updated a private dataTrackStats that logged a single summary at Close. Bytes never reached the OnTrackStats -> TelemetryService.TrackStats pipeline that media tracks and signal channels feed. Wire DataTrack (UPSTREAM, publisher-home) and DataDownTrack (DOWNSTREAM, per-subscriber) into BytesTrackStats on the same 5s cadence, mirroring the media-track convention: subscriber's country and ID with publisher's track ID for DOWNSTREAM. Cross-region proxy DataTracks leave the stats pointer nil (no publisher reporter on that node, and relayed bytes would double-count). Legacy dataTrackStats packet-loss/frame counters are preserved.