From ee13a39d90f3d6e8074c96c6b2fc70259e472e99 Mon Sep 17 00:00:00 2001 From: Long Hoang <1732217+loong@users.noreply.github.com> Date: Wed, 5 Jul 2023 18:05:33 +0800 Subject: [PATCH 1/4] Change disk io warning to make clear what is happening now and what happened in the past --- .../BillingV2/Usage/Infrastructure.tsx | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx index b46e60bd771..d65defae51d 100644 --- a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx +++ b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx @@ -90,6 +90,10 @@ const Infrastructure = ({ 0 ) + const latestIoBudgetConsumption = ioBudgetData?.data.slice(-1) + ? ioBudgetData?.data.slice(-1)[0].disk_io_consumption + : 0 + const chartMeta: { [key: string]: { data: DataPoint[]; isLoading: boolean } } = { max_cpu_usage: { isLoading: isLoadingCpuUsageData, @@ -118,10 +122,10 @@ const Infrastructure = ({ {attribute.key === 'disk_io_consumption' && ( <> - {currentBillingCycleSelected && highestIoBudgetConsumption >= 100 ? ( - + {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,13 +137,16 @@ const Infrastructure = ({
- ) : currentBillingCycleSelected && highestIoBudgetConsumption >= 80 ? ( - + ) : currentBillingCycleSelected && highestIoBudgetConsumption >= 100 ? ( +

- 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 - upgrading to a larger compute add-on. + 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.

From e54bc8de981f613d0ffa36eedce6b68d1040c7dc Mon Sep 17 00:00:00 2001 From: Long Hoang <1732217+loong@users.noreply.github.com> Date: Wed, 5 Jul 2023 18:24:37 +0800 Subject: [PATCH 2/4] Fix build --- studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx index d65defae51d..150b7b62bb5 100644 --- a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx +++ b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx @@ -91,7 +91,7 @@ const Infrastructure = ({ ) const latestIoBudgetConsumption = ioBudgetData?.data.slice(-1) - ? ioBudgetData?.data.slice(-1)[0].disk_io_consumption + ? Number(ioBudgetData?.data.slice(-1)[0].disk_io_consumption) : 0 const chartMeta: { [key: string]: { data: DataPoint[]; isLoading: boolean } } = { From d42e3ee9d54d89593b8a07cc7a557b3073631217 Mon Sep 17 00:00:00 2001 From: Long Hoang <1732217+loong@users.noreply.github.com> Date: Thu, 6 Jul 2023 13:35:05 +0800 Subject: [PATCH 3/4] Show current warnings only when latest data is showed --- .../interfaces/BillingV2/Usage/Infrastructure.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx index 150b7b62bb5..cb9069b8868 100644 --- a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx +++ b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx @@ -85,15 +85,18 @@ 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 ) - const latestIoBudgetConsumption = ioBudgetData?.data.slice(-1) - ? Number(ioBudgetData?.data.slice(-1)[0].disk_io_consumption) - : 0 - const chartMeta: { [key: string]: { data: DataPoint[]; isLoading: boolean } } = { max_cpu_usage: { isLoading: isLoadingCpuUsageData, @@ -122,7 +125,7 @@ const Infrastructure = ({ {attribute.key === 'disk_io_consumption' && ( <> - {latestIoBudgetConsumption >= 100 ? ( + {hasLatest && latestIoBudgetConsumption >= 100 ? (

Your workload has used up all your Disk IO Budget and is now running at the From fd33c6717dffb4f253b00ccf8dc73f6bd947ee25 Mon Sep 17 00:00:00 2001 From: Long Hoang <1732217+loong@users.noreply.github.com> Date: Thu, 6 Jul 2023 13:35:39 +0800 Subject: [PATCH 4/4] Show warnings when instance is close to running out of disk io budget too --- .../BillingV2/Usage/Infrastructure.tsx | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx index cb9069b8868..e0b7f6f935e 100644 --- a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx +++ b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx @@ -140,6 +140,26 @@ const Infrastructure = ({ + ) : hasLatest && latestIoBudgetConsumption >= 80 ? ( + +

+ 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 ? ( + ) : 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. +

+ + + + + +
) : null}

Disk IO Bandwidth