monitor

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheck

type HealthCheck struct {
	Endpoint  string
	Status    HealthStatus
	Latency   time.Duration
	Error     error
	Timestamp time.Time
}

HealthCheck represents a health check result

type HealthMonitor

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

HealthMonitor monitors the health of the core service

func NewHealthMonitor

func NewHealthMonitor(endpoint string, logger *zap.SugaredLogger, stateMachine *state.Machine) *HealthMonitor

NewHealthMonitor creates a new health monitor

func (*HealthMonitor) GetLastCheck

func (hm *HealthMonitor) GetLastCheck() time.Time

GetLastCheck returns the time of the last health check

func (*HealthMonitor) GetLastError

func (hm *HealthMonitor) GetLastError() error

GetLastError returns the last health check error

func (*HealthMonitor) GetStatus

func (hm *HealthMonitor) GetStatus() HealthStatus

GetStatus returns the current health status

func (*HealthMonitor) IsHealthy

func (hm *HealthMonitor) IsHealthy() bool

IsHealthy returns true if the service is healthy

func (*HealthMonitor) IsReady

func (hm *HealthMonitor) IsReady() bool

IsReady returns true if the service is ready

func (*HealthMonitor) IsStarting

func (hm *HealthMonitor) IsStarting() bool

IsStarting returns true if the service is starting up

func (*HealthMonitor) ResultsChannel

func (hm *HealthMonitor) ResultsChannel() <-chan HealthCheck

ResultsChannel returns a channel for receiving health check results

func (*HealthMonitor) SetCheckInterval

func (hm *HealthMonitor) SetCheckInterval(interval time.Duration)

SetCheckInterval sets the health check interval

func (*HealthMonitor) SetReadinessTimeout

func (hm *HealthMonitor) SetReadinessTimeout(timeout time.Duration)

SetReadinessTimeout sets the readiness wait timeout

func (*HealthMonitor) SetTimeout

func (hm *HealthMonitor) SetTimeout(timeout time.Duration)

SetTimeout sets the health check timeout

func (*HealthMonitor) Start

func (hm *HealthMonitor) Start()

Start starts the health monitoring

func (*HealthMonitor) Stop

func (hm *HealthMonitor) Stop()

Stop stops the health monitoring (safe to call multiple times)

func (*HealthMonitor) WaitForReady

func (hm *HealthMonitor) WaitForReady() error

WaitForReady waits for the service to become ready within the timeout

type HealthStatus

type HealthStatus string

HealthStatus represents the health status of the core service

const (
	HealthStatusUnknown     HealthStatus = "unknown"
	HealthStatusStarting    HealthStatus = "starting"
	HealthStatusHealthy     HealthStatus = "healthy"
	HealthStatusUnhealthy   HealthStatus = "unhealthy"
	HealthStatusUnavailable HealthStatus = "unavailable"
)

Jump to

Keyboard shortcuts

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