checkclientsarehealthy

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: GPL-3.0 Imports: 9 Imported by: 1

README

check_clients_are_healthy Task

Description

The check_clients_are_healthy task is designed to ensure the health of specified clients. It verifies if the clients are reachable and synchronized on the same network.

Configuration Parameters

  • clientPattern:
    A regular expression pattern used to specify which clients to check. This allows for targeted health checks of specific clients or groups of clients within the network. A blank pattern targets all clients.

  • pollInterval:
    The interval at which the health check is performed. Set this to define how frequently the task should check the clients' health.

  • skipConsensusCheck:
    A boolean value that, when set to true, skips the health check for consensus clients. Useful if you only want to focus on execution clients.

  • skipExecutionCheck:
    A boolean value that, when set to true, skips the health check for execution clients. Use this to exclusively check the health of consensus clients.

  • expectUnhealthy:
    A boolean value that inverts the expected result of the health check. When true, the task succeeds if the clients are not ready or unhealthy. This can be useful in test scenarios where client unavailability is expected or being tested.

  • minClientCount:
    The minimum number of clients that must match the clientNamePatterns and pass the health checks for the task to succeed. A value of 0 indicates that all matching clients need to pass the health check. Use this to set a threshold for the number of healthy clients required by your test scenario.

  • maxUnhealthyCount:
    Specifies the maximum number of unhealthy clients allowed before the health check fails. A value of 0 means that any unhealthy client will cause the health check to fail, enforcing strict health criteria.

  • failOnCheckMiss:
    Determines the task's behavior when a health check fails. If true, the task reports a failure upon the first unsuccessful health check. If false, the task continues to poll the clients until a successful check occurs, allowing for temporary issues to be resolved without immediate failure.

Defaults

These are the default settings for the check_clients_are_healthy task:

- name: check_clients_are_healthy
  config:
    clientPattern: ""
    pollInterval: 5s
    skipConsensusCheck: false
    skipExecutionCheck: false
    expectUnhealthy: false
    minClientCount: 0
    maxUnhealthyCount: -1
    failOnCheckMiss: false

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "check_clients_are_healthy"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Checks if clients are healthy.",
		Config:      DefaultConfig(),
		NewTask:     NewTask,
	}
)

Functions

func NewTask

func NewTask(ctx *types.TaskContext, options *types.TaskOptions) (types.Task, error)

Types

type Config

type Config struct {
	ClientPattern      string         `yaml:"clientPattern" json:"clientPattern"`
	PollInterval       human.Duration `yaml:"pollInterval" json:"pollInterval"`
	SkipConsensusCheck bool           `yaml:"skipConsensusCheck" json:"skipConsensusCheck"`
	SkipExecutionCheck bool           `yaml:"skipExecutionCheck" json:"skipExecutionCheck"`
	ExpectUnhealthy    bool           `yaml:"expectUnhealthy" json:"expectUnhealthy"`
	MinClientCount     int            `yaml:"minClientCount" json:"minClientCount"`
	MaxUnhealthyCount  int            `yaml:"maxUnhealthyCount" json:"maxUnhealthyCount"`
	FailOnCheckMiss    bool           `yaml:"failOnCheckMiss" json:"failOnCheckMiss"`
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) Validate

func (c *Config) Validate() error

type Task

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

func (*Task) Config

func (t *Task) Config() interface{}

func (*Task) Description

func (t *Task) Description() string

func (*Task) Execute

func (t *Task) Execute(ctx context.Context) error

func (*Task) LoadConfig

func (t *Task) LoadConfig() error

func (*Task) Logger

func (t *Task) Logger() logrus.FieldLogger

func (*Task) Name

func (t *Task) Name() string

func (*Task) Timeout

func (t *Task) Timeout() time.Duration

func (*Task) Title

func (t *Task) Title() string

Jump to

Keyboard shortcuts

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