health

package
v0.0.0-...-955c50f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 15 Imported by: 11

Documentation

Overview

Package health contains routines that periodically reports health information of the agent

Index

Constants

View Source
const (

	// AgentName is the name of the current agent.
	AgentName = "amazon-ssm-agent"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentState

type AgentState int32

AgentState enumerates active and passive agentMode

const (
	//Active would suggest the agent is going to start with full capacity since SSM can be reached
	Active AgentState = 1
	//Passive would suggest that the agent is in Backoff and the health will be checked based on current capacity
	Passive AgentState = 0
)

type HealthCheck

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

HealthCheck encapsulates the logic on configuring, starting and stopping core modules

func NewHealthCheck

func NewHealthCheck(context context.T, svc ssm.Service) *HealthCheck

NewHealthCheck creates a new health check core module. Only one health core module must exist at a time

func (*HealthCheck) GetAgentState

func (h *HealthCheck) GetAgentState() (a AgentState, err error)

GetAgentState returns the state of the agent. It is the caller's responsibility to log the error

func (*HealthCheck) ModuleExecute

func (h *HealthCheck) ModuleExecute() (err error)

ModuleExecute starts the scheduling of the health check module

func (*HealthCheck) ModuleName

func (h *HealthCheck) ModuleName() string

ModuleName returns the module name

func (*HealthCheck) ModuleStop

func (h *HealthCheck) ModuleStop() (err error)

ModuleStop handles the termination of the health check module job

type IHealthCheck

type IHealthCheck interface {
	ModuleName() string
	ModuleExecute() (err error)
	ModuleStop() (err error)
	GetAgentState() (a AgentState, err error)
}

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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