persister

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRetentionDefs

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

ParseRetentionDefs copy of original ParseRetentionDefs from go-whisper With support where old format:

secondsPerPoint:numberOfPoints

Types

type CreateOpener

type CreateOpener interface {
	Create(string, whisper.Retentions, whisper.AggregationMethod, float32) (*whisper.Whisper, error)
	Open(string) (*whisper.Whisper, error)
}

CreateOpener whisper opener interface for mock in tests

type Persister

type Persister struct {
	Clock   clock.Clock
	Whisper CreateOpener
}

Persister is a struct to hold dependencies via interface

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, in chan *points.Points) *Whisper

NewWhisper create instance of Whisper

func (*Whisper) SetGraphPrefix

func (p *Whisper) SetGraphPrefix(prefix string)

SetGraphPrefix for internal cache metrics

func (*Whisper) SetMaxUpdatesPerSecond added in v0.4.3

func (p *Whisper) SetMaxUpdatesPerSecond(maxUpdatesPerSecond int)

SetMaxUpdatesPerSecond enable throttling

func (*Whisper) SetWorkers

func (p *Whisper) SetWorkers(count int)

SetWorkers count

func (*Whisper) Start

func (p *Whisper) Start()

Start worker

func (*Whisper) Stat

func (p *Whisper) Stat(metric string, value float64)

Stat sends internal statistics to cache

func (*Whisper) Stop

func (p *Whisper) Stop()

Stop worker

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 WhisperFactory

type WhisperFactory struct{}

WhisperFactory - holder for factory functions

func (WhisperFactory) Create

func (WhisperFactory) Create(path string, retentions whisper.Retentions, aggregationMethod whisper.AggregationMethod, xFilesFactor float32) (*whisper.Whisper, error)

Create creates a new underlying whisperdb file

func (WhisperFactory) Open

func (WhisperFactory) Open(path string) (*whisper.Whisper, error)

Open opens an existing underlying whisperdb file

type WhisperSchemas

type WhisperSchemas struct {
	Data []*whisperSchemaItem
}

WhisperSchemas ...

func NewWhisperSchemas

func NewWhisperSchemas() *WhisperSchemas

NewWhisperSchemas create instance of WhisperSchemas

func ReadWhisperSchemas

func ReadWhisperSchemas(file string) (*WhisperSchemas, error)

ReadWhisperSchemas ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL