Documentation
¶
Index ¶
Constants ¶
const ( ModeMixed = iota ModeSequential ModeSelfScheduled )
Modes enum
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Mode is for switch between control modes
Mode Mode
// DB is the name which we want to run.
DB string
// Nodes are addresses of nodes.
Nodes []cluster.Node
// ClientNode are addresses of client usage.
ClientNodes []cluster.ClientNode
// ClientCount controls the count of clients
ClientCount int
// Chaos NS
ChaosNamespace string
// RunRound controls how many round the controller runs tests.
RunRound int
// RunTime controls how long a round takes.
RunTime time.Duration
// RequestCount controls how many requests a client sends to the db.
RequestCount int
// History file
History string
// ClientConfig can be anything, use type assertion in your case
ClientConfig interface{}
}
Config is the configuration for the controller.
type Controller ¶
type Controller struct {
// protect nemesisGenerators' reading and updating
sync.RWMutex
// contains filtered or unexported fields
}
Controller controls the whole cluster. It sends request to the database, and also uses nemesis to disturb the cluster. Here have only 5 nodes, and the hosts are n1 - n5.
func NewController ¶
func NewController( ctx context.Context, cfg *Config, clientCreator core.ClientCreator, nemesisGenerators core.NemesisGenerators, clientRequestGenerator func(ctx context.Context, client core.Client, node cluster.ClientNode, proc *int64, requestCount *int64, recorder *history.Recorder), verifySuit verify.Suit, plugins []Plugin, lokiCli *loki.Client, logPath string, ) *Controller
NewController creates a controller.
func (*Controller) RunMixed ¶
func (c *Controller) RunMixed()
RunMixed runs workload round by round, with nemesis injected seamlessly Nemesis and workload are running concurrently, nemesis won't pause when one round of workload is finished
func (*Controller) RunSelfScheduled ¶
func (c *Controller) RunSelfScheduled()
RunSelfScheduled runs the controller with self scheduled
func (*Controller) RunWithNemesisSequential ¶
func (c *Controller) RunWithNemesisSequential()
RunWithNemesisSequential runs nemesis sequential, with n round of workload running with each kind of nemesis. eg. nemesis1, round 1, round 2, ... round n ->
nemesis2, round 1, round 2, ... round n -> ... nemesis n, round 1, round 2, ... round n
func (*Controller) UpdateNemesisGenerators ¶
func (c *Controller) UpdateNemesisGenerators(gs core.NemesisGenerators)
UpdateNemesisGenerators updates nemesis generators
type PanicCheck ¶
type PanicCheck struct {
*Controller
// contains filtered or unexported fields
}
PanicCheck impls Plugin