Documentation ¶
Index ¶
Constants ¶
const ( StatusOK = iota StatusError )
nemesis status
const ( TaskCreate = iota TaskTerminate )
Task operations
const ( WEPERM = 1 WEINTR = 4 WEIO = 5 WEBADF = 9 WEINVAL = 22 WEFBIG = 27 WENOSPC = 28 WEDQUOT = 122 )
write error
const ( REINTR = 4 RIO = 5 REBADF = 9 REINVAL = 22 )
read error
Variables ¶
var ( ErrNotFount = errors.New("not founnd") ErrUnknown = errors.New("unknown") ErrEmptyNodes = errors.New("empty nodes") ErrInvalidateArgs = errors.New("invalidate arguments") )
errors to return
var ( ReadErrorList = []int{REINTR, RIO, REBADF, REINVAL} WriteErrorList = []int{WEPERM, WEINTR, WEIO, WEBADF, WEINVAL, WEFBIG, WENOSPC, WEDQUOT} )
error list
Functions ¶
This section is empty.
Types ¶
type Manager ¶
Manager create, kill and maintain the nemesis
func (*Manager) CreateNemesis ¶
CreateNemesis create or run a existed nemesis
func (*Manager) NumberOfNemesis ¶
NumberOfNemesis returns total number of nemesis
func (*Manager) TerminateAllNemesis ¶
func (m *Manager) TerminateAllNemesis()
TerminateAllNemesis kill all nemesis
func (*Manager) TerminateNemesis ¶
TerminateNemesis kill a existed nemesis
type Nemesis ¶
type Nemesis interface { GetID() string GetType() int GetStatus() int Run() error Terminate() error }
Nemesis interface
type Partition ¶
type Partition struct { ID string // unique id Type int // nemesis type Status int // runtime status LasterError error // last error RejectedNode []string // nodes to disable Debug bool // if is in debug mod }
Partition disable the communication with specified nodes Note: for the sake of safty, all the nodes of partition must not be the controller TODO: unilateral disable
func NewPartition ¶
NewPartition create a new partition nemesis
type Persistence ¶
type Persistence struct { ID string // unique id Type int // nemesis type Status int // runtime status LasterError error // last error Command string // long running command Process *exec.Cmd // inner command struct Debug bool // if is in debug mod }
Persistence manages the long running nemesis
func NewPersistence ¶
func NewPersistence(command string) *Persistence
NewPersistence create a new persistent nemesis
func (*Persistence) Terminate ¶
func (p *Persistence) Terminate() error
Terminate stop the persistent nemesis
type Service ¶
type Service struct { ID string // unique id Type int // nemesis type Status int // runtime status LasterError error // last error CommandRun string // command to kill the process CommandRevive string // command to revive the process Debug bool // if is in debug mod }
Service process service level nemesis
func NewService ¶
NewService create a nemesis to stop and revive a process
type SystemTap ¶
type SystemTap struct { P *Persistence // persistent nemesis Arguments []string // aguments for the systemtap script Class SystemTapClass // system tap class }
SystemTap wrapper
type SystemTapClass ¶
type SystemTapClass int
SystemTapClass specifies which kind of script to run
const ( SystemTapIOError SystemTapClass = iota SystemTapIODelay )
systemtap types