monitor

package
v0.0.0-...-96756cd Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// LifeCycleTimeout sets the time set for LifeCycleHooks timeout
	LifeCycleTimeout int64 = 3600
	// LifeCycleRefreshTimeoutPercentage sets the percentage of LifeCycleTimeout to wait before reset it
	LifeCycleRefreshTimeoutPercentage = 0.75
)
View Source
const LifecycleStateTerminatingWait = "Terminating:Wait"

LifecycleStateTerminatingWait defines the state of an instance in the autoscalingGroup when it's waiting for confirmation to be removed

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoscalingGroupMonitor

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

AutoscalingGroupMonitor monitors an AWS autoscaling group, caching it's data

func (*AutoscalingGroupMonitor) GetInstances

func (a *AutoscalingGroupMonitor) GetInstances() []*InstanceMonitor

GetInstances return the instances in AutoscalingGroupMonitor cache that doesn't have the deathnode mark

func (*AutoscalingGroupMonitor) GetNumUndesiredInstances

func (a *AutoscalingGroupMonitor) GetNumUndesiredInstances() int

GetNumUndesiredInstances return the number of instances to be removed from the AutoscalingGroup

type AutoscalingServiceMonitor

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

AutoscalingServiceMonitor holds a map of [ASGprefix][ASGname]AutoscalingGroupMonitor

func NewAutoscalingServiceMonitor

func NewAutoscalingServiceMonitor(ctx *context.ApplicationContext) *AutoscalingServiceMonitor

NewAutoscalingServiceMonitor returns an AutoscalingServiceMonitor object

func (*AutoscalingServiceMonitor) GetAutoscalingGroupMonitorsList

func (a *AutoscalingServiceMonitor) GetAutoscalingGroupMonitorsList() []*AutoscalingGroupMonitor

GetAutoscalingGroupMonitorsList returns all AutoscalingGroupMonitors cached in AutoscalingGroups in a list

func (*AutoscalingServiceMonitor) GetInstanceByID

func (a *AutoscalingServiceMonitor) GetInstanceByID(instanceID string) (*InstanceMonitor, error)

GetInstanceByID returns the instanceMonitor related with the instanceId

func (*AutoscalingServiceMonitor) Refresh

func (a *AutoscalingServiceMonitor) Refresh() error

Refresh updates autoscalingGroups caching all AWS autoscaling groups given the N prefixes provided when AutoscalingGroups was created

type InstanceMonitor

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

InstanceMonitor monitors an AWS instance

func (*InstanceMonitor) AutoscalingGroupID

func (a *InstanceMonitor) AutoscalingGroupID() *string

AutoscalingGroupID returns the AutoscalingGroupId of the instance being monitored

func (*InstanceMonitor) IP

func (a *InstanceMonitor) IP() string

IP returns the private IP of the AWS instance

func (*InstanceMonitor) InstanceID

func (a *InstanceMonitor) InstanceID() *string

InstanceID returns the instanceId of the instance being monitored

func (*InstanceMonitor) IsMarkedToBeRemoved

func (a *InstanceMonitor) IsMarkedToBeRemoved() bool

IsMarkedToBeRemoved is true when the instance has been marked for removal

func (*InstanceMonitor) IsProtected

func (a *InstanceMonitor) IsProtected() bool

IsProtected returns true if the instance has the flag instanceProtection in the ASG

func (*InstanceMonitor) LifecycleState

func (a *InstanceMonitor) LifecycleState() string

LifecycleState returns the lifeCycleState of the instance in the ASG

func (*InstanceMonitor) RefreshLifecycleHook

func (a *InstanceMonitor) RefreshLifecycleHook() error

RefreshLifecycleHook resets the timeout for the lifecycle hook and re-tag the instance with a new epoch

func (*InstanceMonitor) RemoveInstanceProtection

func (a *InstanceMonitor) RemoveInstanceProtection() error

RemoveInstanceProtection removes the instance protection for the autoscaling

func (*InstanceMonitor) TagRemovalTimestamp

func (a *InstanceMonitor) TagRemovalTimestamp() int64

TagRemovalTimestamp returns the start timestamp for the lifecycle hook

func (*InstanceMonitor) TagToBeRemoved

func (a *InstanceMonitor) TagToBeRemoved() error

TagToBeRemoved sets a tag for the instance with: Key: valueOf(DEATH_NODE_TAG_MARK) Value: Current timestamp (epoch)

type MesosMonitor

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

MesosMonitor monitors the mesos cluster, creating a cache to reduce the number of calls against it

func NewMesosMonitor

func NewMesosMonitor(ctx *context.ApplicationContext) *MesosMonitor

NewMesosMonitor returns a new mesos.monitor object

func (*MesosMonitor) HasFrameworks

func (m *MesosMonitor) HasFrameworks(ipAddress, framework string) bool

HasFrameworks returns true if the host has any task from any of the frameworks

func (*MesosMonitor) HasTaskNameMatchRegexp

func (m *MesosMonitor) HasTaskNameMatchRegexp(ipAddress, taskRegexp string) bool

HasTaskNameMatchRegexp returns true if the host has any taskName that match a certain regexp

func (*MesosMonitor) IsProtected

func (m *MesosMonitor) IsProtected(ipAddress string) bool

IsProtected returns true if the mesos agent has any protected condition.

func (*MesosMonitor) Refresh

func (m *MesosMonitor) Refresh()

Refresh updates the mesos cache

func (*MesosMonitor) SetMesosAgentsInMaintenance

func (m *MesosMonitor) SetMesosAgentsInMaintenance(hosts map[string]string) error

SetMesosAgentsInMaintenance sets a list of mesos agents in Maintenance mode

Jump to

Keyboard shortcuts

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