autoscaling

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrorFinal

func IsErrorFinal(err error) bool

IsErrorFinal checks whether the error is final

func NewAutoscalingGroupNotHealthyError

func NewAutoscalingGroupNotHealthyError(desired int, actual int) error

NewAutoscalingGroupNotHealthyError creates a new errAutoscalingGroupNotHealthy

Types

type Group

type Group struct {
	*autoscaling.Group
	// contains filtered or unexported fields
}

Group extends autoscaling.Group

func NewGroup

func NewGroup(manager *Manager, group *autoscaling.Group) *Group

NewGroup initialises and gives back a Group

func (*Group) IsHealthy

func (group *Group) IsHealthy() (bool, error)

IsHealthy checks whether an ASG is in a healthy state which means it has as many healthy instances as desired

type Instance

type Instance struct {
	*autoscaling.Instance
	// contains filtered or unexported fields
}

Instance extends autoscaling.Instance

func NewInstance

func NewInstance(manager *Manager, instance *autoscaling.Instance) *Instance

NewInstance initialises and gives back a new Instance

func (*Instance) Describe

func (i *Instance) Describe() (*ec2.Instance, error)

Describe returns detailed information about the instance

func (*Instance) IsHealthyAndInService

func (i *Instance) IsHealthyAndInService() bool

IsHealthyAndInService is true if the instance is healthy and in InService state

type Logger

type Logger struct {
	logur.Logger
}

Logger sets an initialised outside logger

type Manager

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

Manager is for quering auto scaling groups

func NewManager

func NewManager(session *session.Session, opts ...Option) *Manager

NewManager initialises and gives back a new Manager

func (*Manager) GetAutoscalingGroupByID

func (m *Manager) GetAutoscalingGroupByID(id string) (*Group, error)

GetAutoscalingGroupByID gets and auto scaling group by it's ID and gives back as an initialised Group

func (*Manager) GetAutoscalingGroupByStackName

func (m *Manager) GetAutoscalingGroupByStackName(stackName string) (*Group, error)

GetAutoscalingGroupByStackName gets and auto scaling group by the name of the stack which created it and gives back as an initialised Group

func (*Manager) GetAutoscalingGroups

func (m *Manager) GetAutoscalingGroups() ([]*Group, error)

GetAutoscalingGroups gets auto scaling groups and gives back as initialised []Group

func (*Manager) LastAutoscalingActivity

func (m *Manager) LastAutoscalingActivity(ctx context.Context, asgName *string) (*autoscaling.Activity, error)

GetLastAutoscalingActivity returns the last ASG activity recorded.

func (*Manager) RegisterSpotFulfillmentDuration

func (m *Manager) RegisterSpotFulfillmentDuration(instance *Instance, group *Group)

RegisterSpotFulfillmentDuration checks whether a node instance has a fulfilled spot request related to it and sets the fulfillment duration into a Prometheus metric

func (*Manager) StartMetricTimer

func (m *Manager) StartMetricTimer(instance *Instance) *prometheus.Timer

StartMetricTimer starts a prometheus metric timer for a node instance

func (*Manager) StopMetricTimer

func (m *Manager) StopMetricTimer(instance *Instance) bool

StopMetricTimer stops an existing timer of a node instance

type MetricsEnabled

type MetricsEnabled bool

MetricsEnabled turns on Prometheus metrics

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option sets configuration on the Manager

Jump to

Keyboard shortcuts

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