Repository navigation
fix(speed): publish the engine's aggregate rate in decimal MB/s - #206
Open
shaktimaan00 wants to merge 1 commit into
Open
shaktimaan00 wants to merge 1 commit into
shaktimaan00 wants to merge 1 commit into
Conversation
snapshot() divided the aggregate byte rate by 1_048_576 and shipped it as speed_mbs; both front-ends print that figure as MB/s and scale it down to KB/s by 1024. The per-file rates beside it have been divided by 1e6 since LeyckerS#194, so the run-wide line read 4.9% below the files it summarises. The ETA multiplied the same figure back into bytes, so it moves to 1e6 with it. The stall detector is untouched: it already compares against a /1e6 value.
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.
Most of #84 has already landed: #194 put a file's live rate on the same
/1e6as its final average, and #154 replaced the CLI's private copy of the arithmetic with the engine snapshot. What was left is the run-wide figureEngine.snapshot()publishes.moon_engine.pydivided the aggregate byte rate by1_048_576and shipped it asspeed_mbs. Both front-ends read that figure as MB/s:web/app.jsprints it throughfmtSpeed,moon_cli.pythrough_fmt_speed, and both scale it down to KB/s by 1024. So the aggregate line sat 4.9% below the per-file rates printed next to it for the same run.Convention: decimal MB/s,
/1e6. That is what the labels already claim, and it makes the aggregate agree with the per-file numbers.Lines changed:
moon_engine.py:770aggregate rate:/ 1_048_576->/ 1e6moon_engine.py:778ETA:mbs * 1_048_576->mbs * 1e6, so the published figure is converted back to bytes at the unit it was published intests/test_snapshot_speed.pyrewritten: exact expectations instead of the old0.5 < got < 1.5bands, an ETA case, and a syntax-tree guard against a MiB divisor coming backDeliberately untouched:
min(3.0, elapsed), which is the separate problem the per-file live speed in the GUI is roughly nine times the real rate #86 measured; the same speed is computed in MiB/s in some places and MB/s in others, all labelled "MB/s" #84 was only about the unit.STALL_MIN_MBSis compared against a/1e6figure inmoon_download.py, so it still means what its name says.web/app.jsdemo mode, which is fixture data rather than arithmetic.The rewritten test fails on
mainin all four cases and passes here. Full suite: 173 passed.ruff check .clean. Fixes #84.