Repository navigation
Conversation
What sends usage records to QUMO_USAGE_URL moves out of the relay's verifier into internal/meter: sessions (Open, Report, Close), running totals per key (Total), coalescing, batches of 500, retries through an outage, signing and the last send at shutdown. The relay keeps only its own decisions (a publisher by itself, viewers in one total per key) in internal/auth. The records it sends are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPWMJL7PH3rPhK5UTGavaB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPWMJL7PH3rPhK5UTGavaB
…eter # Conflicts: # CHANGELOG.md
- The check that a key-set or usage URL is https, or http only to a loopback host, was in internal/auth and copied into internal/meter. It is now reqsign.CheckURL, beside the other rules for requests to the control plane (NoRedirectClient, Refusals), so the two can't drift. - meter.Reporter.now was never overridden; it uses time.Now. - usageReporter.flush existed only for tests; they call meter.Flush. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPWMJL7PH3rPhK5UTGavaB
…opted into HLS and ABR A publishing session's usage and session_close records now carry gateway.opt_in_seconds.abr and .hls (usage.OptInSeconds): the whole seconds its announcements beneath /.abr/ and /.hls/ lasted on the relay, added up over its broadcasts. Only an opt-in the session's grant covers reaches the relay, and moqt ends one a revoked ticket no longer covers, so the time is billed to the key that holds the opt-in. qumo abr never needs to know whose broadcast it transcodes. - relay: optInClock counts each checked session's opt-in announcements while they last; the lease sends its totals with each revalidate and reportEnd with the end (auth.Request.OptIns). - auth: a publisher's records carry them; a viewer's total does not. - optin.Of names the egress a path opts into; ingest uses it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPWMJL7PH3rPhK5UTGavaB
… key With QUMO_USAGE_URL and QUMO_AUTH_KEYS, qumo rtmp and qumo rtsp-push send each stream to the usage URL as a relay sends a publishing session: an open, usage every 30 s and a close, under the kid of the token that granted the push, with the media the ingest took in (ingest.media_bytes) and how long it kept the broadcast opted into each egress. The relay only sees the ingest's own session, so a stream pushed over RTMP or RTSP is billed to its publisher here. - ingest.PublishAuthorizer returns a Permission: the lapse, and the kid of the key that granted it. - Session counts the media pushed into it and its opt-in time (Usage). - The opt-in clock moved from the relay to internal/optin (optin.Clock), which both use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPWMJL7PH3rPhK5UTGavaB
A publisher that opted anything in sent a usage record at every revalidate, even with no bytes moved and under a whole second opted in. It now reports only when a metric is positive, as before #613 for bytes. The opt-in clock reads time.Now itself; its tests run in a synctest bubble instead of passing a fake clock through the constructor. TestOf uses subtests; two doc comments are rewrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPWMJNAzsnsiqRPREa2JqY
…hare the whole-seconds rule TestRTMPServer_Meter flushed the meter once the broadcast was announced, but the stream's usage report opens after that, so the sink often got nothing. It now flushes until the open arrives. TestMeterStream runs its stream in a synctest bubble instead of sleeping for real time. The rule turning opt-in time into whole-second metrics was written in both auth and ingest; optin.AddSeconds is now the one copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPWMJNAzsnsiqRPREa2JqY
The opt-in clock now lives in internal/optin: NewClock takes no clock and its tests run in a synctest bubble, as in #613. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPWMJNAzsnsiqRPREa2JqY
Collaborator
Author
|
CI passed on the stack top (8568489); closing as planned. |
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.
Temporary draft to run full CI on the top of the #608 → #613 → #614 stack, which targets other branches and so runs only check-changelog. It will be closed once CI finishes; do not merge.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KPWMJNAzsnsiqRPREa2JqY