Help us shape the future of Go! Take the 2026 Go Developer Survey

loadgen

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package loadgen holds pieces shared by the load generator adapters (command, http, kv, tool).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rate

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

Rate is a target requests/s that SetRate may change while the generator keeps running, with no restart needed: callers just re-read it (e.g. on their next tick or Status call).

func (*Rate) Get

func (r *Rate) Get() float64

func (*Rate) Set

func (r *Rate) Set(rps float64)

type Reservoir

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

Reservoir keeps the most recent latencies for percentiles.

func NewReservoir

func NewReservoir(n int) *Reservoir

func (*Reservoir) Add

func (r *Reservoir) Add(d time.Duration)

func (*Reservoir) Percentiles

func (r *Reservoir) Percentiles() core.Latency

Directories

Path Synopsis
Package command wraps any load tool behind shell commands: start, stop, rate (with {rate}) and status, whose output may be JSON {"running":..,"rate":..,"sent":..,"failed":..}.
Package command wraps any load tool behind shell commands: start, stop, rate (with {rate}) and status, whose output may be JSON {"running":..,"rate":..,"sent":..,"failed":..}.
Package http is a built-in open-model load generator: requests go out at a fixed rate whatever the latency (no coordinated omission), from this process, for as long as rig runs.
Package http is a built-in open-model load generator: requests go out at a fixed rate whatever the latency (no coordinated omission), from this process, for as long as rig runs.
Package kv drives load generators that run as services and read their rate from a key-value store: the rate is written to a key (or one JSON field of it), start and stop scale the generator services, and counters come from metrics queries when configured.
Package kv drives load generators that run as services and read their rate from a key-value store: the rate is written to a key (or one JSON field of it), start and stop scale the generator services, and counters come from metrics queries when configured.
Package tool drives an external load tool (k6, vegeta, ghz) as a rig load generator: the tool runs as a child process at the current rate and its per-request results stream back into the counters.
Package tool drives an external load tool (k6, vegeta, ghz) as a rig load generator: the tool runs as a child process at the current rate and its per-request results stream back into the counters.

Jump to

Keyboard shortcuts

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