table

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: BSD-2-Clause-Views Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 InitFromConfig added in v0.9.0

func InitFromConfig(config cfg.Config, meta toml.MetaData) (*Table, error)

func New

func New(config cfg.Config) *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) Bad added in v0.11.0

func (table *Table) Bad() *badmetrics.BadMetrics

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 is the entrypoint to send data into the table. it 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) GetIn added in v0.9.0

func (table *Table) GetIn() chan []byte

func (*Table) GetRoute

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

func (*Table) GetSpoolDir added in v0.9.0

func (table *Table) GetSpoolDir() string

func (*Table) IncNumInvalid added in v0.11.0

func (table *Table) IncNumInvalid()

This is used by inputs to record invalid packets It also increments numIn so that it reflects the overall total

func (*Table) InitAggregation added in v0.9.0

func (table *Table) InitAggregation(config cfg.Config) error

func (*Table) InitBadMetrics added in v0.11.0

func (table *Table) InitBadMetrics(config cfg.Config) error

func (*Table) InitBlacklist added in v0.9.0

func (table *Table) InitBlacklist(config cfg.Config) error

func (*Table) InitCmd added in v0.9.0

func (table *Table) InitCmd(config cfg.Config) error

func (*Table) InitRewrite added in v0.9.0

func (table *Table) InitRewrite(config cfg.Config) error

func (*Table) InitRoutes added in v0.9.0

func (table *Table) InitRoutes(config cfg.Config, meta toml.MetaData) error

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 {
	Validation_level_legacy validate.LevelLegacy
	Validation_level_m20    validate.LevelM20
	Validate_order          bool
	// 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