cursor

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2016 License: MIT Imports: 2 Imported by: 0

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 New

func New(wf float64, leastC uint32) *Cursor

New create a cursor.

func (*Cursor) Next

func (c *Cursor) Next(s *models.State, m *models.Metric) *models.State

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.

Jump to

Keyboard shortcuts

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