Documentation ¶
Index ¶
- type DefaultProvider
- func (p *DefaultProvider) InstanceTypes() []string
- func (p *DefaultProvider) LivenessProbe(_ *http.Request) error
- func (p *DefaultProvider) OnDemandPrice(instanceType string) (float64, bool)
- func (p *DefaultProvider) Reset()
- func (p *DefaultProvider) SpotPrice(instanceType string, zone string) (float64, bool)
- func (p *DefaultProvider) UpdateOnDemandPricing(ctx context.Context) error
- func (p *DefaultProvider) UpdateSpotPricing(ctx context.Context) error
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultProvider ¶
type DefaultProvider struct {
// contains filtered or unexported fields
}
DefaultProvider provides actual pricing data to the AlibabaCloud 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 NewDefaultProvider ¶
func NewDefaultProvider(ctx context.Context, region string) (*DefaultProvider, error)
func (*DefaultProvider) InstanceTypes ¶
func (p *DefaultProvider) InstanceTypes() []string
InstanceTypes returns the list of all instance types for which either a spot or on-demand price is known.
func (*DefaultProvider) LivenessProbe ¶
func (p *DefaultProvider) LivenessProbe(_ *http.Request) error
func (*DefaultProvider) OnDemandPrice ¶
func (p *DefaultProvider) OnDemandPrice(instanceType string) (float64, bool)
OnDemandPrice returns the last known on-demand price for a given instance type, returning an error if there is no known on-demand pricing for the instance type.
func (*DefaultProvider) Reset ¶
func (p *DefaultProvider) Reset()
func (*DefaultProvider) SpotPrice ¶
func (p *DefaultProvider) SpotPrice(instanceType string, zone string) (float64, bool)
SpotPrice returns the last known spot price for a given instance type and zone, returning an error if there is no known spot pricing for that instance type or zone
func (*DefaultProvider) UpdateOnDemandPricing ¶
func (p *DefaultProvider) UpdateOnDemandPricing(ctx context.Context) error
func (*DefaultProvider) UpdateSpotPricing ¶
func (p *DefaultProvider) UpdateSpotPricing(ctx context.Context) error