Repository navigation
New rankings scores - #22
Closed
elcanadiano wants to merge 7 commits into
Closed
elcanadiano wants to merge 7 commits into
elcanadiano wants to merge 7 commits into
Conversation
This brings in a role-rank endpoint which is based loosely off of the aggregation pipeline that the existing Total Score ranks are based off of. We expect this implementation to be not performant if this goes into production. What we aim is to create a replica of the My Rankings sections. Then do a second implementation using a hypothetical new collection which already would theoretically calculate role and rank.
This introduces a dedicated collection which keeps track of a user's cumulative Rock Band 3-only score and a total score, for a given role. In order to properly populate each record, we have added a script called rebuild_role_ranks, which will populate each role_rank record given a user and their role. From there, we also need to make sure that if a user puts up a high score, we update the role_rank collection accordingly. That is what we do in record.go with the ApplyRoleRankScoreDelta function.
This will set up a leaderboards/role-rank API endpoint which is similar to the leaderboards/role-rank/legacy API endpoint, except it uses the role_rank collection that we have set up. We see some dramatic improvements already. Whereas a "Page 1" query with 4 million simulated records took 1705.28ms on the legacy endpoint, the newer endpoint took just 4.39ms. An inserted score from pid 5501 took 6191.78ms on the legacy endpoint whereas the new endpoint took 92.11ms.
When we set USE_MATERIALIZED_ROLE_RANKS to true, the jsonproto RB3 and total score endpoints will instead use the role_ranks collections instead of the MongoDB pipeline. However, this commit keeps a version of the previous pipeline for use. A future commit will remove the aggregate/pipeline implementation.
This will provide the last needed piece, providing an endpoint that acts as two things - first we ensure we can get the basic information of a user - their username, console, and PID. Then we get, where possible, records of their Rock Band 3 and Total Scores, and their ranks for them.
elcanadiano
marked this pull request as draft
September 22, 2026 22:28
Author
|
Sorry I didn't mean to draft this into here. I'll invite you to formally look at this in my own fork if you would like. |
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.
WARNING - THIS PULL REQUEST IS NOT MEANT TO BE MERGED. DO NOT MERGE. THIS PULL REQUEST IS ONLY MEANT TO DEMONSTRATE ARCHITECTURAL CHANGES. MERGING THIS PULL REQUEST SHOULD BE DONE IN PIECEMEAL