placebo

package
v2.38.6 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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