Documentation
¶
Overview ¶
Package cursor implements the algorithm which moves the detection state forward.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor is a detection state walker.
func (*Cursor) Next ¶
Next moves the state forward for the metric, this operation fills in the metric's score and average, and returns the next state.
If the pervious state is nil, the function regards that there's no state if for the metric, it returns an initialization state.
If the metric count in its series is not large enough to start the detection, the metric will be trusted by setting its score to zero directly.
If the metric behaves normal, the new state will absorb both stddev and average from the metric, how much depends on wf. If the metric behaves as an anomaly, the new state will not absorb stddev from the metric, and absorb less average than usual. Which means that cursor always follows the trending of the metric but rejects drastic trend changes.