Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Chore/hide disk io chart for 4xl and above (#29586)

Joshen Lim6640054abdcb
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx
index 65129f5d4df..a1c54c6259a 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx
@@ -34,6 +34,16 @@ import { INSTANCE_MICRO_SPECS, INSTANCE_NANO_SPECS } from 'lib/constants'
import { TIME_PERIODS_BILLING, TIME_PERIODS_REPORTS } from 'lib/constants/metrics'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import { INFRA_ACTIVITY_METRICS } from './Infrastructure.constants'
+import { Admonition, Button } from 'ui'
+
+const NON_DEDICATED_IO_RESOURCES = [
+ 'ci_micro',
+ 'ci_small',
+ 'ci_medium',
+ 'ci_large',
+ 'ci_xlarge',
+ 'ci_2xlarge',
+]
const InfrastructureActivity = () => {
const { ref: projectRef } = useParams()
@@ -54,6 +64,9 @@ const InfrastructureActivity = () => {
const selectedAddons = addons?.selected_addons ?? []
const { computeInstance } = getAddons(selectedAddons)
+ const hasDedicatedIOResources =
+ computeInstance !== undefined &&
+ !NON_DEDICATED_IO_RESOURCES.includes(computeInstance.variant.identifier)
function getCurrentComputeInstanceSpecs() {
if (computeInstance?.variant.meta) {
@@ -269,7 +282,7 @@ const InfrastructureActivity = () => {
{currentComputeInstanceSpecs.baseline_disk_io_mbs ===
currentComputeInstanceSpecs.max_disk_io_mbs ? (
<p className="text-sm text-foreground-light">
- Your current compute can has a baseline and maximum disk throughput of{' '}
+ Your current compute has a baseline and maximum disk throughput of{' '}
{currentComputeInstanceSpecs.max_disk_io_mbs?.toLocaleString()} Mbps.
</p>
) : (
@@ -374,7 +387,23 @@ const InfrastructureActivity = () => {
</p>
))}
</div>
- {chartMeta[attribute.key].isLoading ? (
+ {attribute.key === 'disk_io_consumption' && hasDedicatedIOResources ? (
+ <>
+ <Admonition
+ type="note"
+ title={`Your compute instance of ${computeInstance.variant.name} comes with dedicated I/O resources`}
+ description="Your project thus does not rely on I/O balance or burst capacity as larger
+ add-ons are designed for sustained, high performance with specific IOPS and
+ throughput limits without needing to burst."
+ >
+ <Button asChild type="default" icon={<ExternalLink />}>
+ <Link href="https://supabase.com/docs/guides/platform/compute-add-ons#disk-throughput-and-iops">
+ Documentation
+ </Link>
+ </Button>
+ </Admonition>
+ </>
+ ) : chartMeta[attribute.key].isLoading ? (
<div className="space-y-2">
<ShimmeringLoader />
<ShimmeringLoader className="w-3/4" />
diff --git a/packages/ui-patterns/admonition.tsx b/packages/ui-patterns/admonition.tsx
index 38f5f067434..ff3e12b46ef 100644
--- a/packages/ui-patterns/admonition.tsx
+++ b/packages/ui-patterns/admonition.tsx
@@ -70,9 +70,9 @@ const WarningIcon = () => (
const admonitionSVG = cva('', {
variants: {
type: {
- default: `[&_svg]:bg-foreground-muted [&_svg]:text-background-muted`,
- warning: `[&_svg]:bg-warning [&_svg]:text-warning-100`,
- destructive: `[&_svg]:bg-destructive [&_svg]:text-white`,
+ default: `[&>svg]:bg-foreground-muted [&>svg]:text-background-muted`,
+ warning: `[&>svg]:bg-warning [&>svg]:text-warning-100`,
+ destructive: `[&>svg]:bg-destructive [&>svg]:text-white`,
},
},
})