Documentation ¶
Index ¶
- Constants
- Variables
- func CheckCall(command string) (result string, err error)
- func IPOf(node string) (string, error)
- func PartitionIncoming(partitionTemplate, partitionedAZ, partitionType string) error
- func PartitionOutgoing(partitionTemplate, partitionedAZ, partitionType string) error
- func RunKill9Agent(containerName string) error
- func RunStartAgent(containerName string) error
- func RunStopAgent(containerName string) error
- func RunStopSlave(rootConn *sql.DB) error
- type Config
- type DMLJob
- type LongTxnJob
- type Server
- type SimpleDMLJob
- func (job SimpleDMLJob) Check(db *sql.DB) int
- func (job SimpleDMLJob) GetCheckWaitTime() time.Duration
- func (job SimpleDMLJob) GetInterval() time.Duration
- func (job SimpleDMLJob) GetMaxCounter() int
- func (job SimpleDMLJob) Prepare(db *sql.DB) error
- func (job SimpleDMLJob) RunDML(db *sql.DB, c int) error
- type Status
Constants ¶
const (
// DefaultName is the default name of the command line.
DefaultName = "mysql-agent-checker"
)
Variables ¶
var ChaosRegistry map[string]func(s *Server) error
ChaosRegistry registers chaos situation
Functions ¶
func PartitionIncoming ¶
PartitionIncoming partitions the incoming network for the partitionedAZ, with the partitionType
func PartitionOutgoing ¶
PartitionOutgoing partitions the outgoing network for the partitionedAZ, with the partitionType
func RunKill9Agent ¶
RunKill9Agent runs `docker exec <containerName> kill -9 <agentPID>`
func RunStartAgent ¶
RunStartAgent runs `docker start <containerName>`
func RunStopAgent ¶
RunStopAgent runs `docker stop <containerName>`
func RunStopSlave ¶
RunStopSlave runs `stop slave` on the given DB
Types ¶
type Config ¶
type Config struct { *flag.FlagSet ClusterName string `toml:"cluster-name" json:"cluster-name"` EtcdURLs string `toml:"etcd-urls" json:"etcd-urls"` EtcdDialTimeout time.Duration EtcdRootPath string `toml:"etcd-root-path" json:"etcd-root-path"` EtcdUsername string `toml:"etcd-username" json:"etcd-username"` EtcdPassword string `toml:"etcd-password" json:"etcd-password"` MaxCounter int `toml:"max-counter" json:"max-counter"` LogLevel string `toml:"log-level" json:"log-level"` LogFile string `toml:"log-file" json:"log-file"` LogRotate string `toml:"log-rotate" json:"log-rotate"` DBConfig types.DBConfig `toml:"db-config" json:"db-config"` RootUser string `toml:"root-user" json:"user"` RootPassword string `toml:"root-password" json:"password"` IDContainerMapping map[string]string `toml:"id-container-mapping" json:"id-container-mapping"` ContainerAZMapping map[string]string `toml:"container-az-mapping" json:"container-az-mapping"` PartitionTemplate string `toml:"partition-template" json:"partition-template"` PartitionType string `toml:"partition-type" json:"partition-type"` ChaosJob string // contains filtered or unexported fields }
Config is the config of checker
type DMLJob ¶
type DMLJob interface { Prepare(db *sql.DB) error RunDML(db *sql.DB, counter int) error Check(db *sql.DB) int GetInterval() time.Duration GetMaxCounter() int GetCheckWaitTime() time.Duration }
DMLJob is the abstraction of the writing and checking job
type LongTxnJob ¶
type LongTxnJob struct{}
LongTxnJob is the DMLJob that runs time costing DML
func (LongTxnJob) Check ¶
func (job LongTxnJob) Check(db *sql.DB) int
Check is how this job is checked
func (LongTxnJob) GetCheckWaitTime ¶
func (job LongTxnJob) GetCheckWaitTime() time.Duration
GetCheckWaitTime returns the time to wait before check
func (LongTxnJob) GetInterval ¶
func (job LongTxnJob) GetInterval() time.Duration
GetInterval returns the interval of running dml
func (LongTxnJob) GetMaxCounter ¶
func (job LongTxnJob) GetMaxCounter() int
GetMaxCounter return the times that the dml will be run
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the checker server
type SimpleDMLJob ¶
type SimpleDMLJob struct{}
SimpleDMLJob is the DMLJob that runs simple DML
func (SimpleDMLJob) Check ¶
func (job SimpleDMLJob) Check(db *sql.DB) int
Check is how this job is checked
func (SimpleDMLJob) GetCheckWaitTime ¶
func (job SimpleDMLJob) GetCheckWaitTime() time.Duration
GetCheckWaitTime returns the time to wait before check
func (SimpleDMLJob) GetInterval ¶
func (job SimpleDMLJob) GetInterval() time.Duration
GetInterval returns the interval of running dml
func (SimpleDMLJob) GetMaxCounter ¶
func (job SimpleDMLJob) GetMaxCounter() int
GetMaxCounter return the times that the dml will be run