placebo

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Sleep is how long to sleep for. If unspecified, the test run will finish
	// instantly.
	Sleep httpapi.Duration `json:"sleep"`
	// Jitter is the maximum amount of jitter to add to the sleep duration. The
	// sleep value will be increased by a random value between 0 and jitter if
	// jitter is greater than 0.
	Jitter httpapi.Duration `json:"jitter"`
	// FailureChance is the chance that the test will fail. The value must be
	// between 0 and 1.
	FailureChance float64 `json:"failure_chance"`
}

func (Config) Validate

func (c Config) Validate() error

type Runner

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

func NewRunner

func NewRunner(cfg Config) *Runner

NewRunner creates a new placebo loadtest Runner. The test will sleep for the specified duration if set, and will add a random amount of jitter between 0 and the specified jitter value if set.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, _ string, logs io.Writer) error

Run implements Runnable.

Jump to

Keyboard shortcuts

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