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) SetCompressed(compressed bool)
- func (p *Whisper) SetFLock(flock bool)
- func (p *Whisper) SetHardMaxCreatesPerSecond(hardMaxCreatesPerSecond bool)
- func (p *Whisper) SetHashFilenames(v bool)
- func (p *Whisper) SetMaxCreatesPerSecond(maxCreatesPerSecond int)
- func (p *Whisper) SetMaxUpdatesPerSecond(maxUpdatesPerSecond int)
- func (p *Whisper) SetMockStore(fn func() (StoreFunc, func()))
- func (p *Whisper) SetRemoveEmptyFile(remove bool)
- func (p *Whisper) SetSparse(sparse bool)
- func (p *Whisper) SetTaggedFn(fn func(string, bool))
- func (p *Whisper) SetTagsEnabled(v 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 WhisperAggregationItem
- type WhisperSchemas
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRetentionDefs ¶
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 Compressed *bool }
Schema represents one schema setting
type ThrottleTicker ¶
ThrottleTicker is a ticker that can be used for hard or soft rate-limiting.
- A soft rate limiter will send a message on C at the actual rate that is specified.
- A hard rate limiter may send arbitrarily many messages on C every second, but it will send the value 'true' with the first ratePerSec ones, and 'false' with all subsequent ones, until the next second. It is up to the user to decide what to do in each case.
func NewHardThrottleTicker ¶
func NewHardThrottleTicker(ratePerSec int) *ThrottleTicker
NewHardThrottleTicker returns a new hard throttle ticker.
func NewSoftThrottleTicker ¶
func NewSoftThrottleTicker(ratePerSec int) *ThrottleTicker
NewSoftThrottleTicker returns a new soft throttle ticker.
func NewThrottleTicker ¶
func NewThrottleTicker(ratePerSec int) *ThrottleTicker
NewThrottleTicker returns a new soft throttle ticker.
type Whisper ¶
Whisper write data to *.wsp files
func NewWhisper ¶
func NewWhisper( rootPath string, schemas WhisperSchemas, aggregation *WhisperAggregation, recv func(chan bool) string, pop func(string) (*points.Points, bool), confirm func(*points.Points), popConfirm func(string) (*points.Points, bool)) *Whisper
NewWhisper create instance of Whisper
func (*Whisper) GetMaxUpdatesPerSecond ¶
GetMaxUpdatesPerSecond returns current throttling speed
func (*Whisper) SetCompressed ¶
func (*Whisper) SetHardMaxCreatesPerSecond ¶
SetHardMaxCreatesPerSecond enable throttling
func (*Whisper) SetHashFilenames ¶
func (*Whisper) SetMaxCreatesPerSecond ¶
SetMaxCreatesPerSecond enable throttling
func (*Whisper) SetMaxUpdatesPerSecond ¶
SetMaxUpdatesPerSecond enable throttling
func (*Whisper) SetMockStore ¶
func (*Whisper) SetRemoveEmptyFile ¶
func (*Whisper) SetTaggedFn ¶
func (*Whisper) SetTagsEnabled ¶
type WhisperAggregation ¶
type WhisperAggregation struct { Data []*WhisperAggregationItem Default *WhisperAggregationItem }
WhisperAggregation ...
func NewWhisperAggregation ¶
func NewWhisperAggregation() *WhisperAggregation
NewWhisperAggregation create instance of WhisperAggregation
func ReadWhisperAggregation ¶
func ReadWhisperAggregation(filename string) (*WhisperAggregation, error)
ReadWhisperAggregation ...
func (*WhisperAggregation) Match ¶
func (a *WhisperAggregation) Match(metric string) *WhisperAggregationItem
Match find schema for metric
type WhisperAggregationItem ¶
type WhisperAggregationItem struct {
// contains filtered or unexported fields
}
WhisperAggregationItem ...
func (*WhisperAggregationItem) AggregationMethod ¶
func (wai *WhisperAggregationItem) AggregationMethod() whisper.AggregationMethod
AggregationMethod get aggregation method
func (*WhisperAggregationItem) Name ¶
func (wai *WhisperAggregationItem) Name() string
Name get name of aggregation method
func (*WhisperAggregationItem) Pattern ¶
func (wai *WhisperAggregationItem) Pattern() *regexp.Regexp
Pattern get aggregation pattern
func (*WhisperAggregationItem) XFilesFactor ¶
func (wai *WhisperAggregationItem) XFilesFactor() float64
XFilesFactor get aggregation xFilesFactor
type WhisperSchemas ¶
type WhisperSchemas []Schema
WhisperSchemas contains schema settings
func ReadWhisperSchemas ¶
func ReadWhisperSchemas(filename 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)