Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HeartBeatTimeout is the maximum age of a component's heartbeat. // After this time, the heartbeat is considered to be stale and the // component in a bad state. HeartBeatTimeout = 90 * time.Second // HeartBeatWaitTimeout is the maximum amount of time the component will // wait to get a heartbeat. After this time, the component will examine // the last heartbeat received to determine if it has timed out. If so, // the component will be set at a bad state. HeartBeatWaitTimeout = 120 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
Component is a basic statemachine Heartbeat timeout: OK(true)->OK(false) ; OK(false)->OK(false) Heartbeat received: OK(true)->OK(true) ; OK(false)->OK(true)
Once a HeartBeat is received, a component has HeartBeatWaitTimeout until the next heartbeat is received. When that heartbeat is received, it will be checked for recency. If it has not timed out (i.e. the HeartBeat is < 30 seconds old, its state will be the state of the component. If the HeartBeat is stale, it will be discarded and the component will be in a bad state.
func NewComponent ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
func NewMonitor ¶
func (*Monitor) SerializeState ¶
Click to show internal directories.
Click to hide internal directories.