dpbuffered

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBufferFull = errors.New("unable to send more datapoints.  Buffer full")

ErrBufferFull is returned by BufferedForwarder.AddDatapoints if the sink's buffer is full

Functions

This section is empty.

Types

type BufferedForwarder

type BufferedForwarder struct {
	// contains filtered or unexported fields
}

BufferedForwarder abstracts out datapoint buffering. Points put on its channel are buffered and sent in large groups to a waiting sink

func NewBufferedForwarder

func NewBufferedForwarder(ctx context.Context, config Config, sendTo dpsink.Sink) *BufferedForwarder

NewBufferedForwarder is used only by this package to create a forwarder that buffers its datapoint channel

func (*BufferedForwarder) AddDatapoints

func (forwarder *BufferedForwarder) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint) error

AddDatapoints sends the datapoints to a chan buffer that eventually is flushed in big groups

func (*BufferedForwarder) Close

func (forwarder *BufferedForwarder) Close()

Close stops the threads that are flushing channel points to the next forwarder

func (*BufferedForwarder) Stats

func (forwarder *BufferedForwarder) Stats(dimensions map[string]string) []*datapoint.Datapoint

Stats related to this forwarder, including errors processing datapoints

type Config

type Config struct {
	BufferSize         int64
	MaxTotalDatapoints int64
	MaxDrainSize       int64
	NumDrainingThreads int64
}

Config controls BufferedForwarder limits

func (*Config) FromConfig

func (c *Config) FromConfig(conf *config.ForwardTo) *Config

FromConfig loads the default config for a buffered forwarder from the proxy's config

Jump to

Keyboard shortcuts

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