Repository navigation
Report 95th percentile load times and let players fetch assets from R2 - #90
Merged
Merged
Conversation
…2 directly The admin stats and project diagnostics now include p95LoadMs (and p95LoadMsByDay for admin stats) next to the existing averages, so one load left in a background tab no longer swamps a day's figure. Project responses carry assetsMirrorBase, the public R2 asset folder, so players can skip the API redirect for every asset. The redirect itself is now cacheable for a week, and new asset uploads to R2 are marked immutable for a year.
Both endpoints now use summarizeLoadTimes, which has its own tests for timed samples, per-day grouping and the 95th percentile. The R2 asset redirect is cached privately for a day, so a CDN cannot keep sending players to R2 if an asset's location changes.
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.
Summary
GET /v1/admin/statsaddsp95LoadMsandp95LoadMsByDay, andGET /v1/projects/:id/diagnosticsaddsp95LoadMsandloadSamples. Both share a newsummarizeLoadTimeshelper. The average fields stay for older clients. One load left in a background tab (clamped at 600 s) no longer swamps a day's figure. On Nov 30 a single such load pushed the daily average to 15.8 s while the median was 3.9 s.assetsMirrorBase, the public R2 asset folder (empty when R2 isn't configured). The editor uses it to fetch assets from R2 directly, instead of sending every asset through this server for a 307. A cold load of a 461-asset project drops from 922 asset requests (461 of them to this server) to 461, none of them to this server./blobs/assets/:nameredirect is nowprivate, max-age=86400instead ofno-cache, so a browser that still goes through it doesn't ask again for a day. It's private, so a CDN can't keep a stale route.assets/<md5>.<ext>setCache-Control: public, max-age=31536000, immutable. Existing objects are unchanged.Editor companion: MistWarp/scratch-gui
load-time-p95. Deploy this API before the editor, because the new admin chart readsp95LoadMsByDay.Verification
osl test(68 files),osl lsp check main.oslandscripts/check_conventions.py, all with the CI-pinned OSL commit.assetsMirrorBase: https://mwassets.mistium.com/assetsand the new redirect header.No visible surface in this repo. The editor PR has screenshots.