db

package
v1.5.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CurrentMode = normalMode // default mode

)

Functions

func CheckOccurrences added in v0.2.0

func CheckOccurrences(occurrences []int64, numTimes, numSecs int) (occurred bool)

CheckOccurrences : check if this occurred numTimes times in numSecs seconds

func HandleEmbeddedRecovery added in v0.1.10

func HandleEmbeddedRecovery(forceNormal, forceDegraded bool, currTime int64, appType string) error

HandleEmbeddedRecovery decides the recovery Mode in which app should run based on earlier crashes

func HandleNullRecovery added in v0.1.10

func HandleNullRecovery(forceNormal, forceDegraded bool, currTime int64, appType string) error

HandleNullRecovery decides the recovery Mode (normal/degraded) in which app should run

func Init added in v0.1.10

func Init()

func IsNormalMode

func IsNormalMode() bool

IsNormalMode checks if the current mode is normal

Types

type DegradedModeHandler

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

func (*DegradedModeHandler) Handle

func (*DegradedModeHandler) Handle()

func (*DegradedModeHandler) HasThresholdReached

func (*DegradedModeHandler) HasThresholdReached() bool

func (*DegradedModeHandler) RecordAppStart

func (handler *DegradedModeHandler) RecordAppStart(currTime int64)

type NormalModeHandler

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

func (*NormalModeHandler) Handle

func (*NormalModeHandler) Handle()

func (*NormalModeHandler) HasThresholdReached

func (handler *NormalModeHandler) HasThresholdReached() bool

func (*NormalModeHandler) RecordAppStart

func (handler *NormalModeHandler) RecordAppStart(currTime int64)

type RecoveryDataT

type RecoveryDataT struct {
	StartTimes                     []int64
	ReadableStartTimes             []string
	DegradedModeStartTimes         []int64
	ReadableDegradedModeStartTimes []string
	Mode                           string
}

RecoveryDataT : DS to store the recovery process data

type RecoveryHandler

type RecoveryHandler interface {
	RecordAppStart(int64)
	HasThresholdReached() bool
	Handle()
}

func NewRecoveryHandler

func NewRecoveryHandler(recoveryData *RecoveryDataT) RecoveryHandler

Jump to

Keyboard shortcuts

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