batchprocessor

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetricViews

func MetricViews(level telemetry.Level) []*view.View

MetricViews returns the metrics views related to batching

func NewBatcher

func NewBatcher(name string, logger *zap.Logger, sender consumer.TraceConsumer, opts ...Option) processor.TraceProcessor

NewBatcher creates a new batcher that batches spans by node and resource

Types

type Config

type Config struct {
	configmodels.ProcessorSettings `mapstructure:",squash"`

	// Timeout sets the time after which a batch will be sent regardless of size.
	Timeout *time.Duration `mapstructure:"timeout,omitempty"`

	// SendBatchSize is the size of a batch which after hit, will trigger it to be sent.
	SendBatchSize *int `mapstructure:"send_batch_size,omitempty"`

	// NumTickers sets the number of tickers to use to divide the work of looping
	// over batch buckets. This is an advanced configuration option.
	NumTickers int `mapstructure:"num_tickers,omitempty"`

	// TickTime sets time interval at which the tickers tick. This is an advanced
	// configuration option.
	TickTime *time.Duration `mapstructure:"tick_time,omitempty"`

	// RemoveAfterTicks is the number of ticks that must pass without a span arriving
	// from a node after which the batcher for that node will be deleted. This is an
	// advanced configuration option.
	RemoveAfterTicks *int `mapstructure:"remove_after_ticks,omitempty"`
}

Config defines configuration for batch processor.

type Factory

type Factory struct {
}

Factory is the factory for batch processor.

func (*Factory) CreateDefaultConfig

func (f *Factory) CreateDefaultConfig() configmodels.Processor

CreateDefaultConfig creates the default configuration for processor.

func (*Factory) CreateMetricsProcessor

func (f *Factory) CreateMetricsProcessor(
	logger *zap.Logger,
	nextConsumer consumer.MetricsConsumer,
	cfg configmodels.Processor,
) (processor.MetricsProcessor, error)

CreateMetricsProcessor creates a metrics processor based on this config.

func (*Factory) CreateTraceProcessor

func (f *Factory) CreateTraceProcessor(
	logger *zap.Logger,
	nextConsumer consumer.TraceConsumer,
	c configmodels.Processor,
) (processor.TraceProcessor, error)

CreateTraceProcessor creates a trace processor based on this config.

func (*Factory) Type

func (f *Factory) Type() string

Type gets the type of the config created by this factory.

type Option

type Option func(b *batcher)

Option is an option to batchprocessor.

func WithNumTickers

func WithNumTickers(numTickers int) Option

WithNumTickers sets the number of tickers to use to divide the work of looping over all nodebuckets.

func WithRemoveAfterTicks

func WithRemoveAfterTicks(cycles int) Option

WithRemoveAfterTicks sets the number of ticks that must pass without new spans arriving for a node before that node is deleted from the batcher.

func WithSendBatchSize

func WithSendBatchSize(sendBatchSize int) Option

WithSendBatchSize sets the size after which a batch will be sent.

func WithTickTime

func WithTickTime(tickTime time.Duration) Option

WithTickTime sets the time interval at which the tickers will tick.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the time after which a batch will be sent regardless of its size.

Jump to

Keyboard shortcuts

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