Skip to content

chore: periodically log webrtc stats - #2064

Open
lukasIO wants to merge 7 commits into
mainfrom
lukas/log-webrtc-stats
Open

chore: periodically log webrtc stats#2064
lukasIO wants to merge 7 commits into
mainfrom
lukas/log-webrtc-stats

Conversation

@lukasIO

@lukasIO lukasIO commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot

changeset-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f1d0993

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
livekit-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lukasIO
lukasIO requested a review from boks1971 August 24, 2026 13:28
devin-ai-integration[bot]

This comment was marked as resolved.

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 110.41 KB (+0.97% 🔺)
dist/livekit-client.umd.js 119.48 KB (+0.79% 🔺)

@boks1971 boks1971 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🎉

Comment thread src/room/statsSummary.ts Outdated
Comment thread src/room/statsSummary.ts
jitterBufferMs: jitterBufferMs(stat),
audioLevel: stat.audioLevel,
totalSamplesReceived: stat.totalSamplesReceived,
concealedSamples: stat.concealedSamples,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add playoutDelay to this please? Would be helpful to look at in cases where that is enabled.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment thread src/room/track/Track.ts
Comment on lines +298 to +309
private logFinalStats() {
if (this.finalStatsLogged) {
return;
}
this.finalStatsLogged = true;
this.getRTCStatsReport()
.then((report) => {
if (report) {
this.log.info('final track stats', summarizeStatsReport(report));
}
})
.catch((error) => this.log.debug('could not collect final track stats', { error }));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Final stats skipped for naturally-ended remote tracks

When a remote track's media is removed, setMediaStream's removetrack handler clears this.receiver before emitting Ended, which synchronously runs stopMonitor and logFinalStats. getRTCStatsReport then returns undefined, so the new final-stats log never fires for remote tracks that end on their own.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants