Skip to content

feat: Track.statsMonitorEnabled to turn off the per-track stats monitor - #1305

Open
S-Sebb wants to merge 1 commit into
livekit:mainfrom
S-Sebb:02-track-stats-monitor-switch
Open

S-Sebb wants to merge 1 commit into
livekit:mainfrom
S-Sebb:02-track-stats-monitor-switch

Conversation

@S-Sebb

@S-Sebb S-Sebb commented Nov 22, 2026

Copy link
Copy Markdown

Fixes #1304

Adds a static Track.statsMonitorEnabled (default true). Tracks started while it is false don't start the getStats monitor, so apps that don't use the stats events save the periodic stats call for each track. While off, those tracks emit no stats events and their cached stats, such as currentBitrate, aren't updated. Changing it doesn't affect tracks already started.

Alternatively this could be a LiveKitClient.initialize(statsMonitor: false) parameter, next to the other process-wide options.

Tests

test/track/stats_monitor_test.dart: with the switch off, a started track never polls while one started before keeps polling; with it on again, a new track polls.

@CLAassistant

CLAassistant commented Nov 22, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

This branch has not been deployed

No deployments
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.

[feature] An option to turn off the per-track stats monitor

2 participants