Documentation
¶
Index ¶
- type Interface
- type MockTable
- func (m *MockTable) AddAggregator(agg *aggregator.Aggregator)
- func (m *MockTable) AddBlocklist(matcher *matcher.Matcher)
- func (m *MockTable) AddRewriter(rw rewriter.RW)
- func (m *MockTable) AddRoute(route route.Route)
- func (m *MockTable) DelRoute(key string) error
- func (m *MockTable) GetIn() chan []byte
- func (m *MockTable) GetSpoolDir() string
- func (m *MockTable) UpdateDestination(key string, index int, opts map[string]string) error
- func (m *MockTable) UpdateRoute(key string, opts map[string]string) error
- type Table
- func (table *Table) AddAggregator(agg *aggregator.Aggregator)
- func (table *Table) AddBlocklist(matcher *matcher.Matcher)
- func (table *Table) AddRewriter(rw rewriter.RW)
- func (table *Table) AddRoute(route route.Route)
- func (table *Table) Bad() *badmetrics.BadMetrics
- func (table *Table) DelAggregator(id int) error
- func (table *Table) DelBlocklist(index int) error
- func (table *Table) DelDestination(key string, index int) error
- func (table *Table) DelRewriter(id int) error
- func (table *Table) DelRoute(key string) error
- func (table *Table) Dispatch(buf []byte)
- func (table *Table) DispatchAggregate(buf []byte)
- func (table *Table) Flush() error
- func (table *Table) GetIn() chan []byte
- func (table *Table) GetRoute(key string) route.Route
- func (table *Table) GetSpoolDir() string
- func (table *Table) IncNumInvalid()
- func (table *Table) Print() (str string)
- func (table *Table) Shutdown() error
- func (table *Table) Snapshot() TableSnapshot
- func (table *Table) UpdateDestination(key string, index int, opts map[string]string) error
- func (table *Table) UpdateRoute(key string, opts map[string]string) error
- type TableConfig
- type TableSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶ added in v1.2.1
type Interface interface { AddAggregator(agg *aggregator.Aggregator) AddRewriter(rw rewriter.RW) AddBlocklist(matcher *matcher.Matcher) AddRoute(route route.Route) DelRoute(key string) error UpdateDestination(key string, index int, opts map[string]string) error UpdateRoute(key string, opts map[string]string) error GetIn() chan []byte GetSpoolDir() string }
Interface represents a table abstractly
type MockTable ¶ added in v1.2.1
type MockTable struct { Aggregators []*aggregator.Aggregator Rewriters []rewriter.RW Blocklist []*matcher.Matcher Routes []route.Route }
MockTable is used for tests
func (*MockTable) AddAggregator ¶ added in v1.2.1
func (m *MockTable) AddAggregator(agg *aggregator.Aggregator)
func (*MockTable) AddBlocklist ¶ added in v1.2.1
func (*MockTable) AddRewriter ¶ added in v1.2.1
func (*MockTable) GetSpoolDir ¶ added in v1.2.1
func (*MockTable) UpdateDestination ¶ added in v1.2.1
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(config TableConfig) *Table
func (*Table) AddAggregator ¶
func (table *Table) AddAggregator(agg *aggregator.Aggregator)
func (*Table) AddBlocklist ¶ added in v1.2.1
func (*Table) AddRewriter ¶
func (*Table) Bad ¶
func (table *Table) Bad() *badmetrics.BadMetrics
func (*Table) DelAggregator ¶
func (*Table) DelBlocklist ¶ added in v1.2.1
func (*Table) DelRewriter ¶
func (*Table) Dispatch ¶
Dispatch is the entrypoint to send data into the table. it dispatches incoming metrics into matching aggregators and routes, after checking against the blocklist buf is assumed to have no whitespace at the end
func (*Table) DispatchAggregate ¶
DispatchAggregate dispatches aggregation output by routing metrics into the matching routes. buf is assumed to have no whitespace at the end
func (*Table) GetSpoolDir ¶
func (*Table) IncNumInvalid ¶
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) 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 ¶
type TableConfig ¶
type TableConfig struct { SpoolDir string BadMetricsMaxAge time.Duration Validation_level_legacy validate.LevelLegacy Validation_level_m20 validate.LevelM20 Validate_order bool // contains filtered or unexported fields }
func NewTableConfig ¶ added in v1.2.1
func NewTableConfig(spoolDir, badMetricsMaxAge string, vLegacy validate.LevelLegacy, vM20 validate.LevelM20, vOrder bool) (TableConfig, error)
type TableSnapshot ¶
type TableSnapshot struct { Rewriters []rewriter.RW `json:"rewriters"` Aggregators []*aggregator.Aggregator `json:"aggregators"` Blocklist []*matcher.Matcher `json:"blocklist"` Routes []route.Snapshot `json:"routes"` SpoolDir string }