Skip to content

Price shared-core E2 types at their billed vCPU fraction - #4

Merged
hsinhoyeh merged 1 commit into
masterfrom
fix/gcp-shared-core-pricing
Jul 23, 2026
Merged

Price shared-core E2 types at their billed vCPU fraction#4
hsinhoyeh merged 1 commit into
masterfrom
fix/gcp-shared-core-pricing

Conversation

@hsinhoyeh

Copy link
Copy Markdown
Contributor

Summary

Closes #3.

e2-micro/e2-small/e2-medium expose 2 logical vCPUs (they can burst to 2) but Google bills them at a baseline fraction of one core — 0.25 / 0.5 / 1.0 vCPU respectively. The pricer billed the full logical vCPU count, overstating e2-micro ~5.6x.

Testing

  • Unit tests: billedVCPU fraction table (including case-insensitivity and pass-through for non-shared-core types) and Price end-to-end with a shared-core instance vs. a standard one.
  • go vet ./... and go test ./... pass.
  • Verified against a live scan of footprintai-prod: both e2-micro instances dropped from $33.98/$39.34 per month (logical-vCPU pricing) to $6.11/$7.08 (billed-fraction pricing), matching the hand-computed list price. The two c3d-highmem-8 Spot instances (unaffected by this change) still price correctly at $79.69/$150.23.

🤖 Generated with Claude Code

e2-micro/e2-small/e2-medium expose 2 logical vCPUs (they can burst to 2)
but Google bills them at a baseline fraction of one core: 0.25 / 0.5 /
1.0 vCPU respectively. The pricer billed the full logical count, which
overstated e2-micro ~5.6x (observed: $33.98/mo scanned vs ~$6/mo actual
list price).

Closes #3

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hsinhoyeh
hsinhoyeh merged commit 15fadc9 into master Jul 23, 2026
1 check passed
@hsinhoyeh
hsinhoyeh deleted the fix/gcp-shared-core-pricing branch July 23, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared-core E2 types priced at logical vCPU count — overstates e2-micro ~5x

1 participant