api

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	New               Constructor
	Flags             *pflag.FlagSet
	Name              string
	Description       string
	IgnoreCommonFlags bool
}

type Constructor

type Constructor func(*pflag.FlagSet) (*Trigger, error)

type DistributionType added in v2.1.0

type DistributionType string
const (
	NoneDistribution    DistributionType = "none"
	RegularDistribution DistributionType = "regular"
	RandomDistribution  DistributionType = "random"
)

type Options

type Options struct {
	Scenario        string
	MaxDuration     time.Duration
	Concurrency     int
	MaxIterations   uint64
	MaxFailures     uint64
	MaxFailuresRate int
	Verbose         bool
	VerboseFail     bool
	IgnoreDropped   bool
}

type Parameter

type Parameter struct {
	Name        string
	Short       string
	Description string
	Default     string
}

type RateFunction

type RateFunction func(time.Time) int

func NewDistribution

func NewDistribution(
	distributionTypeArg DistributionType,
	iterationDuration time.Duration,
	rateFn RateFunction,
	randomFnArg func(int) int,
) (time.Duration, RateFunction, error)

func WithJitter

func WithJitter(rate RateFunction, multiple float64) RateFunction

type Rates

type Rates struct {
	Rate              RateFunction
	IterationDuration time.Duration
	Duration          time.Duration
}

type Trigger

type Trigger struct {
	Trigger     WorkTriggerer
	DryRun      RateFunction
	Description string
	Options     Options
	Duration    time.Duration
}

type WorkTriggerer

type WorkTriggerer func(ctx context.Context, output *ui.Output, workers *workers.PoolManager, options options.RunOptions)

func NewIterationWorker

func NewIterationWorker(iterationDuration time.Duration, rate RateFunction) WorkTriggerer

NewIterationWorker produces a WorkTriggerer which triggers work at fixed intervals.

Jump to

Keyboard shortcuts

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