healthchecker

package
v0.25.33 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCard

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

func (*HealthCard) Clear

func (hcf *HealthCard) Clear()

Clear is used to reset the error counter. Call this method after each successful health check.

func (*HealthCard) ClientClosed

func (hcf *HealthCard) ClientClosed()

ClientClosed is used to track the client which are closed on the health check. Call this method after a client is successfully closed in the health check.

func (*HealthCard) ClientCreated

func (hcf *HealthCard) ClientCreated()

ClientCreated is used to track the client which are created on the health check. Call this method after a client is successfully created in the health check.

func (*HealthCard) GetClientCount

func (hcf *HealthCard) GetClientCount() int32

GetClientCount is used to get the current open client count. This should always be 0.

func (*HealthCard) HasFailed

func (hcf *HealthCard) HasFailed(label HealthCheckFailureLabel, err error) bool

HasFailed returns true or false based on the threshold. Update the health check condition if this function returns true.

func (*HealthCard) SetThreshold

func (hcf *HealthCard) SetThreshold(threshold int32)

SetThreshold sets the current failure threshold. Call this function on the start of each health check.

type HealthCheckFailureLabel

type HealthCheckFailureLabel string
const (
	HealthCheckClientFailure  HealthCheckFailureLabel = "ClientFailure"
	HealthCheckPingFailure    HealthCheckFailureLabel = "PingFailure"
	HealthCheckWriteFailure   HealthCheckFailureLabel = "WriteFailure"
	HealthCheckReadFailure    HealthCheckFailureLabel = "ReadFailure"
	HealthCheckPrimaryFailure HealthCheckFailureLabel = "PrimaryFailure"

	// replica
	HealthCheckReplicaFailure HealthCheckFailureLabel = "ReplicaFailure"

	// MariaDB Constants
	HealthCheckClusterFailure HealthCheckFailureLabel = "ClusterFailure"

	// Redis Constants
	HealthCheckClusterSlotFailure   HealthCheckFailureLabel = "ClusterSlotFailure"
	HealthCheckNodesNotReadyFailure HealthCheckFailureLabel = "NodesNotReadyFailure"

	// Write Check Constants
	KubeDBSystemDatabase  = "kubedb_system"
	KubeDBWriteCheckTable = "kubedb_write_check"
)

type HealthChecker

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

func NewHealthChecker

func NewHealthChecker() *HealthChecker

func (*HealthChecker) Start

func (hc *HealthChecker) Start(key string, healthCheckSpec dbapi.HealthCheckSpec, fn func(string, *HealthCard))

Start creates a health check go routine. Call this method after successful creation of all the replicas of a database.

func (*HealthChecker) Stop

func (hc *HealthChecker) Stop(key string)

Stop stops a health check go routine. Call this method when the database is deleted or halted.

Jump to

Keyboard shortcuts

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