Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HTTP will make an HTTP request // to some data source to test a guard HTTP Kind = iota // Query Means query a data source Query // OK means the guard was not triggered OK Status = iota // Failing status can be used when any status in the window // has failed Failing // Failed means the guard was triggered Failed // Warn will send a warning Warn Action = iota // Alert will trigger an alert Alert // Abort will unsafely and suddenly end the guarded operation Abort // Teardown will safely begin teardown for any guarded operation Teardown // DefaultPollInterval is the default checking interval // for a guide DefaultPollInterval = time.Second * 1 // DefaultIntegration is the default integration to use DefaultIntegration = "cloudwatch" // DefaultKind is the default guard type to use DefaultKind = Query // DefaultWindowSize is the default windowSize to keep of // historical statuses DefaultWindowSize = 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Guard ¶
type Guard struct { Kind Kind `json:"kind"` Name string `json:"name"` Status Status `json:"status"` StatusDistribution []Status `json:"statusDist"` Count int `json:"count"` Threshold int `json:"threshold"` Interval time.Duration `json:"interval"` WindowSize int `json:"windowSize"` Tolerance float32 `json:"tolerance"` Spec interface{} `json:"spec"` Integration string `json:"integration"` Err error // contains filtered or unexported fields }
Guard is a mechanism for watching some data and using that as signal to see if
func (*Guard) Evaluate ¶
Evaluate uses the distribution of previous checks to see if we cross a defined threshold for the guard. Needs improving
Click to show internal directories.
Click to hide internal directories.