Home / Function/ estimateComputeSize() — supabase Function Reference

estimateComputeSize() — supabase Function Reference

Architecture documentation for the estimateComputeSize() function in BranchManagement.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  b6919f21_e0be_6a10_8a1b_c205b35292d5["estimateComputeSize()"]
  8505154a_957e_9e24_3406_97558e329ee1["CreateBranchModal()"]
  8505154a_957e_9e24_3406_97558e329ee1 -->|calls| b6919f21_e0be_6a10_8a1b_c205b35292d5
  style b6919f21_e0be_6a10_8a1b_c205b35292d5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/BranchManagement/BranchManagement.utils.ts lines 24–38

export const estimateComputeSize = (
  projectDiskSize: number,
  branchComputeSize?: DesiredInstanceSize
) => {
  if (branchComputeSize) {
    return instanceSizeSpecs[branchComputeSize]
  }
  // Fallback to estimating based on volume size
  for (const [disk, compute] of maxDiskForCompute) {
    if (projectDiskSize <= disk) {
      return compute
    }
  }
  return instanceSizeSpecs['24xlarge']
}

Subdomains

Frequently Asked Questions

What does estimateComputeSize() do?
estimateComputeSize() is a function in the supabase codebase.
What calls estimateComputeSize()?
estimateComputeSize() is called by 1 function(s): CreateBranchModal.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free