siren

package module
v0.0.0-...-96b44d4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

README

Siren

A pluggable framework for building time series data reactors.

Documentation

Index

Constants

View Source
const (
	STATE_CLEAR = iota
	STATE_ALARM
	STATE_FLAPPING
)
View Source
const (
	SHAPE_DURATION = iota
	SHAPE_COUNTER
	SHAPE_RATE
)
View Source
const (
	REL_ABOVE_OR_EQUAL = iota
	REL_ABOVE
	REL_BELOW
)
View Source
const (
	COMP_LESSER = iota
	COMP_LESSEREQUAL
	COMP_GREATER
	COMP_GREATEREQUAL
)

Variables

This section is empty.

Functions

func Activate

func Activate(ctx context.Context, monitor Monitor)

func ClearAll

func ClearAll()

func Deactivate

func Deactivate(monitor Monitor)

func RegisterBackend

func RegisterBackend(name string, f Backend)

Types

type Action

type Action func(ctx context.Context, monitor Monitor)

type Backend

type Backend func(context context.Context, query string) ([]float64, error)

type Comparator

type Comparator func(p float64, threshold float64) bool

type Condition

type Condition struct {
	Threshold    float64
	Count        uint
	ClearCount   uint
	ComparatorID int
}

func (Condition) Comparator

func (c Condition) Comparator() Comparator

type Metric

type Metric struct {
	Shape   int
	Backend string
	Query   string
}

type Monitor

type Monitor struct {
	ID              string
	Metadata        map[string]interface{}
	Trigger         Metric
	Alarm           Condition
	AlarmActions    []Action `json:"-"`
	ClearActions    []Action `json:"-"`
	FlappingActions []Action `json:"-"`
	Suppressed      bool
	Period          time.Duration
}

type Notice

type Notice struct {
	MonitorID string
	Metadata  map[string]interface{}
	State     int
}

type Stateful

type Stateful interface {
	State() int
}

type Suppressable

type Suppressable interface {
	Suppress() error
}

Directories

Path Synopsis
action
docker/scale
This package does not support edge based actions.
This package does not support edge based actions.
backend

Jump to

Keyboard shortcuts

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