diff --git a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx index b46e60bd771..e0b7f6f935e 100644 --- a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx +++ b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx @@ -85,6 +85,13 @@ const Infrastructure = ({ dateFormat, }) + const hasLatest = dayjs(endDate!).isAfter(dayjs().startOf('day')) + + const latestIoBudgetConsumption = + hasLatest && ioBudgetData?.data?.slice(-1) + ? Number(ioBudgetData.data.slice(-1)[0].disk_io_consumption) + : 0 + const highestIoBudgetConsumption = Math.max( ...(ioBudgetData?.data || []).map((x) => Number(x.disk_io_consumption) ?? 0), 0 @@ -118,10 +125,10 @@ const Infrastructure = ({ {attribute.key === 'disk_io_consumption' && ( <> - {currentBillingCycleSelected && highestIoBudgetConsumption >= 100 ? ( - + {hasLatest && latestIoBudgetConsumption >= 100 ? ( +

- Your workload has used up all the burst IO throughput minutes and ran at the + 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.

@@ -133,14 +140,57 @@ const Infrastructure = ({
- ) : currentBillingCycleSelected && highestIoBudgetConsumption >= 80 ? ( - + ) : hasLatest && latestIoBudgetConsumption >= 80 ? ( +

- Your workload is about to use up all the burst IO throughput minutes during - the day. Once this is completely used up, your workload will run at the - baseline performance. If you need consistent disk performance, consider + 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.

+ + + + + +
+ ) : currentBillingCycleSelected && highestIoBudgetConsumption >= 100 ? ( + +

+ 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. +

+ + + + + +
+ ) : currentBillingCycleSelected && highestIoBudgetConsumption >= 80 ? ( + +

+ 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. +