chaosd

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUSOK = "OK"
	OPTIONNX = "NX"
	OPTIONXX = "XX"
	OPTIONGT = "GT"
	OPTIONLT = "LT"
)
View Source
const (
	CPUSTRESSORTOOL    = "stress-ng"
	MEMORYSTRESSORTOOL = "memStress"
)
View Source
const CmdReboot = "reboot"
View Source
const CmdShutdown = "shutdown"

Variables

This section is empty.

Functions

func ApplyDiskAttack added in v1.4.0

func ApplyDiskAttack(options core.AttackConfig, env Environment) error

func ApplyDiskServerAttack added in v1.4.0

func ApplyDiskServerAttack(options core.AttackConfig, env Environment) error

func ExpireFunc added in v1.2.1

func ExpireFunc(cli *redis.Client, key string, expiration time.Duration, option string) *redis.BoolCmd

func FindSymbolInEntry added in v1.1.0

func FindSymbolInEntry(p ptrace.TracedProgram, symbolName string, entry *mapreader.Entry) (addr uint64, size uint64, err error)

FindSymbolInEntry finds symbol in entry through parsing elf

Types

type AttackType added in v1.0.0

type AttackType interface {
	// Attack execute attack with options and env.
	// ExecuteAttack will store the options ahead of Attack be executed
	// and will store options again after Attack be executed.
	// We can also use env.Chaos.expStore to touch the storage of chaosd.
	// But do not update it with your own uid ,
	// because it will be covered after Attack executed with options.
	Attack(options core.AttackConfig, env Environment) error
	// Recover can get marshaled options data from experiment and recover it.
	Recover(experiment core.Experiment, env Environment) error
}
var ClockAttack AttackType = clockAttack{}
var DiskAttack AttackType = diskAttack{}
var DiskServerAttack AttackType = diskServerAttack{}
var FileAttack AttackType = fileAttack{}
var HTTPAttack AttackType = attackHTTP{}
var HostAttack AttackType = hostAttack{}
var JVMAttack AttackType = jvmAttack{}
var KafkaAttack AttackType = kafkaAttack{}
var NetworkAttack AttackType = networkAttack{}
var ProcessAttack AttackType = processAttack{}
var RedisAttack AttackType = redisAttack{}
var StressAttack AttackType = stressAttack{}
var UserDefinedAttack AttackType = userDefinedAttack{}
var VMAttack AttackType = vmAttack{}

type Environment added in v1.0.0

type Environment struct {
	AttackUid string
	Chaos     *Server
}

type HostManager

type HostManager interface {
	Name() string
	Shutdown() error
	Reboot() error
}
var Host HostManager = UnixHost{}

type OutputHandler added in v1.4.0

type OutputHandler struct {
	StdoutHandler func([]byte, error, chan interface{})
	OutputChan    chan interface{}
}

func NewOutputHandler added in v1.4.0

func NewOutputHandler(
	handler func([]byte, error, chan interface{}),
	outputChan chan interface{}) *OutputHandler

type Server

type Server struct {
	ExpRun core.ExperimentRunStore
	Cron   scheduler.Scheduler

	CmdPools map[string]*utils.CommandPools
	// contains filtered or unexported fields
}

func (*Server) ExecuteAttack added in v1.0.0

func (s *Server) ExecuteAttack(attackType AttackType, options core.AttackConfig, launchMode string) (uid string, err error)

ExecuteAttack creates a new Experiment record and may schedule/execute an attack for the given attackType. If options.Schedule isn't provided, then the attack is executed immediately. Otherwise the attack is scheduled based on the provided schedule spec and duration.

func (*Server) RecoverAttack added in v1.0.0

func (s *Server) RecoverAttack(uid string) error

func (*Server) Search

func (s *Server) Search(conds *core.SearchCommand) ([]*core.Experiment, error)

type UnixHost

type UnixHost struct{}

func (UnixHost) Name

func (h UnixHost) Name() string

func (UnixHost) Reboot added in v1.4.0

func (h UnixHost) Reboot() error

func (UnixHost) Shutdown

func (h UnixHost) Shutdown() error

Jump to

Keyboard shortcuts

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