pricing

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPI

func NewAPI() client.PricingAPI

NewAPI returns a pricing API

Types

type Err

type Err struct {
	// contains filtered or unexported fields
}

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider provides actual pricing data to the Azure cloud provider to allow it to make more informed decisions regarding which instances to launch. This is initialized at startup with a periodically updated static price list to support running in locations where pricing data is unavailable. In those cases the static pricing data provides a relative ordering that is still more accurate than our previous pricing model. In the event that a pricing update fails, the previous pricing information is retained and used which may be the static initial pricing data if pricing updates never succeed.

func NewProvider

func NewProvider(ctx context.Context, pricing client.PricingAPI, region string, startAsync <-chan struct{}) *Provider

func (*Provider) InstanceTypes

func (p *Provider) InstanceTypes() []string

InstanceTypes returns the list of all instance types for which either a price is known.

func (*Provider) LivenessProbe

func (p *Provider) LivenessProbe(_ *http.Request) error

func (*Provider) OnDemandLastUpdated

func (p *Provider) OnDemandLastUpdated() time.Time

OnDemandLastUpdated returns the time that the on-demand pricing was last updated

func (*Provider) OnDemandPrice

func (p *Provider) OnDemandPrice(instanceType string) (float64, bool)

OnDemandPrice returns the last known on-demand price for a given instance type, returning false if there is no known on-demand pricing for the instance type.

func (*Provider) Reset

func (p *Provider) Reset()

func (*Provider) UpdateOnDemandPricing

func (p *Provider) UpdateOnDemandPricing(ctx context.Context) *Err

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL