Let community stats combine player count and skill brackets#585
Open
ptrlrd wants to merge 1 commit into
Open
Conversation
Add the player x skill composite brackets (solo:wr50, ...) to the community blob so /community-stats can combine both axes at once, like the tier list, instead of picking only one. The community BracketFilter switches to composite mode; the endpoint accepts the composite bracket values. Snapshot version -> 14 (additive). Also cut the snapshot rebuild frequency: the walk reads every run blob (~750k files, ~80 min on the current box), so the 10-minute rebuild interval had the leader walking almost continuously, starving the DB and slowing the whole site. These stats don't need minute-fresh data, so rebuild every 2 hours instead. This matters more now that the community blob is a bit heavier.
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.
Adds the player×skill combine to /community-stats — you can now pick a player count AND a skill tier together (e.g. Solo + A10), instead of only one. Same UX as the tier list (#575).
What it does
solo:wr50, ...) alongside the single ones. The communityBracketFilterswitches to composite mode (two combinable rows), and the endpoint accepts the composite values.normalizeBracket/bracketParamalready pass composites through (Let the tier list combine player count and skill brackets #575).community[solo:a10]= 56 runs, a subset ofsolo's 110).Bundled: cut the rebuild frequency (important)
The snapshot walk reads every run blob — ~750k files, ~80 min on the current box. The rebuild interval was 10 minutes, so the leader was walking almost continuously (one worker pegged + a full run/file scan back-to-back), which starves Mongo and is a big part of the site-wide slowness (14s run lists). Bumped the rebuild interval from 10 min → 2 hours. These stats don't need minute-fresh data, and this offsets the slightly heavier community blob. It's in the same PR because it edits the same file — deploying the feature without it would make the walk-load worse.
Heads-up on deploy
The version bump means one more ~80-minute uninterrupted rebuild after deploy before the community composites populate (and, as we saw tonight, don't redeploy mid-walk or it restarts). The proper long-term fix is making that 80-min walk faster — a separate project.
ruff + compile clean; frontend is a one-prop add on the existing composite-capable BracketFilter.