Documentation ¶
Index ¶
- Variables
- type BufferedForwarder
- func (forwarder *BufferedForwarder) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint) error
- func (forwarder *BufferedForwarder) AddEvents(ctx context.Context, events []*event.Event) error
- func (forwarder *BufferedForwarder) Close() error
- func (forwarder *BufferedForwarder) Datapoints() []*datapoint.Datapoint
- func (forwarder *BufferedForwarder) Pipeline() int64
- type Config
Constants ¶
This section is empty.
Variables ¶
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
var ErrDPBufferFull = errors.New("unable to send more datapoints. Buffer full")
ErrDPBufferFull is returned by BufferedForwarder.AddDatapoints if the sink's buffer is full
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
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