Documentation ¶
Overview ¶
this is a parser for graphite's storage-schemas.conf it supports old and new retention format see https://graphite.readthedocs.io/en/0.9.9/config-carbon.html#storage-schemas-conf based on https://github.com/grobian/carbonwriter but with some improvements
Index ¶
- func ParseRetentionDefs(retentionDefs string) (whisper.Retentions, error)
- type Schema
- type StoreFunc
- type ThrottleTicker
- type Whisper
- func (p *Whisper) GetMaxUpdatesPerSecond() int
- func (p *Whisper) SetMaxUpdatesPerSecond(maxUpdatesPerSecond int)
- func (p *Whisper) SetMockStore(fn func() (StoreFunc, func()))
- func (p *Whisper) SetSparse(sparse bool)
- func (p *Whisper) SetWorkers(count int)
- func (p *Whisper) Start() error
- func (p *Whisper) Stat(send helper.StatCallback)
- func (p *Whisper) Stop()
- type WhisperAggregation
- type WhisperSchemas
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRetentionDefs ¶
func ParseRetentionDefs(retentionDefs string) (whisper.Retentions, error)
ParseRetentionDefs parses retention definitions into a Retentions structure
Types ¶
type Schema ¶
type Schema struct { Name string Pattern *regexp.Regexp RetentionStr string Retentions whisper.Retentions Priority int64 }
Schema represents one schema setting
type ThrottleTicker ¶
func NewThrottleTicker ¶
func NewThrottleTicker(ratePerSec int) *ThrottleTicker
type Whisper ¶
Whisper write data to *.wsp files
func NewWhisper ¶
func NewWhisper( rootPath string, schemas WhisperSchemas, aggregation *WhisperAggregation, recv func(chan bool) *points.Points, confirm func(*points.Points)) *Whisper
NewWhisper create instance of Whisper
func (*Whisper) GetMaxUpdatesPerSecond ¶
GetMaxUpdatesPerSecond returns current throttling speed
func (*Whisper) SetMaxUpdatesPerSecond ¶
SetMaxUpdatesPerSecond enable throttling
func (*Whisper) SetMockStore ¶
type WhisperAggregation ¶
type WhisperAggregation struct { Data []*whisperAggregationItem Default *whisperAggregationItem }
WhisperAggregation ...
func NewWhisperAggregation ¶
func NewWhisperAggregation() *WhisperAggregation
NewWhisperAggregation create instance of WhisperAggregation
func ReadWhisperAggregation ¶
func ReadWhisperAggregation(file string) (*WhisperAggregation, error)
ReadWhisperAggregation ...
type WhisperSchemas ¶
type WhisperSchemas []Schema
WhisperSchemas contains schema settings
func ReadWhisperSchemas ¶
func ReadWhisperSchemas(file string) (WhisperSchemas, error)
ReadWhisperSchemas reads and parses a storage-schemas.conf file and returns a sorted schemas structure see https://graphite.readthedocs.io/en/0.9.9/config-carbon.html#storage-schemas-conf
func (WhisperSchemas) Len ¶
func (s WhisperSchemas) Len() int
func (WhisperSchemas) Less ¶
func (s WhisperSchemas) Less(i, j int) bool
func (WhisperSchemas) Match ¶
func (s WhisperSchemas) Match(metric string) (Schema, bool)
Match finds the schema for metric or returns false if none found
func (WhisperSchemas) Swap ¶
func (s WhisperSchemas) Swap(i, j int)