W3CStatsController Create GetRecentRaceVersusRaceStat #319
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.
IGNORE THIS PR. Will need to update. Will update existing make-race-wins and have the query parameters directly. By default, will have no behavior change. Also, no longer facing issue so this PR isn't needed.
What it does: Prepare faster stats tab with limited patch history. By default limits to 3 most recent patch + names that cannot be parsed as patch (eg: All)
TODO: Update FE code to call "map-race-recent-wins" instead of "map-race-wins". Or just have this on map-race-wins by default.
GetRecentRaceVersusRaceStat(int n = 3)
I think https://www.w3champions.com/OverallStatistics/winrates-per-race-and-map page is too inefficient at calls nowadays
It looks like that page calls all the tabs without needing to. If that change is too difficult, I think we should at least do some filtering on
https://website-backend.w3champions.com/api/w3c-stats/map-race-wins
maybe by default only return the 3 most recent balance patches or something (to keep it simple). Seems the javascript page cannot take that much data.
A simple GET request javascript page shouldnt need to take multiple minutes.
ofc ideally we want to only call when necessary but that might be too much work for a volunteer work site.
is the codebase for w3c available? Just annoyed by how slow that page is. 611k lines of json code in one get request call doesnt seem ideal.
the laziest/shortest way to fix without touching FE is to just have BE only pass in 3 most recent patches or whatever for now (no need even for query parameters, etc). That can be done in like a few minutes top. I'm not expecting much (no need to modify FE code to optimize calls per button or whatever)
Since this a document database (mongodb), there's no way not to get all the data as 1 document in the BE to database call. But there's nothing stopping BE from sending filtered data to the FE.
Testing (screw unit test cause no one else has it)