Skip to content

perf(common): extend ComputeDetails with vCPU + MemoryGB to unlock Azure compute SKU enrichment #82

@cristim

Description

@cristim

Summary

PR #81 batched-SKU work landed for Azure Cache/Cosmos/Database but Compute was scoped back because common.ComputeDetails has no fields for vCPU / MemoryGB. Adding those fields is a cross-provider schema change (AWS + Azure + GCP converters + frontend display + matchers) — out of scope for the Azure-specific PR. Tracking the cross-provider work here so the Azure compute enrichment isn't forgotten.

Current behaviour

pkg/common/types.go::ComputeDetails has only InstanceType / Platform / Tenancy / Scope. The Azure compute converter at providers/azure/services/compute/client.go populates only InstanceType and adds a godoc comment explaining why vCPU/MemoryGB are deferred. The catalogue lookup helper added in PR #81 is not wired for Compute.

Steps to reproduce / verify the gap

grep -n "vCPU\|MemoryGB" pkg/common/types.go
# Returns nothing — fields don't exist in ComputeDetails

grep -n "ComputeDetails{" providers/azure/services/compute/client.go
# Returns the converter call site populating only InstanceType

Expected behaviour

ComputeDetails carries VCPU int + MemoryGB float64 (or whatever the AWS/GCP catalogue calls them). All 3 cloud converters populate them where the catalogue allows. Frontend renders the new fields when present.

Proposed fix (4-step migration)

  1. Extend pkg/common/types.go::ComputeDetails with VCPU int + MemoryGB float64 (and update GetDetailDescription if needed).
  2. AWS compute converter (providers/aws/services/ec2/client.go or wherever ComputeDetails is built): populate from EC2 instance-type catalogue (likely already cached server-side).
  3. Azure compute converter: re-enable the cached SKU lookup (PR perf(azure): batched SKU catalogue lookup eliminates N+1 in recommendation converters #81 helper) and pull vCPUs / MemoryGB capabilities from armcompute.ResourceSKU.Capabilities.
  4. GCP compute converter (providers/gcp/services/compute/client.go): same pattern from GCP machine-type catalogue.
  5. Frontend: surface in the recommendation row / detail drawer if useful.
  6. Update pkg/common/types_test.go for the new fields.

References

Severity

Low — UI degrades to "unknown" for vCPU/MemoryGB columns when present; functional but loses resolution.

Effort

Medium — schema change touches all 3 providers + frontend + matchers + tests. Best handled as a single coordinated PR (all-or-nothing migration to avoid leaving the schema half-extended).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions