import Link from 'next/link' import { Button } from 'ui' import { Admonition } from 'ui-patterns' // [Joshen] In the future, conditionals should be from resource exhaustion endpoint as single source of truth interface DiskIOBandwidthWarningsProps { hasAccessToComputeSizes: boolean hasLatest: boolean upgradeUrl: string currentBillingCycleSelected: boolean latestIoBudgetConsumption: number highestIoBudgetConsumption: number } export const DiskIOBandwidthWarnings = ({ hasAccessToComputeSizes, hasLatest, currentBillingCycleSelected, upgradeUrl, latestIoBudgetConsumption, highestIoBudgetConsumption, }: DiskIOBandwidthWarningsProps) => { if (hasLatest && latestIoBudgetConsumption >= 100) { return (

Your workload has used up all your Disk IO Budget and is now running at the baseline performance. If you need consistent disk performance, consider upgrading to a larger compute add-on.

} /> ) } if (hasLatest && latestIoBudgetConsumption >= 80) { return (

Your workload has consumed {latestIoBudgetConsumption}% of your Disk IO Budget. If you use up all your Disk IO Budget, your instance will reverted to baseline performance. If you need consistent disk performance, consider upgrading to a larger compute add-on.

} /> ) } if (currentBillingCycleSelected && highestIoBudgetConsumption >= 100) { return (

Your workload has used up all your Disk IO Budget and reverted to baseline performance at least once during this billing cycle. If you need consistent disk performance, consider upgrading to a larger compute add-on.

} /> ) } if (currentBillingCycleSelected && highestIoBudgetConsumption >= 80) { return (

Your workload has consumed {highestIoBudgetConsumption}% of your Disk IO budget during this billing cycle. If you use up all your Disk IO Budget, your instance will reverted to baseline performance. If you need consistent disk performance, consider upgrading to a larger compute add-on.

} /> ) } return null }