From 3b845cb307c92f0042da6bde4c59a87568265cad Mon Sep 17 00:00:00 2001 From: MasterPtato Date: Tue, 17 Mar 2026 12:37:28 -0700 Subject: [PATCH] chore: update byte units on frontend --- frontend/src/app/billing/billing-page.tsx | 4 +-- frontend/src/app/billing/plan-card.tsx | 12 +++---- frontend/src/app/billing/usage-card.tsx | 24 +++++++------- frontend/src/app/metrics/constants.ts | 2 +- frontend/src/content/billing.ts | 40 +++++++++++------------ 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/frontend/src/app/billing/billing-page.tsx b/frontend/src/app/billing/billing-page.tsx index 85a11cb0bc..2410083a58 100644 --- a/frontend/src/app/billing/billing-page.tsx +++ b/frontend/src/app/billing/billing-page.tsx @@ -52,14 +52,14 @@ const USAGE_METRICS: UsageMetricConfig[] = [ { key: "kv_read", title: "Reads", - description: "Data read from actor state, measured in 4KB units.", + description: "Data read from actor state, measured in 4KiB units.", icon: faBarcodeRead, metricType: "operations", }, { key: "kv_write", title: "Writes", - description: "Data written to actor state, measured in 4KB units.", + description: "Data written to actor state, measured in 4KiB units.", icon: faPencil, metricType: "operations", }, diff --git a/frontend/src/app/billing/plan-card.tsx b/frontend/src/app/billing/plan-card.tsx index 1691b94fe9..3ab03e6cd5 100644 --- a/frontend/src/app/billing/plan-card.tsx +++ b/frontend/src/app/billing/plan-card.tsx @@ -79,8 +79,8 @@ export const CommunityPlan = (props: Partial) => { features={[ { icon: faCheck, label: "5 Million Writes /mo Limit" }, { icon: faCheck, label: "200 Million Reads /mo Limit" }, - { icon: faCheck, label: "5GB Storage Limit" }, - { icon: faCheck, label: "100GB Egress Limit" }, + { icon: faCheck, label: "5GiB Storage Limit" }, + { icon: faCheck, label: "100GiB Egress Limit" }, { icon: faCheck, label: "100,000 Awake Actors Hours Limit" }, { icon: faCheck, label: "Community Support" }, ]} @@ -106,9 +106,9 @@ export const ProPlan = (props: Partial) => { }, { icon: faPlus, - label: "5GB Storage included", + label: "5GiB Storage included", }, - { icon: faPlus, label: "1TB Egress included" }, + { icon: faPlus, label: "1TiB Egress included" }, { icon: faPlus, label: "400,000 Awake Actors Hours included" }, { icon: faCheck, label: "Email Support" }, ]} @@ -126,8 +126,8 @@ export const TeamPlan = (props: Partial) => { features={[ { icon: faPlus, label: "25 Billion Reads /mo included" }, { icon: faPlus, label: "50 Million Writes /mo included" }, - { icon: faPlus, label: "5GB Storage included" }, - { icon: faPlus, label: "1TB Egress included" }, + { icon: faPlus, label: "5GiB Storage included" }, + { icon: faPlus, label: "1TiB Egress included" }, { icon: faPlus, label: "400,000 Awake Actors Hours included" }, { icon: faCheck, label: "MFA" }, { icon: faCheck, label: "Slack Support" }, diff --git a/frontend/src/app/billing/usage-card.tsx b/frontend/src/app/billing/usage-card.tsx index a5c2e21a97..1c3857e611 100644 --- a/frontend/src/app/billing/usage-card.tsx +++ b/frontend/src/app/billing/usage-card.tsx @@ -37,22 +37,22 @@ function formatMetricValue(value: bigint, type: MetricType): string { return `${stripTrailingZeros(hours, 1)} hrs`; } case "bytes": { - const KB = 1000; - const MB = 1000 * 1000; - const GB = 1000 * 1000 * 1000; - const TB = 1000 * 1000 * 1000 * 1000; + const KiB = 1024; + const MiB = 1024 * 1024; + const GiB = 1024 * 1024 * 1024; + const TiB = 1024 * 1024 * 1024 * 1024; - if (num >= TB) { - return `${stripTrailingZeros(num / TB, 2)} TB`; + if (num >= TiB) { + return `${stripTrailingZeros(num / TiB, 2)} TiB`; } - if (num >= GB) { - return `${stripTrailingZeros(num / GB, 2)} GB`; + if (num >= GiB) { + return `${stripTrailingZeros(num / GiB, 2)} GiB`; } - if (num >= MB) { - return `${stripTrailingZeros(num / MB, 2)} MB`; + if (num >= MiB) { + return `${stripTrailingZeros(num / MiB, 2)} MiB`; } - if (num >= KB) { - return `${stripTrailingZeros(num / KB, 2)} KB`; + if (num >= KiB) { + return `${stripTrailingZeros(num / KiB, 2)} KiB`; } return `${num} B`; } diff --git a/frontend/src/app/metrics/constants.ts b/frontend/src/app/metrics/constants.ts index 511e5dfcee..db43237ff8 100644 --- a/frontend/src/app/metrics/constants.ts +++ b/frontend/src/app/metrics/constants.ts @@ -30,7 +30,7 @@ function formatCount(value: number): string { } function formatOperations(value: number): string { - const units = value / bytes.KiB(4); // 4KB operation units + const units = value / bytes.KiB(4); // 4KiB operation units if (units >= 1_000_000_000) return `${(units / 1_000_000_000).toFixed(2)}B ops`; if (units >= 1_000_000) return `${(units / 1_000_000).toFixed(2)}M ops`; diff --git a/frontend/src/content/billing.ts b/frontend/src/content/billing.ts index 9e92d84263..ee7351baa3 100644 --- a/frontend/src/content/billing.ts +++ b/frontend/src/content/billing.ts @@ -10,37 +10,37 @@ const ACTOR_AWAKE_PRICE_PER_SECOND = /** * prices: * actor_awake: $0.05 per 1k awake actor-hours - * kv_storage_used: $0.40 per GB-month - * kv_read: $0.20 per million 4KB units - * kv_write: $1 per million 4KB units - * gateway_egress: $0.15 per GB + * kv_storage_used: $0.40 per GiB-month + * kv_read: $0.20 per million 4KiB units + * kv_write: $1 per million 4KiB units + * gateway_egress: $0.15 per GiB * * measurement units: * actor_awake measured in seconds * kv_storage_used measured in bytes - * kv_read measured in bytes (rounded up to 4KB units) - * kv_write measured in bytes (rounded up to 4KB units) + * kv_read measured in bytes (rounded up to 4KiB units) + * kv_write measured in bytes (rounded up to 4KiB units) * gateway_egress measured in bytes * * included in plans: * free: * actor_awake: $5 dollars worth - * kv_storage_used: 5 GB + * kv_storage_used: 5 GiB * kv_read: 200M * kv_write: 5M - * gateway_egress: 100 GB + * gateway_egress: 100 GiB * pro: * actor_awake: $20 dollars worth - * kv_storage_used: 5 GB + * kv_storage_used: 5 GiB * kv_read: 25B * kv_write: 50M - * gateway_egress: 1 TB + * gateway_egress: 1 TiB * team: * actor_awake: $20 dollars worth - * kv_storage_used: 5 GB + * kv_storage_used: 5 GiB * kv_read: 25B * kv_write: 50M - * gateway_egress: 1 TB + * gateway_egress: 1 TiB */ type BilledMetrics = Extract< @@ -54,19 +54,19 @@ type BilledMetrics = Extract< export const BILLING = { included: { free: { - kv_read: 200_000_000n * bigBytes.KiB(4n), // 200M 4KB units - kv_write: 5_000_000n * bigBytes.KiB(4n), // 5M 4KB units - gateway_egress: bigBytes.GiB(100n), // 100 GB - kv_storage_used: bigBytes.GiB(5n), // 5 GB + kv_read: 200_000_000n * bigBytes.KiB(4n), // 200M 4KiB units + kv_write: 5_000_000n * bigBytes.KiB(4n), // 5M 4KiB units + gateway_egress: bigBytes.GiB(100n), // 100 GiB + kv_storage_used: bigBytes.GiB(5n), // 5 GiB actor_awake: BigInt( 5_00 /* $5 to cents */ / ACTOR_AWAKE_PRICE_PER_SECOND, ), }, pro: { - kv_read: 25_000_000_000n * bigBytes.KiB(4n), // 25B 4KB units - kv_write: 50_000_000n * bigBytes.KiB(4n), // 50M 4KB units - gateway_egress: bigBytes.TiB(1n), // 1 TB - kv_storage_used: bigBytes.GiB(5n), // 5 GB + kv_read: 25_000_000_000n * bigBytes.KiB(4n), // 25B 4KiB units + kv_write: 50_000_000n * bigBytes.KiB(4n), // 50M 4KiB units + gateway_egress: bigBytes.TiB(1n), // 1 TiB + kv_storage_used: bigBytes.GiB(5n), // 5 GiB actor_awake: BigInt( 20_00 /* $20 to cents */ / ACTOR_AWAKE_PRICE_PER_SECOND, ),