senders

package
v0.0.0-...-967d409 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

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

Dispatcher is a Sender that fans out to other Sender instances. Generally, this will be a collection of Endpoints wrapped in RetryingSender objects.

func NewDispatcher

func NewDispatcher(senders []pipeline.Sender, recorder stats.Recorder) *Dispatcher

func (*Dispatcher) Endpoints

func (d *Dispatcher) Endpoints() (handlers []string)

func (*Dispatcher) Release

func (d *Dispatcher) Release() error

Release decrements the Dispatcher's usage count. If it reaches 0, Release releases all of the underlying senders concurrently and waits for the operations to finish. See pipeline.Component.Release.

func (*Dispatcher) Send

func (d *Dispatcher) Send(report metrics.StampedMetricReport) error

Send fans out to each Sender in parallel and returns any errors. Send blocks until all sub-sends have finished.

func (*Dispatcher) Use

func (d *Dispatcher) Use()

Use increments the Dispatcher's usage count. See pipeline.Component.Use.

type RetryingSender

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

RetryingSender is a Sender handles sending reports to remote endpoints. It buffers reports and retries in the event of a send failure, using exponential backoff between retry attempts. Minimum and maximum delays are configurable via the "retrymin" and "retrymax" flags.

func NewRetryingSender

func NewRetryingSender(endpoint pipeline.Endpoint, persistence persistence.Persistence, recorder stats.Recorder) *RetryingSender

NewRetryingSender creates a new RetryingSender for endpoint, storing state in persistence.

func (*RetryingSender) Endpoints

func (rs *RetryingSender) Endpoints() []string

func (*RetryingSender) Release

func (rs *RetryingSender) Release() error

Release decrements the RetryingSender's usage count. If it reaches 0, Release instructs the RetryingSender to gracefully shutdown. Any reports that have not yet been sent will be persisted to disk, and the wrapped Endpoint will be released. Release blocks until the operation has completed. See pipeline.Component.Release.

func (*RetryingSender) Send

func (*RetryingSender) Use

func (rs *RetryingSender) Use()

Use increments the RetryingSender's usage count. See pipeline.Component.Use.

Jump to

Keyboard shortcuts

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