nemesis

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContainerKillGenerator

func NewContainerKillGenerator(name string) core.NemesisGenerator

NewContainerKillGenerator creates a generator.

func NewCoordinationKillGenerator

func NewCoordinationKillGenerator(nodes []cluster.Node) (core.NemesisGenerator, *core.NemesisControl)

NewCoordinationKillGenerator ...

func NewIOChaosGenerator

func NewIOChaosGenerator(name string) core.NemesisGenerator

NewIOChaosGenerator create an io chaos.

func NewKillGenerator

func NewKillGenerator(name string) core.NemesisGenerator

NewKillGenerator creates a generator. Name is random_kill, minor_kill, major_kill, and all_kill.

func NewLeaderShuffleGenerator

func NewLeaderShuffleGenerator(name string) *leaderShuffleGenerator

NewLeaderShuffleGenerator ...

func NewNetemChaos

func NewNetemChaos(name string) core.NemesisGenerator

NewNetemChaos create a netem chaos.

func NewNetworkPartitionGenerator

func NewNetworkPartitionGenerator(name string) core.NemesisGenerator

NewNetworkPartitionGenerator creates a generator. Name is partition-one, etc.

func NewPodKillGenerator

func NewPodKillGenerator(name string) core.NemesisGenerator

NewPodKillGenerator creates a generator.

func NewScalingGenerator

func NewScalingGenerator(name string) core.NemesisGenerator

NewScalingGenerator creates a generator.

func NewSchedulerGenerator

func NewSchedulerGenerator(name string) *schedulerGenerator

NewSchedulerGenerator ...

func NewTimeChaos

func NewTimeChaos(name string) core.NemesisGenerator

NewTimeChaos generate a time chaos.

Types

type Chaos

type Chaos struct {
	// contains filtered or unexported fields
}

Chaos knows how to operate the chaos provided by pingcap/chaos-mesh

func New

func New(cli client.Client) *Chaos

New will Create a chaos client.

func (*Chaos) ApplyIOChaos

func (c *Chaos) ApplyIOChaos(ioc *v1alpha1.IoChaos) error

ApplyIOChaos run an io-chaos.

func (*Chaos) ApplyNetChaos

func (c *Chaos) ApplyNetChaos(nc *v1alpha1.NetworkChaos) error

ApplyNetChaos apply the chaos to cluster using Client.

func (*Chaos) ApplyPodChaos

func (c *Chaos) ApplyPodChaos(ctx context.Context, pc *v1alpha1.PodChaos) error

ApplyPodChaos apply the pod chaos to cluster using Client.

func (*Chaos) ApplyTimeChaos

func (c *Chaos) ApplyTimeChaos(ctx context.Context, pc *v1alpha1.TimeChaos) error

ApplyTimeChaos apply the pod chaos to cluster using Client.

func (*Chaos) CancelIOChaos

func (c *Chaos) CancelIOChaos(ioc *v1alpha1.IoChaos) error

CancelIOChaos cancel the io chaos.

func (*Chaos) CancelNetChaos

func (c *Chaos) CancelNetChaos(nc *v1alpha1.NetworkChaos) error

CancelNetChaos apply the chaos to cluster using Client.

func (*Chaos) CancelPodChaos

func (c *Chaos) CancelPodChaos(ctx context.Context, pc *v1alpha1.PodChaos) error

CancelPodChaos Delete the pod chaos using Client.

func (*Chaos) CancelTimeChaos

func (c *Chaos) CancelTimeChaos(ctx context.Context, pc *v1alpha1.TimeChaos) error

CancelTimeChaos Delete the pod chaos using Client.

type IOChaosGenerator

type IOChaosGenerator struct {
	// contains filtered or unexported fields
}

IOChaosGenerator ...

func (IOChaosGenerator) Generate

func (g IOChaosGenerator) Generate(nodes []cluster.Node) []*core.NemesisOperation

Generate generates nemesises based on nemesis type.

func (IOChaosGenerator) Name

func (g IOChaosGenerator) Name() string

Name ...

type LeaderShuffler

type LeaderShuffler struct {
	*pdutil.Client
	// contains filtered or unexported fields
}

LeaderShuffler creates operators in PD to schedule the region containing the regionKey.

func NewLeaderShuffler

func NewLeaderShuffler(pdAddr string, regionKey string) *LeaderShuffler

NewLeaderShuffler creates a LeaderShuffler to schedule the region containing the regionKey.

func (*LeaderShuffler) Invoke

func (l *LeaderShuffler) Invoke(ctx context.Context, node *cluster.Node, args ...interface{}) error

Invoke implements Nemesis.Invoke that invokes the nemesis.

func (LeaderShuffler) Name

func (l LeaderShuffler) Name() string

Name implements Nemesis.Name that returns the unique name for the nemesis.

func (*LeaderShuffler) Recover

func (l *LeaderShuffler) Recover(ctx context.Context, node *cluster.Node, args ...interface{}) error

Recover implements Nemesis.Recover that recovers the nemesis.

func (*LeaderShuffler) ShuffleLeader

func (l *LeaderShuffler) ShuffleLeader() error

ShuffleLeader create a operator in PD to schedule the region.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL