Repository navigation
fix(gcp/computeengine): price CUDs per vCPU and GiB from the real SKU taxonomy - #381
Conversation
… taxonomy Match core and RAM SKUs by family label, region and term instead of looking for the machine type in the description (never present in the live catalog), multiply by the recommendation's vCPU and GiB, follow every catalog page, and report commitment, on-demand and savings as consistent term totals. Refs #92 #245 Closes #271 Closes #321 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Paging is the shared helper's job (go#364 line of work); keep this change to pricing. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 5 billable files and costs up to $1.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 30 minutes for your next included review. View limit details
Comment |
…ront CommitmentCost is the upfront payment and is 0 for a monthly commitment; the committed price goes to RecurringMonthlyCost. The platform adds upfront plus monthly x term, so the term total in CommitmentCost was counted twice. BreakEvenMonths is dropped: with no upfront payment there is none. Closes #383 Refs platform#683 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…te-monthly-cost-semantics
|
Independent review (claude-opus-5-5) of 1a25519: CHANGES REQUESTED (merge order only) The pricing engine is correct against the live catalog. The one blocking item is about when it merges, not about Blocking
Live re-derivation (read-only catalog GETs, 7 pages, 33,453 SKUs), n2-standard-8 (8 vCPU, 32 GiB), us-central1:
Live sweep of Currency: every live SKU is USD (no Evidence
|
…ear term Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Independent review (claude-opus-5-5) of 6102004: APPROVE This re-review covers 6102004, which carries the go#381 pricing plus the former go#385 cost semantics. The blocking item from my earlier review is fixed. Checked
Non-blocking
|
…ku-pricing # Conflicts: # providers/gcp/services/computeengine/client.go
|
Independent review (claude-opus-5-5) of 17a3d18: APPROVE |
What
GCP Compute CUD pricing never resolved:
skuMatchesMachineTyperequired the machine type (e.g.n2-standard-8) in the SKU description, and 0 of the 33,453 live Compute Engine SKUs contain one. Commitment SKUs are per vCPU-hour and per GiB-hour ("Commitment v1: N2 Cpu in Americas for 1 Year", unitsh/GiBy.h).pricing.goselects the family core and RAM SKUs by catalog family label,serviceRegionsand term (Commit1Yr/Commit3Yr), checks the usage unit, and pricesvCPUs x core rate + GiB x RAM ratefor both commitment and on demand. vCPU and memory come fromrec.CountandComputeDetails.MemoryGB;GetOfferingDetailsneeds them too and now errors without them. Conflicting duplicate, mixed-currency, unit-mismatch and missing-currency SKUs error; the"USD"default is gone. The catalog is cached per client so N recommendations cost one fetch.CommitmentCostis 0 (monthly, no upfront);RecurringMonthlyCostis the committed monthly amount (nil when pricing failed);OnDemandCostis the monthly on-demand price of the same resources (730 h/month, as in AWS, Azure and the platform baseline);BreakEvenMonthsis no longer set (no upfront payment). The platform computes upfront + monthly x term (scheduler.go:1650), so the old term-totalCommitmentCostwas counted about 2x; platform owner to confirm on platform#683. Forcedmonthlypayment stays (GCP CUDs bill monthly, https://cloud.google.com/docs/cuds).CommitmentPriceandOnDemandPriceare both term totals andHourlyRateis the committed hourly cost, so savings are no longer about 99.99%.skulist.Allhelper. This PR's pricing needs that paging to take effect live.Families whose catalog label differs from the machine prefix are mapped explicitly (n1, n2d, c2d, t2d, c4a, c2, m1/m2, m3), from the live catalog.
Live-catalog evidence
Fetched
services/6F81-5844-456A/skuswithgcloudauth: 7 pages, 33,453 SKUs. n2-standard-8 (8 vCPU, 32 GiB), us-central1, 1 year:TestGetComputePricing_N2StandardFromLiveShapedCatalog(SKUs copied from the live catalog) yields HourlyRate 0.244728, on-demand 0.388472 x 8760, savings 37.0%, equal to the hand calculation.Fail before, pass after
Before (main e9a33bb, live-shaped N2 SKUs through
extractComputePricingFromSKUs):Cost semantics:
TestConverterFillsPricingForScorerfailed before withCommitmentCost838.10 andBreakEvenMonths20.43 where 0 was expected;TestEnrichRecWithPricing_MonthlyFiguresPerTermpins the 1yr and 3yr monthly figures (n2-standard-8: hourly x 730).After:
GOWORK=off go build/vet/test ./...inproviders/gcppasses. Existing fixtures with fabricated descriptions ("n1-standard-4 VM running in Americas") were replaced with live-shaped SKUs;usage_type_test.goandTestSkuMatchesMachineTypetested the removed matcher and are gone.Notes
golangci-lintcould not run locally (binary built with go1.26, module needs go1.27); the repo pre-commit hooks (gofmt, vet, gocyclo, gosec) passed.Closes #271
Closes #321
Closes #383
Refs platform#683
Refs #92 #245
🤖 Generated with Claude Code