/
config.go
59 lines (50 loc) · 1.19 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package control
import (
"time"
"github.com/pingcap/tipocket/pkg/cluster"
)
// Config is the configuration for the controller.
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{}
}
// Mode enums control modes
type Mode int
// Modes enum
const (
ModeMixed = iota
ModeSequential
ModeSelfScheduled
)
func (m Mode) String() string {
switch m {
case ModeMixed:
return "Mixed mode"
case ModeSelfScheduled:
return "Self scheduled mode"
case ModeSequential:
return "Nemesis one by one mode"
default:
return "Unknown mode"
}
}