util

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: 24 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnClientLoop

func OnClientLoop(
	ctx context.Context,
	client core.Client,
	node cluster.ClientNode,
	proc *int64,
	requestCount *int64,
	recorder *history.Recorder,
)

OnClientLoop sends client requests in a loop, client applies a proc id as it's identifier and if the response is some kinds of `Unknown` type, it will change a proc id on the next loop. Each request costs a requestCount, and loop finishes after requestCount is used up or the `ctx` has been done.

func ParseNemesisGenerators

func ParseNemesisGenerators(names string) (nemesisGens []core.NemesisGenerator)

ParseNemesisGenerators parses NemesisGenerator from string literal

Types

type ClientLoopFunc

type ClientLoopFunc func(ctx context.Context,
	client core.Client,
	node cluster.ClientNode,
	proc *int64,
	requestCount *int64,
	recorder *history.Recorder)

ClientLoopFunc defines ClientLoop func

func BuildClientLoopThrottle

func BuildClientLoopThrottle(duration time.Duration) ClientLoopFunc

BuildClientLoopThrottle receives a duration and build a ClientLoopFunc that sends a request every `duration` time

type Suit

type Suit struct {
	*control.Config
	// Provider deploy the SUT cluster
	cluster.Provider
	// ClientCreator creates client
	core.ClientCreator
	// NemesisGens saves NemesisGenerator
	NemesisGens []core.NemesisGenerator
	// ClientRequestGen
	ClientRequestGen ClientLoopFunc
	// perform service quality checking
	VerifySuit verify.Suit
	// cluster definition
	ClusterDefs cluster.Cluster
	// Plugins
	Plugins []control.Plugin
}

Suit is a basic chaos testing suit with configurations to run chaos.

func (*Suit) Run

func (suit *Suit) Run(ctx context.Context)

Run runs the suit.

Jump to

Keyboard shortcuts

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