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

load

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Describe added in v0.3.0

func Describe(cfg Config) string

Describe is the profile line printed for a run.

func ParseThresholds

func ParseThresholds(in []string) ([]threshold, error)

ParseThresholds parses expressions such as "p95 < 200ms" and "errorRate < 1%".

Types

type Config

type Config struct {
	VUs          int
	VUsTo        int
	UsersToSet   bool
	Rate         float64
	RateSet      bool
	RateTo       float64
	RateToSet    bool
	StageText    []string
	Stages       []Stage
	MaxInFlight  int
	MaxEndpoints int
	Duration     time.Duration
	Warmup       time.Duration
	RPS          int
	Thresholds   []string
	Vars         map[string]any
	Client       *http.Client
	Tag          string
	Timeout      time.Duration
	Env          string
	Suite        *suite.Suite
	Dial         func(context.Context, string, map[string]any) (engine.Link, error)
	NewPage      func(context.Context) (engine.Page, error)
}

func Normalize added in v0.3.0

func Normalize(cfg Config) (Config, error)

Normalize fills defaults and rejects a profile that mixes users with a start rate.

type Endpoint

type Endpoint struct {
	Name   string
	Count  int64
	Errors int64
	Stats  Stats
	RPS    float64
}

type Result

type Result struct {
	Started          time.Time
	Elapsed          time.Duration
	Profile          string
	Open             bool
	VUs              int
	Iterations       int64
	FailedIterations int64
	Requests         int64
	TransportErrors  int64
	EndpointLimit    int
	EndpointOverflow int64
	Endpoints        []Endpoint
	Thresholds       []Threshold
	Passed           bool
	Failures         []engine.ScenarioResult
	Overall          Stats
	Scheduled        Stats
	MissedStarts     int64
	LateStarts       int64
	MaxStartLag      time.Duration
	CPU              time.Duration
	RSS              uint64
	Goroutines       int
}

func Run

func Run(ctx context.Context, f *feature.File, cfg Config) (Result, error)

type Stage added in v0.3.0

type Stage struct {
	Rate     bool
	Spike    bool
	From     float64
	To       float64
	ToSet    bool
	Duration time.Duration
}

Stage is one segment of a load plan. Users and rate segments cannot mix. A spike jumps to From for Duration, then returns to the level before it.

func ParseStage added in v0.3.0

func ParseStage(raw string) (Stage, error)

ParseStage reads "users=1:40 duration=30s" or "spike rate=200 duration=10s".

type Stats

type Stats struct {
	Min  time.Duration
	Max  time.Duration
	Mean time.Duration
	P50  time.Duration
	P95  time.Duration
	P99  time.Duration
}

type Threshold

type Threshold struct {
	Text   string
	Passed bool
	Actual string
}

Jump to

Keyboard shortcuts

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