## Context
_TLDR: Changes here speeds up unit tests on CI from ~14 minutes to ~3
minutes_ 😂
_TLDR 2: The file changes are solely only test files +
`studio-unit-tests.yml`_
We've currently got a lot of unit tests in the repository which while
great for coverage, hasn't been ideally written. There's a lot of
redundancy + overly specific tests that break easily, and our current
unit test takes about 15 minutes to run in the GHA per PR. Hence am
doing a audit clean up of all existing unit tests in the studio repo.
## Changes involved
- `.test.ts` files now run in `node`, `.test.tsx` in `jsdom`
- jsdom costs about 1s of setup per file. A `.ts` test that needs the
DOM opts in with `// @vitest-environment jsdom` (46 files do).
- Removed redundant and over-specific tests
- Duplicates are merged into `test.each`. Tests that only covered
libraries, existed for coverage, or asserted class names and snapshots
are deleted. 19 files are merged into a sibling or deleted.
- Fixed about 15 tests that couldn't fail
- Examples: unawaited assertions, fixtures equal to the default, and a
`semverGte` test calling `semverLte`.
- Sped up the slowest files
- Real sleeps are replaced with fake timers, `user.type` with paste, and
Radix option queries are scoped to the open listbox. For example,
`RestoringState` went from 18s to 0.3s and
`useTableEditorFiltersSort.navigation` from 20s to 3s.
- These ^ already shave down the unit tests time from 14 mins to 9 mins,
but am also sharding unit tests across 4 jobs to increase speed up
further which then shaves down time to 3 mins now
## Problem
Infrastructure and Observability label consumed disk IO burst credits as
“Disk IO,” so a value of 1% appears inconsistent with a remaining
balance of 99% in AWS or Grafana.
Both surfaces request `disk_io_consumption`, which is the inverse of
`disk_io_budget`.
## Fix
Show `disk_io_budget` as “Disk IO balance” and explain that it
represents the lower of the remaining throughput and IOPS burst
balances. Infrastructure shows the lowest sampled balance over seven
days; Observability shows the selected-window average.
Keep Infrastructure's overall Compute score based on consumed credits,
so a full balance stays healthy and a low balance still warns. Missing
balance remains unavailable.
Update the compute and disk guide and disk IO troubleshooting page to
explain the remaining balance, its direction, and the different
aggregation windows.
## How to test
- Open Infrastructure settings for a project with burstable IO. Verify
the balance headline and chart show remaining credits, with 100% full
and 0% exhausted.
- Open Observability and verify “Disk IO balance” shows the average
remaining balance for the selected window.
- Hover the labels to check the explanation and aggregation window.
- Verify a high balance does not inflate Compute usage, a low balance
raises the warning, and missing balance does not appear as 0% or 100%.
- Focused unit and MSW component tests: 79 passed, including shuffled
runs with retries disabled; regression mutations caught wrong metric
selection, reversed pressure, and maximum-versus-minimum selection.
## Validation
Studio typecheck, changed-file ESLint, and Prettier pass locally.
Verified both surfaces on the deployed preview, including Observability
refresh and the balance tooltip.
Documentation formatting and review pass. The local markdown build is
blocked by missing generated federated content and its GitHub
credentials; docs CI validates the deployed build.
## Screenshots
Same project on `supabase.green` (before) and the PR preview (after),
captured October 20. Infrastructure uses the same seven-day window;
Observability uses Last 24 hours.
### Infrastructure
| Before | After |
| --- | --- |
| 
| 
|
### Observability
| Before | After |
| --- | --- |
| 
| 
|
Observability balance explanation:

Fixes FDBKPRI-2885
- adds disk IO
- removes error rate (its in the first row in the second section anyway)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Added Disk IO metric card to monitor disk input/output performance in
real-time.
* **Changes**
* Removed Error Rate metric from database infrastructure monitoring
dashboard.
* Renamed "Disk" metric to "Disk Usage" for improved clarity.
* Enhanced disk metrics with refined measurements and calculations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Observability Dashboard: unified overview for service health and
database infrastructure with interactive charts and metric cards (CPU,
memory, disk I/O, connections, error rate, slow queries).
* Service Health Monitoring: per-service health cards and a
multi-service table with error/warning counts and drill-down links to
reports/logs.
* Interval Selector: new chart-interval dropdown with plan-aware
retention messaging.
* Menu & Reports: updated Observability menu with Overview entry and
Custom Reports management.
* **Documentation**
* Added a footer link to troubleshooting guides.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->