Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ValidActions = []string{"stop", "restart", "pause", "delay", "loss", "limit_cpu", "limit_memory"} NetworkActions = []string{"delay", "loss"} ResourceActions = []string{"limit_cpu", "limit_memory"} )
Functions ¶
This section is empty.
Types ¶
type ActionSpec ¶
type ActionSpec struct {
Name string `yaml:"name"`
LatencyMs int `yaml:"latency_ms,omitempty"`
JitterMs int `yaml:"jitter_ms,omitempty"`
LossPercent int `yaml:"loss_percent,omitempty"`
CPUs float64 `yaml:"cpus,omitempty"`
MemoryMB int `yaml:"memory_mb,omitempty"`
Duration *int `yaml:"duration,omitempty"`
}
func (*ActionSpec) IsNetwork ¶
func (a *ActionSpec) IsNetwork() bool
func (*ActionSpec) IsResource ¶
func (a *ActionSpec) IsResource() bool
func (*ActionSpec) UnmarshalYAML ¶
func (a *ActionSpec) UnmarshalYAML(value *yaml.Node) error
type ChaosConfig ¶
type ChaosConfig struct {
Interval int `yaml:"interval"`
Targets []string `yaml:"targets"`
Actions []ActionSpec `yaml:"actions"`
Safety SafetyConfig `yaml:"safety"`
}
func LoadConfig ¶
func LoadConfig(path string) (*ChaosConfig, error)
func (*ChaosConfig) Validate ¶
func (c *ChaosConfig) Validate() error
type ProbeSpec ¶
type ProbeSpec struct {
Type string `yaml:"type"`
URL string `yaml:"url,omitempty"` // For HTTP
ExpectStatus *int `yaml:"expect_status,omitempty"` // For HTTP
ExpectNotStatus *int `yaml:"expect_not_status,omitempty"` // For HTTP
Timeout int `yaml:"timeout,omitempty"` // Global
HostPort string `yaml:"host_port,omitempty"` // For TCP
Target string `yaml:"target,omitempty"` // For Exec
Command string `yaml:"command,omitempty"` // For Exec
}
type SafetyConfig ¶
type ScenarioConfig ¶
type ScenarioConfig struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Hypothesis string `yaml:"hypothesis"`
SteadyState []SteadyStateProbe `yaml:"steady_state,omitempty"`
Steps []ScenarioStep `yaml:"steps"`
}
func LoadScenario ¶
func LoadScenario(path string) (*ScenarioConfig, error)
type ScenarioStep ¶
type ScenarioStep struct {
Type string `yaml:"-"`
DurationS int `yaml:"-"`
Action *ActionSpec `yaml:"-"`
Target string `yaml:"-"`
Probe *ProbeSpec `yaml:"-"`
}
func (*ScenarioStep) UnmarshalYAML ¶
func (s *ScenarioStep) UnmarshalYAML(value *yaml.Node) error
Click to show internal directories.
Click to hide internal directories.