Price shared-core E2 types at their billed vCPU fraction - #4
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
billedVCPUfraction table (including case-insensitivity and pass-through for non-shared-core types) andPriceend-to-end with a shared-core instance vs. a standard one.go vet ./...andgo test ./...pass.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