dpbuffered

package
v0.9.20 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2017 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	BufferSize:         pointer.Int64(10000),
	MaxTotalDatapoints: pointer.Int64(10000),
	MaxTotalEvents:     pointer.Int64(10000),
	MaxDrainSize:       pointer.Int64(1000),
	NumDrainingThreads: pointer.Int64(5),
}

DefaultConfig are default values for buffered forwarders

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

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

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

ErrEBufferFull is returned by BufferedForwarder.AddEvents 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, logger log.Logger) *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) AddEvents added in v0.7.0

func (forwarder *BufferedForwarder) AddEvents(ctx context.Context, events []*event.Event) error

AddEvents sends the events to a chan buffer that eventually is flushed in big groups

func (*BufferedForwarder) Close

func (forwarder *BufferedForwarder) Close() error

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

func (*BufferedForwarder) Datapoints added in v0.9.0

func (forwarder *BufferedForwarder) Datapoints() []*datapoint.Datapoint

Datapoints related to this forwarder, including errors processing datapoints

func (*BufferedForwarder) Pipeline added in v0.9.14

func (forwarder *BufferedForwarder) Pipeline() int64

Pipeline for a BufferedForwarder is the total of all buffers and what is in flight

type Config

type Config struct {
	BufferSize         *int64
	MaxTotalDatapoints *int64
	MaxTotalEvents     *int64
	MaxDrainSize       *int64
	NumDrainingThreads *int64
	Checker            *dpsink.ItemFlagger
	Cdim               *log.CtxDimensions
}

Config controls BufferedForwarder limits

Jump to

Keyboard shortcuts

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