Skip to content

feat(ui): setup/test/sum toggle for resource usage charts - #255

Merged
skylenet merged 1 commit into
masterfrom
resource-usage-graphs-filter
Jul 1, 2026
Merged

feat(ui): setup/test/sum toggle for resource usage charts#255
skylenet merged 1 commit into
masterfrom
resource-usage-graphs-filter

Conversation

@skylenet

@skylenet skylenet commented Jul 1, 2026

Copy link
Copy Markdown
Member

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

  • Run details — "Resource Usage" (ResourceUsageCharts), toggle in the section header.
  • Suite details — "Run Charts" → "System Resources" (ResourceCharts), toggle in the section divider (this chart runs with hideControls, so resStep is controlled by the page like xAxisMode).
  • Comparison and grouped comparison — "Resource Usage Comparison" (ResourceComparisonCharts), toggle in the header.

How

  • New utils/resourceStep.ts: ResourceStep type + a single aggregateResourceByStep() helper that replaces the three near-duplicate "sum setup+test+cleanup" implementations. Both data shapes (per-test aggregated.resource_totals and per-run index resource_totals) feed it via a normalised per-step input.
  • New components/shared/SegmentedControl.tsx: reusable single-select button group (extracted from the existing Run#/Time toggle style).
  • averageResults refactored 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 full vite build — all clean.

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.
@skylenet
skylenet merged commit 3a2fc57 into master Jul 1, 2026
7 checks passed
@skylenet
skylenet deleted the resource-usage-graphs-filter branch July 1, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant