config

package
v0.0.0-...-52fabeb Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLoggingLevel                   string = "info"
	DefaultServerPort                     int    = 8080
	DefaultHealthServerPort               int    = 8081
	DefaultPolicyPollerInterval                  = 40 * time.Second
	DefaultAggregatorExecuteInterval             = 40 * time.Second
	DefaultSaveInterval                          = 5 * time.Second
	DefaultMetricPollerCount              int    = 20
	DefaultAppMonitorChannelSize          int    = 200
	DefaultAppMetricChannelSize           int    = 200
	DefaultEvaluationExecuteInterval             = 40 * time.Second
	DefaultEvaluatorCount                 int    = 20
	DefaultTriggerArrayChannelSize        int    = 200
	DefaultBackOffInitialInterval                = 5 * time.Minute
	DefaultBackOffMaxInterval                    = 2 * time.Hour
	DefaultBreakerConsecutiveFailureCount int64  = 3
	DefaultHttpClientTimeout                     = 5 * time.Second
	DefaultMetricCacheSizePerApp                 = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatorConfig

type AggregatorConfig struct {
	MetricPollerCount         int           `yaml:"metric_poller_count"`
	AppMonitorChannelSize     int           `yaml:"app_monitor_channel_size"`
	AppMetricChannelSize      int           `yaml:"app_metric_channel_size"`
	AggregatorExecuteInterval time.Duration `yaml:"aggregator_execute_interval"`
	PolicyPollerInterval      time.Duration `yaml:"policy_poller_interval"`
	SaveInterval              time.Duration `yaml:"save_interval"`
	MetricCacheSizePerApp     int           `yaml:"metric_cache_size_per_app"`
}

type CircuitBreakerConfig

type CircuitBreakerConfig struct {
	BackOffInitialInterval  time.Duration `yaml:"back_off_initial_interval"`
	BackOffMaxInterval      time.Duration `yaml:"back_off_max_interval"`
	ConsecutiveFailureCount int64         `yaml:"consecutive_failure_count"`
}

type Config

type Config struct {
	Logging                   helpers.LoggingConfig `yaml:"logging"`
	Server                    ServerConfig          `yaml:"server"`
	Health                    models.HealthConfig   `yaml:"health"`
	DB                        DBConfig              `yaml:"db"`
	Aggregator                AggregatorConfig      `yaml:"aggregator"`
	Evaluator                 EvaluatorConfig       `yaml:"evaluator"`
	ScalingEngine             ScalingEngineConfig   `yaml:"scalingEngine"`
	MetricCollector           MetricCollectorConfig `yaml:"metricCollector"`
	DefaultStatWindowSecs     int                   `yaml:"defaultStatWindowSecs"`
	DefaultBreachDurationSecs int                   `yaml:"defaultBreachDurationSecs"`
	CircuitBreaker            CircuitBreakerConfig  `yaml:"circuitBreaker"`
	HttpClientTimeout         time.Duration         `yaml:"http_client_timeout"`
}

func LoadConfig

func LoadConfig(bytes []byte) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type DBConfig

type DBConfig struct {
	PolicyDB    db.DatabaseConfig `yaml:"policy_db"`
	AppMetricDB db.DatabaseConfig `yaml:"app_metrics_db"`
}

type EvaluatorConfig

type EvaluatorConfig struct {
	EvaluatorCount            int           `yaml:"evaluator_count"`
	TriggerArrayChannelSize   int           `yaml:"trigger_array_channel_size"`
	EvaluationManagerInterval time.Duration `yaml:"evaluation_manager_execute_interval"`
}

type MetricCollectorConfig

type MetricCollectorConfig struct {
	MetricCollectorURL string          `yaml:"metric_collector_url"`
	TLSClientCerts     models.TLSCerts `yaml:"tls"`
}

type ScalingEngineConfig

type ScalingEngineConfig struct {
	ScalingEngineURL string          `yaml:"scaling_engine_url"`
	TLSClientCerts   models.TLSCerts `yaml:"tls"`
}

type ServerConfig

type ServerConfig struct {
	Port      int             `yaml:"port"`
	TLS       models.TLSCerts `yaml:"tls"`
	NodeAddrs []string        `yaml:"node_addrs"`
	NodeIndex int             `yaml:"node_index"`
}

Jump to

Keyboard shortcuts

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