healthcheck

package
v0.0.0-...-5167e8f Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceMongoDB     = "MongoDB"
	ServiceRedis       = "Redis"
	ServiceRabbitMQ    = "RabbitMQ"
	ServiceTimescaleDB = "TimescaleDB"
)

Variables

This section is empty.

Functions

func ValidateEngineParameters

func ValidateEngineParameters(sl validator.StructLevel)

func ValidateLimitParameters

func ValidateLimitParameters(sl validator.StructLevel)

Types

type API

type API interface {
	Get(c *gin.Context)
	IsLive(c *gin.Context)
	GetStatus(c *gin.Context)
	GetEnginesOrder(c *gin.Context)
	GetParameters(c *gin.Context)
	UpdateParameters(c *gin.Context)
}

func NewApi

func NewApi(store Store) API

type Edge

type Edge struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type Engine

type Engine struct {
	Name             string            `json:"name,omitempty"`
	Instances        *int              `json:"instances,omitempty"`
	MinInstances     *int              `json:"min_instances,omitempty"`
	OptimalInstances *int              `json:"optimal_instances,omitempty"`
	QueueLength      *int              `json:"queue_length,omitempty"`
	Time             *datetime.CpsTime `json:"time,omitempty" swaggertype:"integer"`

	IsRunning             bool `json:"is_running"`
	IsQueueOverflown      bool `json:"is_queue_overflown"`
	IsTooFewInstances     bool `json:"is_too_few_instances"`
	IsDiffInstancesConfig bool `json:"is_diff_instances_config"`
}

type Engines

type Engines struct {
	Graph      Graph             `json:"graph"`
	Parameters map[string]Engine `json:"parameters"`
}

type Graph

type Graph struct {
	Nodes []string `json:"nodes"`
	Edges []Edge   `json:"edges"`
}

type Info

type Info struct {
	Services []Service `json:"services"`
	Engines  Engines   `json:"engines"`

	MaxQueueLength    int `json:"max_queue_length"`
	MaxMessagesLength int `json:"max_messages_length"`

	HasInvalidEnginesOrder bool `json:"has_invalid_engines_order"`
}

type LiveResponse

type LiveResponse struct {
	Ok bool `json:"ok"`
}

type Service

type Service struct {
	Name      string `json:"name"`
	IsRunning bool   `json:"is_running"`
}

type Status

type Status struct {
	Services []Service `json:"services"`
	Engines  []Engine  `json:"engines"`

	HasInvalidEnginesOrder bool `json:"has_invalid_engines_order"`
}

type Store

type Store interface {
	Load(ctx context.Context)
	GetInfo() Info
	GetStatus() Status
	GetEnginesOrder() Graph
	GetParameters(ctx context.Context) (config.HealthCheckParameters, error)
	UpdateParameters(ctx context.Context, params config.HealthCheckParameters) (config.HealthCheckParameters, error)
}

func NewStore

func NewStore(
	dbClient mongo.DbClient,
	manager engine.RunInfoManager,
	configAdapter config.HealthCheckAdapter,
	configProvider *config.BaseHealthCheckConfigProvider,
	logger zerolog.Logger,
	websocketHub websocket.Hub,
) Store

Jump to

Keyboard shortcuts

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