table

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2017 License: BSD-2-Clause-Views Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l *logging.Logger)

Types

type Table

type Table struct {
	sync.Mutex // only needed for the multiple writers

	SpoolDir string

	In chan []byte `json:"-"` // channel api to trade in some performance for encapsulation, for aggregators
	// contains filtered or unexported fields
}

func New

func New(spoolDir string) *Table

func (*Table) AddAggregator

func (table *Table) AddAggregator(agg *aggregator.Aggregator)

func (*Table) AddBlacklist

func (table *Table) AddBlacklist(matcher *matcher.Matcher)

func (*Table) AddRewriter

func (table *Table) AddRewriter(rw rewriter.RW)

func (*Table) AddRoute

func (table *Table) AddRoute(route route.Route)

AddRoute adds a route to the table. The Route must be running already

func (*Table) DelAggregator

func (table *Table) DelAggregator(id int) error

func (*Table) DelBlacklist

func (table *Table) DelBlacklist(index int) error

func (*Table) DelDestination

func (table *Table) DelDestination(key string, index int) error

func (*Table) DelRewriter

func (table *Table) DelRewriter(id int) error

func (*Table) DelRoute

func (table *Table) DelRoute(key string) error

idempotent semantics, not existing is fine

func (*Table) Dispatch

func (table *Table) Dispatch(buf []byte)

Dispatch dispatches incoming metrics into matching aggregators and routes, after checking against the blacklist buf is assumed to have no whitespace at the end

func (*Table) DispatchAggregate

func (table *Table) DispatchAggregate(buf []byte)

DispatchAggregate dispatches aggregation output by routing metrics into the matching routes. buf is assumed to have no whitespace at the end

func (*Table) Flush

func (table *Table) Flush() error

func (*Table) GetRoute

func (table *Table) GetRoute(key string) route.Route

func (*Table) Print

func (table *Table) Print() (str string)

func (*Table) Shutdown

func (table *Table) Shutdown() error

func (*Table) Snapshot

func (table *Table) Snapshot() TableSnapshot

to view the state of the table/route at any point in time we might add more functions to view specific entries if the need for that appears

func (*Table) UpdateDestination

func (table *Table) UpdateDestination(key string, index int, opts map[string]string) error

func (*Table) UpdateRoute

func (table *Table) UpdateRoute(key string, opts map[string]string) error

type TableConfig

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

type TableSnapshot

type TableSnapshot struct {
	Rewriters   []rewriter.RW            `json:"rewriters"`
	Aggregators []*aggregator.Aggregator `json:"aggregators"`
	Blacklist   []*matcher.Matcher       `json:"blacklist"`
	Routes      []route.Snapshot         `json:"routes"`
	SpoolDir    string
}

Jump to

Keyboard shortcuts

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