Repository navigation
Add event-driven drainCapReports and deprecate buildCapReport - #3
Merged
Merged
Conversation
…dCapReport
Add SFVCapReportEmitter, which emits a CAP report on stall edges, video
switches and playable-buffer changes of at least 1.0 s, rate-limited to
one report per second of session time per UE. Changes suppressed by the
rate limit are coalesced into the next allowed report. The final drain
bypasses the rate limit so terminal state is not lost.
Both controllers expose drainCapReports(timeS, { final }). The per-call
snapshot buildCapReport is kept unchanged and marked deprecated.
Co-authored-by: Cursor <cursoragent@cursor.com>
5 tasks done
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.
What and why
In co-simulation, the VQEG CAP-CSP pilot asked for a CAP report on every network step through
buildCapReport. The shared-state audit log therefore grew with the step count instead of with player events. The pilot signaling spec says the player should report on state transitions, at most once per second per UE. This PR moves that rule into SFV.SFVCapReportEmitter(src/core/SFVCapReport.js) emits a report when a stall starts or ends, whencurrent_video_idchanges, or whenplayable_buffer_shas moved by at least 1.0 s since the last report sent.SFVSimulationControllerandSFVBrowserControllergaindrainCapReports(timeS, { final }), which returns[]or one report.final: trueskips the rate limit, so the end state of a session is always reported.DEFAULT_CAP_BUFFER_DELTA_S = 1.0and can be overridden withconfig.capReport.bufferDeltaS.Compatibility
buildCapReportis kept unchanged and marked@deprecated. It still returns a snapshot on every call and does not affect whatdrainCapReportsemits. Its only known consumer is the pilot harness, which switches todrainCapReportsin a matching pilot change.Verification
npm run verifypasses: ESLint,format:check, fixture and patch validation, 181 tests and the simulation scripts.test/cap-report.test.jscover the emitter rules (first report, buffer threshold, stall and video edges, rate limit and coalescing, final flush) and a controller run in which a slow transport causes a real stall.network-steps.jsonlandtelemetry.jsonlare byte-identical to currentmainwith per-step polling. CAP rows inshared-state.jsonldrop from 42 to 4 on the 0.2 s run and from 1,602 to 14 on an 8 s run.