services

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_CPU_LOAD = 75
View Source
const MAX_MEMORY_USED = 75
View Source
const SERVICE_STATUS_REPORT_PERIOD = 30 * time.Second
View Source
const SERVICE_STATUS_REPORT_TIMEOUT = 15 * time.Second

Variables

This section is empty.

Functions

func Bootstrap added in v1.0.0

func Bootstrap(ctx context.Context, flags *config.Flags, logger log.Logger) (*config.Flags, error)

func Execute

func Execute(ctx context.Context, flags *config.Flags, logger log.Logger) (govnr.ShutdownWaiter, error)

func GetSerializedMetrics added in v1.6.0

func GetSerializedMetrics(registry *prometheus.Registry) (value string, err error)

func GetStatusAndMetrics added in v1.6.0

func GetStatusAndMetrics(ctx context.Context, logger log.Logger, flags *config.Flags, startupTimestamp time.Time, dockerStatusPeriod time.Duration) (status StatusResponse, metrics Metrics)

func InitializeAndUpdatePrometheusMetrics added in v1.6.0

func InitializeAndUpdatePrometheusMetrics(registry *prometheus.Registry, metrics Metrics)

func WatchAndReportStatusAndMetrics added in v1.6.0

func WatchAndReportStatusAndMetrics(ctx context.Context, logger log.Logger, flags *config.Flags) govnr.ShutdownWaiter

Types

type BoyarService

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

func NewCoreBoyarService

func NewCoreBoyarService(logger log.Logger) *BoyarService

func (*BoyarService) CheckForUpdates added in v1.8.0

func (coreBoyar *BoyarService) CheckForUpdates(flags *config.Flags, options adapter.ExecutableImageOptions) (shouldExit bool)

func (*BoyarService) OnConfigChange

func (coreBoyar *BoyarService) OnConfigChange(ctx context.Context, cfg config.NodeConfiguration) error

func (*BoyarService) SelfUpdate added in v1.8.0

func (coreBoyar *BoyarService) SelfUpdate(targetPath string, image adapter.ExecutableImageOptions) error

type DiskMetric added in v1.6.0

type DiskMetric struct {
	Mountpoint  string
	TotalMbytes float64
	UsedMbytes  float64
	UsedPercent float64
}

func ReadDiskMetrics added in v1.6.0

func ReadDiskMetrics(logger log.Logger) (diskMetrics []DiskMetric, errors []error)

type Metrics added in v1.6.0

type Metrics struct {
	BoyarUptime       float64
	CPULoadPercent    float64
	MemoryUsedPercent float64
	MemoryUsedMBytes  float64
	MemoryTotalMBytes float64
	EFSAccessTimeMs   uint64
	Disks             []DiskMetric
	Processes         []ProcessMetric
}

func CollectMetrics added in v1.6.0

func CollectMetrics(ctx context.Context, logger log.Logger, startupTimestamp time.Time) (metrics Metrics, aggregateError error)

type ProcessMetric added in v1.11.1

type ProcessMetric struct {
	Name             string
	Command          string
	MemoryUsedMbytes float64
	PID              int32
	ParentPID        int32
}

type PrometheusMetrics added in v1.6.0

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

type StatusResponse added in v1.1.0

type StatusResponse struct {
	Timestamp time.Time
	Status    string
	Error     string
	Payload   map[string]interface{}
}

Jump to

Keyboard shortcuts

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