state

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Score

func Score(state State) float32

Score computes an adjustment factor based on the provided state. This factor is used when computing the overall health of a given system.

Types

type State

type State string

State refers the the current state of a given check.

const (
	// Unknown state is when a check cannot be evaluated.
	Unknown State = "unknown"
	// Outage state is when a check fails and is unhealthy.
	Outage State = "outage"
	// Major state is when a check fails, but it has time before it's critical issue.
	Major State = "major"
	// Minor state is when a check fails, but does not impact the over all behavior of the system.
	Minor State = "minor"
	// OK state is when the check is operating as expected.
	OK State = "ok"
)

func ForScore

func ForScore(score float32) State

ForScore takes a given score and maps it back to the state. A valid score is any value between [0, 1] (inclusively on the ends). This function will never return an `Unknown` state.

Jump to

Keyboard shortcuts

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