healthcheck

package
v0.0.0-...-a288e68 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

OkMemberStates is a slice of acceptable replication member states

Functions

func HealthCheckMongodLiveness

func HealthCheckMongodLiveness(session *mgo.Session, startupDelaySeconds int64) (*status.MemberState, error)

func HealthCheckMongosLiveness

func HealthCheckMongosLiveness(session *mgo.Session) error

func MongosReadinessCheck

func MongosReadinessCheck(session *mgo.Session) error

Types

type InitialSyncStatus

type InitialSyncStatus interface{}

type IsMasterResp

type IsMasterResp struct {
	IsMaster bool   `bson:"ismaster" json:"ismaster"`
	Msg      string `bson:"msg" json:"msg"`

	Ok     int    `bson:"ok" json:"ok"`
	Errmsg string `bson:"errmsg,omitempty" json:"errmsg,omitempty"`
}

type OplogRs

type OplogRs struct {
	StorageSize int64 `bson:"storageSize" json:"storageSize"`

	Ok     int    `bson:"ok" json:"ok"`
	Errmsg string `bson:"errmsg,omitempty" json:"errmsg,omitempty"`
}

type ReplSetStatus

type ReplSetStatus struct {
	status.Status     `bson:",inline"`
	InitialSyncStatus InitialSyncStatus `bson:"initialSyncStatus" json:"initialSyncStatus"`
}

func (ReplSetStatus) CheckState

func (rs ReplSetStatus) CheckState(startupDelaySeconds int64, oplogSize int64) error

type ServerStatus

type ServerStatus struct {
	Ok     int    `bson:"ok" json:"ok"`
	Errmsg string `bson:"errmsg,omitempty" json:"errmsg,omitempty"`
}

type State

type State int
const (
	StateOk State = iota
	StateFailed
)

func HealthCheck

func HealthCheck(session *mgo.Session, okMemberStates []status.MemberState) (State, *status.MemberState, error)

HealthCheck checks the replication member state of the local MongoDB member

func ReadinessCheck

func ReadinessCheck(session *mgo.Session) (State, error)

ReadinessCheck runs a ping on a pmgo.SessionManager to check server readiness

func (State) ExitCode

func (s State) ExitCode() int

ExitCode returns an integer reflecting the State, to be used as an exit code

Jump to

Keyboard shortcuts

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