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 Quota
- type Schema
- type StoreFunc
- type Whisper
- func (p *Whisper) CheckPolicyConsistencies(rate int, printInconsistentMetrics bool) error
- func (p *Whisper) EnableOnlineMigration(rate int, scope []string)
- func (p *Whisper) GetAggrConf(metric string) (string, float64, bool)
- func (p *Whisper) GetRetentionPeriod(metric string) (int, bool)
- func (p *Whisper) InitPrometheus(reg prometheus.Registerer)
- func (p *Whisper) SetCompressed(compressed bool)
- func (p *Whisper) SetFLock(flock bool)
- func (p *Whisper) SetHashFilenames(v bool)
- 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 WhisperQuotas
- 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 Quota ¶ added in v0.16.0
type Quota struct { Pattern string Namespaces int64 Metrics int64 LogicalSize int64 PhysicalSize int64 DataPoints int64 Throughput int64 DroppingPolicy string StatMetricPrefix string }
Quota represents one quota setting.
type Schema ¶ added in v0.7.2
type Schema struct { Name string Pattern *regexp.Regexp RetentionStr string Retentions whisper.Retentions Priority int64 Compressed *bool // If not specified, migration flag is controlled by the global // migration flag set in persister.Whisper Migration *bool }
Schema represents one schema setting
type Whisper ¶
Whisper write data to *.wsp files
func NewWhisper ¶
func (*Whisper) CheckPolicyConsistencies ¶ added in v0.17.0
skipcq: RVV-A0005
func (*Whisper) EnableOnlineMigration ¶ added in v0.17.0
SetOnlineMigration enable online migration
func (*Whisper) GetAggrConf ¶ added in v0.15.0
func (*Whisper) GetRetentionPeriod ¶ added in v0.15.0
func (*Whisper) InitPrometheus ¶ added in v0.17.0
func (p *Whisper) InitPrometheus(reg prometheus.Registerer)
func (*Whisper) SetCompressed ¶ added in v0.15.0
func (*Whisper) SetHashFilenames ¶ added in v0.12.0
func (*Whisper) SetMaxUpdatesPerSecond ¶ added in v0.4.3
SetMaxUpdatesPerSecond
func (*Whisper) SetMockStore ¶ added in v0.8.0
func (*Whisper) SetRemoveEmptyFile ¶ added in v0.15.0
func (*Whisper) SetTaggedFn ¶ added in v0.14.0
func (*Whisper) SetTagsEnabled ¶ added in v0.12.0
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 ¶ added in v0.15.0
func (a *WhisperAggregation) Match(metric string) *WhisperAggregationItem
Match find schema for metric
type WhisperAggregationItem ¶ added in v0.15.0
type WhisperAggregationItem struct {
// contains filtered or unexported fields
}
WhisperAggregationItem ...
func (*WhisperAggregationItem) AggregationMethod ¶ added in v0.15.0
func (wai *WhisperAggregationItem) AggregationMethod() whisper.AggregationMethod
AggregationMethod get aggregation method
func (*WhisperAggregationItem) Name ¶ added in v0.15.0
func (wai *WhisperAggregationItem) Name() string
Name get name of aggregation method
func (*WhisperAggregationItem) Pattern ¶ added in v0.15.0
func (wai *WhisperAggregationItem) Pattern() *regexp.Regexp
Pattern get aggregation pattern
func (*WhisperAggregationItem) XFilesFactor ¶ added in v0.15.0
func (wai *WhisperAggregationItem) XFilesFactor() float64
XFilesFactor get aggregation xFilesFactor
type WhisperQuotas ¶ added in v0.16.0
type WhisperQuotas []Quota
func ReadWhisperQuotas ¶ added in v0.16.0
func ReadWhisperQuotas(filename string) (WhisperQuotas, error)
ReadWhisperQuotas reads and parses a storage-quotas.conf file and returns the defined quotas.
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 ¶ added in v0.7.2
func (s WhisperSchemas) Len() int
func (WhisperSchemas) Less ¶ added in v0.7.2
func (s WhisperSchemas) Less(i, j int) bool
func (WhisperSchemas) Match ¶ added in v0.7.2
func (s WhisperSchemas) Match(metric string) (Schema, bool)
Match finds the schema for metric or returns false if none found
func (WhisperSchemas) Swap ¶ added in v0.7.2
func (s WhisperSchemas) Swap(i, j int)