config

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClustersConfig

type ClustersConfig struct {
	Type     string  `yaml:"type"` // scylladb | cassandra
	MemoryMB int     `yaml:"memory_mb"`
	CPULimit float64 `yaml:"cpu_limit"`
}

type Config

type Config struct {
	Simulation SimulationConfig `yaml:"simulation"`
	Clusters   ClustersConfig   `yaml:"clusters"`
	Helix      HelixConfig      `yaml:"helix"`
	Workload   WorkloadConfig   `yaml:"workload"`
}

Config represents the simulation configuration

func Load

func Load(path string) (*Config, error)

Load reads configuration from a YAML file

type FailoverPolicyConfig

type FailoverPolicyConfig struct {
	Type         string        `yaml:"type"` // active | circuit | latency_circuit
	Threshold    int           `yaml:"threshold"`
	ResetTimeout time.Duration `yaml:"reset_timeout"`
	AbsoluteMax  time.Duration `yaml:"absolute_max"`
}

type HelixConfig

type HelixConfig struct {
	WriteStrategy  WriteStrategyConfig  `yaml:"write_strategy"`
	ReadStrategy   ReadStrategyConfig   `yaml:"read_strategy"`
	FailoverPolicy FailoverPolicyConfig `yaml:"failover_policy"`
	Replay         ReplayConfig         `yaml:"replay"`
}

type ReadStrategyConfig

type ReadStrategyConfig struct {
	Type      string        `yaml:"type"` // sticky | primary_only
	Cooldown  time.Duration `yaml:"cooldown"`
	Preferred string        `yaml:"preferred"` // A | B | random
}

type ReplayConfig

type ReplayConfig struct {
	Type      string `yaml:"type"` // memory | nats
	QueueSize int    `yaml:"queue_size"`
	NATSURL   string `yaml:"nats_url"`
}

type SimulationConfig

type SimulationConfig struct {
	Duration        time.Duration `yaml:"duration"`
	Seed            int64         `yaml:"seed"`
	ReportDir       string        `yaml:"report_dir"`
	ConsoleInterval time.Duration `yaml:"console_interval"`
}

type WorkloadConfig added in v0.5.0

type WorkloadConfig struct {
	Workers     int           `yaml:"workers"`
	Interval    time.Duration `yaml:"interval"`
	PayloadSize int           `yaml:"payload_size"`
	ReadRatio   float64       `yaml:"read_ratio"`  // Fraction of ops that are reads (0.0-1.0, default 0.2)
	BatchRatio  float64       `yaml:"batch_ratio"` // Fraction of writes that use LOGGED BATCH (0.0-1.0, default 0.1)
}

type WriteStrategyConfig

type WriteStrategyConfig struct {
	Type              string        `yaml:"type"` // adaptive | concurrent | single
	DeltaThreshold    time.Duration `yaml:"delta_threshold"`
	AbsoluteMax       time.Duration `yaml:"absolute_max"`
	StrikeThreshold   int           `yaml:"strike_threshold"`
	RecoveryThreshold int           `yaml:"recovery_threshold"`
	FireForgetTimeout time.Duration `yaml:"fire_forget_timeout"`
	FireForgetLimit   int           `yaml:"fire_forget_limit"`
}

Jump to

Keyboard shortcuts

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