## Summary
This is the second step towards merging compute and disk with
infrastructure. There are some usage charts on the current
infrastructure page that are useful to have in the context of compute
and disk settings. This branch adds two charts which give a general
sense of usage and whether an upgrade needs to happen. Other data points
in infrastructure can be found within observability and organisation
usage.
- Adds rolling seven-day Compute and Disk charts to the existing Compute
and Disk page.
- Shows CPU, memory, optional burstable disk IO, and disk usage split
into database, WAL, and system data.
- Covers loading, error, empty, warning, and critical states, retaining
the 75% warning and 90% critical thresholds.
- Uses a dedicated PageSection and keeps the charts in two columns from
680px.
- Uses the concise primary labels Compute and Disk, removes the database
report link, and removes tooltip icons from secondary metrics.
- Adds transformation, summary, and component tests covering dedicated
IO behavior, legacy anchors, responsive layout, rolling refetch, and
tooltip behavior.
## Stack
1. #48368
2. #48369 (this PR)
3. #48370
## How to test
1. Check out `chore/infra-compute-2-charts` and start Studio with `pnpm
dev:studio`.
2. Open `/project/<ref>/settings/compute-and-disk` on a project with
recent metrics.
3. Confirm the charts are in their own page section with standard
spacing below the page header.
4. Confirm the Compute chart shows CPU and memory, plus disk IO when
applicable, and the Disk chart splits usage into database, WAL, and
system data.
5. Confirm the primary labels are Compute and Disk, secondary metrics do
not show tooltip icons, and there is no Database Observability/report
link.
6. Resize across 680px. The charts should remain in two columns at and
above the breakpoint and stack into two rows below it.
7. Exercise loading, error, empty, warning, and critical responses with
the metrics mocks or response overrides. Confirm warning styling begins
at 75%, critical styling begins at 90%, and an error or empty response
does not break the configuration form.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added compute and disk usage charts to the disk management interface,
including metric cards for CPU, memory, disk I/O, database, WAL, and
system.
* Added usage status indicators, peak calculations, tooltips, and a
detailed disk breakdown with placeholders when data is missing.
* Added special handling for dedicated-I/O instances to hide burst-only
disk I/O.
* **Style**
* Simplified the disk space display by removing supplemental explanatory
text.
* **Tests**
* Added comprehensive test coverage for chart rendering,
loading/error/empty states, status/peak calculations, and rolling 7-day
data window behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>