Skip to content

Commit

Permalink
chore: adjust on-demand pricing to account for a 28% compute savings …
Browse files Browse the repository at this point in the history
…plan discount
  • Loading branch information
craiglink committed Apr 11, 2024
1 parent ce4658b commit e97c8a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/providers/pricing/pricing.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func (p *Provider) UpdateOnDemandPricing(ctx context.Context) error {
return &Err{error: errors.New("no on-demand pricing found"), lastUpdateTime: p.onDemandUpdateTime}
}

// account for 28% compute savings plan for on-demand instances
p.onDemandPrices = lo.Assign(onDemandPrices, onDemandMetalPrices)
p.onDemandUpdateTime = time.Now()
for instanceType, price := range p.onDemandPrices {
Expand All @@ -218,7 +219,7 @@ func (p *Provider) UpdateOnDemandPricing(ctx context.Context) error {
CapacityTypeLabel: ec2.UsageClassTypeOnDemand,
RegionLabel: p.region,
TopologyLabel: "",
}).Set(price)
}).Set(price* 0.72)
}
if p.cm.HasChanged("on-demand-prices", p.onDemandPrices) {
logging.FromContext(ctx).With("instance-type-count", len(p.onDemandPrices)).Debugf("updated on-demand pricing")
Expand Down

0 comments on commit e97c8a2

Please sign in to comment.