pipeline

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2016 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	INTERNAL_TAG_NAME = "INTERNAL"
)
View Source
const (
	KEEP_ALIVE_INTERNAL_TAG = "KeepAlive"
)

Variables

View Source
var (
	DefaultKeepAliveCheckTime = 1 * time.Minute
)
View Source
var (
	EMPTY_SUB_SERVICE = ""
)

Functions

This section is empty.

Types

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

Pipeline

func NewPipeline

func NewPipeline() *Pipeline

NewPipeline returns a pipeline that is empty of any configuation but will still pass events though

func (*Pipeline) Dedupe

func (p *Pipeline) Dedupe(i *event.Incident) bool

returns true if this is a new incident, false if it is a duplicate

func (*Pipeline) GetIndex added in v0.15.0

func (p *Pipeline) GetIndex() *event.Index

func (*Pipeline) GetTracker

func (p *Pipeline) GetTracker() *Tracker

GetTracker returns the pipeline's tracker

func (*Pipeline) ListIncidents

func (p *Pipeline) ListIncidents() []*event.Incident

func (*Pipeline) PassEvent added in v0.15.0

func (p *Pipeline) PassEvent(e *event.Event)

func (*Pipeline) PassIncident added in v0.15.0

func (p *Pipeline) PassIncident(in *event.Incident)

ProcessIncident relays the incident into the pipeline for processing

func (*Pipeline) Pause added in v0.15.0

func (p *Pipeline) Pause()

Pause stops the pipeline and buffers incomming events

func (*Pipeline) PutIncident

func (p *Pipeline) PutIncident(in *event.Incident)

func (*Pipeline) Refresh added in v0.15.0

func (p *Pipeline) Refresh(conf *config.AppConfig)

refresh load all config params that don't require a restart

func (*Pipeline) RemovePolicy added in v0.15.0

func (p *Pipeline) RemovePolicy(name string)

RemovePolicy will stop and remove the policy if it exists

func (*Pipeline) Start

func (p *Pipeline) Start()

Start consumes events as they are sent to the pipeline

func (*Pipeline) Unpause added in v0.15.0

func (p *Pipeline) Unpause()

Unpause restarts the pipeline and runs the buffered events through the pipeline

func (*Pipeline) UpdateConfig added in v0.15.0

func (p *Pipeline) UpdateConfig(f func(c *config.AppConfig) error, u *config.User) error

UpdateConfig gives access to a copy ofthe pipeline, if no error is returned fron the closure, the pipeline will be refreshed with the given app config

func (*Pipeline) ViewConfig added in v0.15.0

func (p *Pipeline) ViewConfig(f func(c *config.AppConfig))

ViewConfig gives access to a read only copy of the current config through a closure

type QueryFunc

type QueryFunc func(t *Tracker)

An function that is given access to the tracker without locks

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

Provides stat tracking for events

func NewTracker

func NewTracker() *Tracker

create and return a new *Tracker

func (*Tracker) GetIncidentResolver added in v0.15.0

func (t *Tracker) GetIncidentResolver(i *event.Incident) chan *event.Incident

func (*Tracker) GetStats

func (t *Tracker) GetStats() *TrackerReport

return a report of the current state of the tracker

func (*Tracker) GetTag added in v0.15.0

func (t *Tracker) GetTag(tag string) []string

func (*Tracker) ListTags added in v0.15.0

func (t *Tracker) ListTags() []string

ListTags

func (*Tracker) Query

func (t *Tracker) Query(f QueryFunc)

Query exicutes the given QueryFunc ayncronously

func (*Tracker) QueryAsync added in v0.15.0

func (t *Tracker) QueryAsync(f QueryFunc)

QueryAsync exicutes the given QueryFunc asyncronously

func (*Tracker) RemoveTag added in v0.15.0

func (t *Tracker) RemoveTag(tag, key string)

func (*Tracker) Start

func (t *Tracker) Start()

Start the tracker. This should be done in it's own goroutine

func (*Tracker) Started added in v0.15.0

func (t *Tracker) Started() bool

func (*Tracker) TagTimes added in v0.15.0

func (t *Tracker) TagTimes(tag string) map[string]time.Time

func (*Tracker) TrackEvent

func (t *Tracker) TrackEvent(e *event.Event)

Process the stats for a given event

func (*Tracker) TrackIncident added in v0.15.0

func (t *Tracker) TrackIncident(i *event.Incident)

TrackIncident will allow the tracker to keep state about an incident

type TrackerReport

type TrackerReport struct {
	Total         uint64                       `json:"total_events"`
	CountByTag    map[string]map[string]uint64 `json:"count_by_tag"`
	LastSeenByTag map[string]map[string]int64  `json:"last_seen_by_tag"`
}

holds information about the current state of an event tracker

func NewReport

func NewReport() *TrackerReport

Jump to

Keyboard shortcuts

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