Documentation
¶
Overview ¶
Package collector provides functions to collect statistics about queries, filters and more
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface { // GetEntries returns a slice of query stats which // the collector currently has stored in memory GetEntries() ([]Entry, error) // AddEntry adds a new query entry to the // collector AddEntry(Entry) error // FlushEntries flushes in-memory entries // via the store interface (to disk) FlushEntries() error // Run runs the flush interval Run() }
Collector describes an interface which is able to collect stats about queries, filters and more. The collector first stores this data in memory. At every persistence interval this data gets persisted via the CollectorStore interface
type DefaultCollector ¶
type DefaultCollector struct { Store Store Interval time.Duration LastFlush time.Time MaxEntries int Anonymize bool Enabled bool // contains filtered or unexported fields }
func NewCollector ¶
func NewCollector(opt config.CollectorOptions) *DefaultCollector
func (*DefaultCollector) AddEntry ¶
func (c *DefaultCollector) AddEntry(entry Entry) error
func (*DefaultCollector) FlushEntries ¶
func (c *DefaultCollector) FlushEntries() error
func (*DefaultCollector) GetEntries ¶
func (c *DefaultCollector) GetEntries() ([]Entry, error)
func (*DefaultCollector) Run ¶
func (c *DefaultCollector) Run()
type DefaultStore ¶
type DefaultStore struct { }
DefaultStore discards flushed entries
func NewStore ¶
func NewStore() *DefaultStore
func (*DefaultStore) Prepare ¶
func (s *DefaultStore) Prepare() error
func (*DefaultStore) StoreEntries ¶
func (s *DefaultStore) StoreEntries(_ []Entry) error
type Entry ¶
type Entry struct { ID string Question dns.Question Answer []rr.RR QueryTime time.Duration ClientIP net.IP AppliedFilter string Filtered bool Cached bool }
func NewCachedEntry ¶
type MySQLStore ¶
type MySQLStore struct {
// contains filtered or unexported fields
}
MySQLStore stores flushed entries to a MySLQ / MariaDB database
func (*MySQLStore) StoreEntries ¶
func (s *MySQLStore) StoreEntries(entries []Entry) error
Click to show internal directories.
Click to hide internal directories.