Add FIR, BWE bitrate, and quality-limitation to TrackStats#159
Open
lkang-nuro wants to merge 1 commit into
Open
Add FIR, BWE bitrate, and quality-limitation to TrackStats#159lkang-nuro wants to merge 1 commit into
lkang-nuro wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #159 +/- ##
==========================================
+ Coverage 46.03% 46.63% +0.60%
==========================================
Files 18 18
Lines 1803 1829 +26
==========================================
+ Hits 830 853 +23
- Misses 905 907 +2
- Partials 68 69 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Extend RTCSender.GetTrackStats so downstream RealtimeAnalytics
metrics have real sources:
- FIRCount: copied from the Pion stats interceptor's
OutboundRTPStreamStats.
- AvailableOutgoingBitrate: latest GCC estimate (connection-level),
stored by the Start loop. TargetBitrate: the per-track allocated
share pushed to the encoder, stored in updateBitrate.
- QualityLimitation{CPU,Bandwidth}Seconds: synthesized per ~100ms
tick in accumulateQualityLimitation, since pion provides no
encoder feedback. Bandwidth-limited when the GCC estimate sits
below the configured max bitrate; CPU-limited when the encode
loop falls behind (buffer eviction, tracked via encodeOverruns).
When GCC has no max cap, bandwidth-limited cannot be inferred
and stays zero.
Audio send-side stats are out of scope for now; audio tracks
remain published externally via LiveKit and are not added to the
sender's PeerConnection.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
89d7b56 to
b878ed8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends
RTCSender.GetTrackStatsso downstream RealtimeAnalytics metrics have real sources, without changing audio behavior.FIRCount— copied from the Pion stats interceptor'sOutboundRTPStreamStats(feedsra_webrtc_fir_count).AvailableOutgoingBitrate— latest GCC estimate (connection-level), stored by theStartloop.TargetBitrate— the per-track allocated share pushed to the encoder, stored inupdateBitrate(feedra_webrtc_available_outgoing_bitrate_bps/ra_webrtc_target_bitrate_bps).QualityLimitation{CPU,Bandwidth}Seconds— synthesized per ≈100ms tick inaccumulateQualityLimitation, since pion provides no encoder feedback (feedra_video_encoder_quality_limitation_{cpu,bandwidth}_seconds):encodeOverruns);Out of scope
Audio send-side stats (
ra_audio_*) are deferred. Audio tracks remain published externally via LiveKit and are not added to the sender's PeerConnection, so audio behavior is unchanged frommain.Testing
go build ./...,go vet ./...go test ./sender/...(incl. newBitrateFields,QualityLimitationcpu/bandwidth, andFIRCountassertions)go test -race -run 'GetTrackStats|AddAudioTrack|SetupPeerConnection|QualityLimitation' ./sender/...golangci-lint run ./sender/...— 0 issues🤖 Generated with Claude Code