Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TotalMetricsReceived metrics.Meter ValidMetricsReceived metrics.Meter MatchingMetricsReceived metrics.Meter MatchingTimer metrics.Timer SavingTimer metrics.Timer BuildTreeTimer metrics.Timer )
var LogParseErrors bool
LogParseErrors flag to log parse errors
Functions ¶
func GetMetricDbKey ¶
GetMetricDbKey returns string redis key for metric
func GetMetricRetentionDbKey ¶
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 ¶
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