Documentation ¶
Index ¶
- Constants
- Variables
- type Factory
- func (f *Factory) AddFlags(flagSet *flag.FlagSet)
- func (f *Factory) CreateStrategyStore() (strategystore.StrategyStore, strategystore.Aggregator, error)
- func (f *Factory) InitFromViper(v *viper.Viper, logger *zap.Logger)
- func (f *Factory) Initialize(metricsFactory metrics.Factory, ssFactory storage.SamplingStoreFactory, ...) error
- type FactoryConfig
- type Kind
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 strategystore.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) CreateStrategyStore ¶
func (f *Factory) CreateStrategyStore() (strategystore.StrategyStore, strategystore.Aggregator, error)
CreateStrategyStore implements strategystore.Factory
func (*Factory) InitFromViper ¶
InitFromViper implements plugin.Configurable
func (*Factory) Initialize ¶
func (f *Factory) Initialize(metricsFactory metrics.Factory, ssFactory storage.SamplingStoreFactory, logger *zap.Logger) error
Initialize implements strategystore.Factory
type FactoryConfig ¶
type FactoryConfig struct {
StrategyStoreType Kind
}
FactoryConfig tells the Factory what sampling type it needs to create.
func FactoryConfigFromEnv ¶
func FactoryConfigFromEnv(log io.Writer) (*FactoryConfig, error)
FactoryConfigFromEnv reads the desired sampling type from the SAMPLING_CONFIG_TYPE environment variable. Allowed values: * `file` - built-in * `adaptive` - built-in
Click to show internal directories.
Click to hide internal directories.