Version: v0.9.0 Latest Latest

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

Go to latest
Published: Jan 10, 2017 License: MIT Imports: 15 Imported by: 0



this is a parser for graphite's storage-schemas.conf it supports old and new retention format see based on but with some improvements



This section is empty.


This section is empty.


func ParseRetentionDefs

func ParseRetentionDefs(retentionDefs string) (whisper.Retentions, error)

ParseRetentionDefs parses retention definitions into a Retentions structure


type Schema added in v0.7.2

type Schema struct {
	Name         string
	Pattern      *regexp.Regexp
	RetentionStr string
	Retentions   whisper.Retentions
	Priority     int64

Schema represents one schema setting

type StoreFunc added in v0.8.0

type StoreFunc func(p *Whisper, values *points.Points)

type ThrottleTicker added in v0.9.0

type ThrottleTicker struct {
	C chan bool

func NewThrottleTicker added in v0.9.0

func NewThrottleTicker(ratePerSec int) *ThrottleTicker

type Whisper

type Whisper struct {
	// contains filtered or unexported fields

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 added in v0.7.1

func (p *Whisper) GetMaxUpdatesPerSecond() int

GetMaxUpdatesPerSecond returns current throttling speed

func (*Whisper) SetMaxUpdatesPerSecond added in v0.4.3

func (p *Whisper) SetMaxUpdatesPerSecond(maxUpdatesPerSecond int)

SetMaxUpdatesPerSecond enable throttling

func (*Whisper) SetMockStore added in v0.8.0

func (p *Whisper) SetMockStore(fn func() (StoreFunc, func()))

func (*Whisper) SetSparse added in v0.7.2

func (p *Whisper) SetSparse(sparse bool)

SetSparse creation

func (*Whisper) SetWorkers

func (p *Whisper) SetWorkers(count int)

SetWorkers count

func (*Whisper) Start

func (p *Whisper) Start() error

Start worker

func (*Whisper) Stat

func (p *Whisper) Stat(send helper.StatCallback)

Stat callback

func (*Whisper) Stop

func (p *Whisper) Stop()

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

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL