Help us shape the future of Go! Take the 2026 Go Developer Survey

strategyprovider

package
v1.65.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SamplingTypeEnvVar is the name of the env var that defines the type of sampling strategy store used.
	SamplingTypeEnvVar = "SAMPLING_CONFIG_TYPE"
)

Variables

View Source
var AllSamplingTypes = []string{samplingTypeFile, samplingTypeAdaptive}

AllSamplingTypes lists all types of sampling factories.

Functions

This section is empty.

Types

type Factory

type Factory struct {
	FactoryConfig
	// contains filtered or unexported fields
}

Factory implements samplingstrategy.Factory interface as a meta-factory for strategy storage components.

func NewFactory

func NewFactory(config FactoryConfig) (*Factory, error)

NewFactory creates the meta-factory.

func (*Factory) AddFlags

func (f *Factory) AddFlags(flagSet *flag.FlagSet)

AddFlags implements plugin.Configurable

func (*Factory) Close

func (f *Factory) Close() error

Close closes all factories.

func (*Factory) CreateStrategyProvider

func (f *Factory) CreateStrategyProvider() (samplingstrategy.Provider, samplingstrategy.Aggregator, error)

CreateStrategyProvider implements samplingstrategy.Factory

func (*Factory) InitFromViper

func (f *Factory) InitFromViper(v *viper.Viper, logger *zap.Logger)

InitFromViper implements plugin.Configurable

func (*Factory) Initialize

func (f *Factory) Initialize(metricsFactory metrics.Factory, ssFactory storage.SamplingStoreFactory, logger *zap.Logger) error

Initialize implements samplingstrategy.Factory

type FactoryConfig

type FactoryConfig struct {
	StrategyStoreType Kind
}

FactoryConfig tells the Factory what sampling type it needs to create.

func FactoryConfigFromEnv

func FactoryConfigFromEnv() (*FactoryConfig, error)

FactoryConfigFromEnv reads the desired sampling type from the SAMPLING_CONFIG_TYPE environment variable. Allowed values: * `file` - built-in * `adaptive` - built-in

type Kind

type Kind string

Kind is a datatype holding the type of strategy store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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