Repository navigation
feat(stats): requested prefix tracks with rollup, self, and children - #5811
Conversation
|
Outcome: the quest's plan is implemented, and it stays a draft only for the two naming and merge-semantics decisions in the body. Local checks are green, apart from the known relay drill flake (#5785), which passed on rerun. Suggested follow-ups: flip (Written by Claude Opus 5.5) |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe change adds subscription-driven Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
A reader can request `<path>/traffic.json` for any broadcast prefix in a stats group and gets, per tier, the prefix's rollup, the broadcast at exactly the prefix (`self`), and a one-level map of each direct child, produced only while held. Sums are drain-time like presence: each row walks its ancestors in the held set, so nothing touches the per-frame path. An oversized prefix frame ends that flavor with FrameTooLarge. The aggregator merges prefix tracks with a per-node baseline, so the rollup never regresses; children sum the live nodes only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
80c54da to
e3e8c44
Compare
|
Ready to merge. The two open decisions are settled as recommended (recorded in the body): names stay Codex reviewed Follow-ups: turn (Written by Claude Opus 5.5) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's #5826 ends any stats track whose frame outgrows the cache, so the prefix-only abort_oversized opt-in and its duplicate test are dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves #5811's prefix tracks against label-keyed presence: presence tracks and requests take the stats label, prefix tracks keep the broadcast path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Completes
quest/m2/stats-prefix-tracks.md(deleted here, references updated).A reader of a node's stats broadcast can request
<path>/traffic.json[.z]for any broadcast prefix within the group. Each frame is keyed by tier, liketotals.json, and each tier entry carries:publisher/subscriberat the top level: the rollup of every path at or under the prefix, so aTotalsreader parses it unchanged.self: {publisher, subscriber}: the broadcast at exactly the prefix.children: {"<segment>": {publisher, subscriber}}: each direct child's rollup.Behavior, as decided in the quest:
{}; reclaimed once the last consumer leaves. No cap on holds or children.moq-netchange; the steady drain still allocates nothing with a prefix held (extended test).activeis exact for a prefix held mid-stream.selfstays flat.Path::MAX_PARTS, is refused withNotFound.FrameTooLarge(warn log); the sibling keeps publishing. This now comes from fix(stats): end a stats track whose frame outgrows the cache #5826, which applies it to every stats track.selfnever regress. Children sum only the live nodes' current children: a departed node's children leave at once, while its rollup stays.Mergeablenow requiresCloneinstead ofCopy, sincePrefixholds a map.Public API and wire impact
moq-statsaddsPrefix,Usage,PrefixFrame,prefix_track,consume::Consumer::prefix/consume::Prefix, andaggregate::Consumer::prefix/aggregate::PrefixConsumer. Nothing removed or changed.<path>/traffic.json[.z]with the payload above. The existing map tracks are unchanged. Documented indoc/concept/stats.md.Decisions
Recommended choices applied while the maintainer was away:
Prefixfor the per-tier entry,Usagefor the{publisher, subscriber}pair, andownas the Rust field for JSONself(a keyword). Rejected:Rollupfor the entry,FloworSidesfor the pair.Checks
just check(lint, then tests for moq-stats, moq-relay, moq-cli): lint clean. One run hit thebursts_cross_a_transport_peer::impaireddrill flake planned in quest(m1): plan fuzz crypto, richer sim workloads, and a relay drill flake #5785; the rerun with--no-fail-fastpassed all 581.producer_tickbench gainsstats/prefix, sweeping paths, path depth, and held prefixes. Measured on a shared, loaded machine, so the timings are noisy: holding 100 prefixes adds about 900 to 1,300 allocations per tick (frame building and encoding), and the time is dominated by thepublisher.jsonencode.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code