filter

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2016 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TotalMetricsReceived    metrics.Meter
	ValidMetricsReceived    metrics.Meter
	MatchingMetricsReceived metrics.Meter
	MatchingTimer           metrics.Timer
	SavingTimer             metrics.Timer
	BuildTreeTimer          metrics.Timer
)
View Source
var LogParseErrors bool

LogParseErrors flag to log parse errors

Functions

func GetMetricDbKey

func GetMetricDbKey(metric string) string

GetMetricDbKey returns string redis key for metric

func GetMetricRetentionDbKey

func GetMetricRetentionDbKey(metric string) string

GetMetricRetentionDbKey returns string redis key for metric retention

func InitGraphiteMetrics

func InitGraphiteMetrics()

InitGraphiteMetrics initialize graphite metrics

func UpdateProcessingMetrics

func UpdateProcessingMetrics()

UpdateProcessingMetrics update processing metrics on demand

Types

type CacheStorage

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

func NewCacheStorage

func NewCacheStorage(retentionConfigFile *os.File) (*CacheStorage, error)

NewCacheStorage create new CacheStorage

func (*CacheStorage) BuildRetentions

func (cs *CacheStorage) BuildRetentions(retentionScanner *bufio.Scanner) error

BuildRetentions build cache storage retention matchers

func (*CacheStorage) Save

func (cs *CacheStorage) Save(ch chan *MatchedMetric, save func([]*MatchedMetric))

Save buffered save matched metrics

func (*CacheStorage) SavePoints

func (cs *CacheStorage) SavePoints(buffer []*MatchedMetric, db *DbConnector) error

SavePoints saving matched metrics to DB

type DbConnector

type DbConnector struct {
	Pool *redis.Pool
	// contains filtered or unexported fields
}

DbConnector is DB layer client

func NewDbConnector

func NewDbConnector(pool *redis.Pool) *DbConnector

NewDbConnector return db connector

type MatchedMetric

type MatchedMetric struct {
	Metric             string
	Patterns           []string
	Value              float64
	Timestamp          int64
	RetentionTimestamp int64
	Retention          int
}

MatchedMetric represent parsed and matched metric data

type PatternNode

type PatternNode struct {
	Children   []*PatternNode
	Part       string
	Hash       uint32
	Prefix     string
	InnerParts []string
}

type PatternStorage

type PatternStorage struct {
	PatternTree *PatternNode
}

PatternStorage contains pattern tree

func NewPatternStorage

func NewPatternStorage() *PatternStorage

NewPatternStorage creates new PatternStorage struct

func (*PatternStorage) DoRefresh

func (t *PatternStorage) DoRefresh(db *DbConnector) error

DoRefresh builds pattern tree from redis data

func (*PatternStorage) MatchPattern

func (t *PatternStorage) MatchPattern(metric []byte) []string

MatchPattern returns array of matched patterns

func (*PatternStorage) ProcessIncomingMetric

func (t *PatternStorage) ProcessIncomingMetric(lineBytes []byte) *MatchedMetric

ProcessIncomingMetric process "metric value [timestamp]" raw line

func (*PatternStorage) Refresh

func (t *PatternStorage) Refresh(db *DbConnector)

Refresh run infinite refresh of patterns tree

Jump to

Keyboard shortcuts

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