github.com/pingcap/chaos@v0.0.0-20190710112158-c86faf4b3719/pkg/control/config.go (about)

     1  package control
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  // Config is the configuration for the controller.
     8  type Config struct {
     9  	// DB is the name which we want to run.
    10  	DB string
    11  	// Nodes are address of nodes.
    12  	Nodes []string
    13  
    14  	// RunRound controls how many round the controller runs tests.
    15  	RunRound int
    16  	// RunTime controls how long a round takes.
    17  	RunTime time.Duration
    18  	// RequestCount controls how many requests a client sends to the db.
    19  	RequestCount int
    20  
    21  	// History file
    22  	History string
    23  }
    24  
    25  func (c *Config) adjust() {
    26  	if c.RequestCount == 0 {
    27  		c.RequestCount = 10000
    28  	}
    29  
    30  	if c.RunTime == 0 {
    31  		c.RunTime = 10 * time.Minute
    32  	}
    33  
    34  	if c.RunRound == 0 {
    35  		c.RunRound = 20
    36  	}
    37  }