feat(ui): setup/test/sum toggle for resource usage charts - #255
Merged
Conversation
Resource usage charts (run details, suite Run Charts, and both comparison pages) previously always summed setup + test + cleanup. Add a Sum | Setup | Test toggle to each, defaulting to Test, so a single step's resource usage can be viewed in isolation. - A shared aggregateResourceByStep() helper and a SegmentedControl component replace the duplicated per-component step summing. - averageResults now averages each step independently so the grouped comparison's synthetic runs preserve per-step resource data. Table output is identical for the default single-step filter.
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 a Sum | Setup | Test toggle to every resource usage chart, defaulting to Test, so a single benchmark step's resource usage can be viewed in isolation. Previously these charts always summed setup + test + cleanup with no way to break it down.
Where
ResourceUsageCharts), toggle in the section header.ResourceCharts), toggle in the section divider (this chart runs withhideControls, soresStepis controlled by the page likexAxisMode).ResourceComparisonCharts), toggle in the header.How
utils/resourceStep.ts:ResourceSteptype + a singleaggregateResourceByStep()helper that replaces the three near-duplicate "sum setup+test+cleanup" implementations. Both data shapes (per-testaggregated.resource_totalsand per-run indexresource_totals) feed it via a normalised per-step input.components/shared/SegmentedControl.tsx: reusable single-select button group (extracted from the existing Run#/Time toggle style).averageResultsrefactored to average each step independently, so the grouped comparison's synthetic runs preserve per-step resource data instead of collapsing to one step. Table output is identical for the default single-step filter (mean-equivalent for multi-step; only median + multi-step filters shift slightly), and the variance/error-bar path is unchanged.Note
The grouped-comparison resource charts previously showed only the active table-filter step (test-only by default) because the per-step data was collapsed during averaging. They now honor the toggle and default to Test, consistent with the other pages.
Verification
No UI test suite exists; verified with
tsc -b,eslint, and a fullvite build— all clean.