Versions in this module Expand all Collapse all v0 v0.1.0 Aug 18, 2026 Changes in this version + const DefaultBetweenRequests + const DefaultHTTPTimeout + const DefaultMaxBodyBytes + const DefaultMaxIdleConnsPerHost + const DefaultMaxRedirects + const LabelCheck + const LabelError + const LabelExpected + const LabelMethod + const LabelName + const LabelScenario + const LabelStatus + const MaxFailureMessage + const MetricChecks + const MetricErrors + const MetricHTTPReqBytesIn + const MetricHTTPReqBytesOut + const MetricHTTPReqConnecting + const MetricHTTPReqDuration + const MetricHTTPReqFailed + const MetricHTTPReqTLS + const MetricHTTPReqWaiting + const MetricHTTPReqs + const MetricIterationDuration + const MetricIterationFailed + const MetricIterations + const MetricVUs + var Default = NewRegistry() + func DefaultIsSuccess(r *Response) bool + func DeriveRequestName(method, path string) string + func Register(s Scenario) + func Slice[T any](s Shard, items []T) []T + func StateOf[T any](vu *VU, key string) (T, bool) + func TruncateMessage(text string) string + type Failure struct + ErrorClass string + Message string + Method string + Name string + Status int + type FailureReporter interface + ReportFailure func(Failure) + type HTTPClient struct + func (c *HTTPClient) Delete(ctx context.Context, rawURL string) (*Response, error) + func (c *HTTPClient) Do(ctx context.Context, req Request) (*Response, error) + func (c *HTTPClient) Get(ctx context.Context, rawURL string) (*Response, error) + func (c *HTTPClient) PostJSON(ctx context.Context, rawURL string, body any) (*Response, error) + func (c *HTTPClient) PutJSON(ctx context.Context, rawURL string, body any) (*Response, error) + type HTTPClientFactory struct + func NewHTTPClientFactory(opts HTTPOptions) (*HTTPClientFactory, error) + func (f *HTTPClientFactory) Close() + func (f *HTTPClientFactory) New() *HTTPClient + type HTTPOptions struct + BaseURL string + BetweenRequests Pause + DisableCompression bool + DisableKeepAlives bool + DiscardBody bool + FollowRedirects bool + Headers http.Header + InsecureSkipTLSVerify bool + IsSuccess func(*Response) bool + IsolatePerVU bool + MaxBodyBytes int64 + MaxIdleConnsPerHost int + MaxRedirects int + NoBetweenRequests bool + Proxy string + Timeout time.Duration + Trace *bool + UserAgent string + type Labels struct + func LabelsFromMap(m map[string]string) Labels + func NewLabels(kv ...string) Labels + func (l Labels) All(yield func(key, value string) bool) + func (l Labels) Equal(other Labels) bool + func (l Labels) Get(key string) (string, bool) + func (l Labels) Hash() uint64 + func (l Labels) Len() int + func (l Labels) Map() map[string]string + func (l Labels) String() string + func (l Labels) With(kv ...string) Labels + type MetricKind uint8 + const KindCounter + const KindGauge + const KindRate + const KindTrend + func (k MetricKind) String() string + type Pause struct + Max time.Duration + Min time.Duration + func NewPause(d time.Duration) Pause + func NewPauseRange(minDur, maxDur time.Duration) Pause + func ParsePause(spec string) (Pause, error) + func (p Pause) Duration(rnd *rand.Rand) time.Duration + func (p Pause) IsZero() bool + func (p Pause) String() string + type Recorder interface + Count func(metric string, labels Labels, delta float64) + Gauge func(metric string, labels Labels, value float64) + Rate func(metric string, labels Labels, ok bool) + Trend func(metric string, labels Labels, value float64) + func DiscardRecorder() Recorder + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Clone() *Registry + func (r *Registry) Len() int + func (r *Registry) Lookup(name string) (Scenario, bool) + func (r *Registry) MustRegister(s Scenario) + func (r *Registry) Names() []string + func (r *Registry) Register(s Scenario) error + type Request struct + BetweenRequests *Pause + Body []byte + ExpectStatus []int + Form url.Values + Header http.Header + JSON any + Method string + Name string + Query url.Values + Tags Labels + Timeout time.Duration + URL string + type Response struct + Body []byte + BytesIn int64 + BytesOut int64 + ConnReused bool + Connecting time.Duration + Duration time.Duration + Err error + Header http.Header + Proto string + Status string + StatusCode int + TLSHandshake time.Duration + TTFB time.Duration + Truncated bool + func (r *Response) JSON(v any) error + func (r *Response) OK() bool + func (r *Response) String() string + func (r *Response) Text() string + type Scenario struct + Description string + Name string + OnVUStart func(ctx context.Context, vu *VU) error + OnVUStop func(ctx context.Context, vu *VU) error + Run func(ctx context.Context, vu *VU) error + Setup func(ctx context.Context) error + Teardown func(ctx context.Context) error + Weight int + func (s Scenario) EffectiveWeight() int + func (s Scenario) Validate() error + type Shard struct + Count uint32 + Index uint32 + func (s Shard) Owns(i int) bool + type VU struct + func NewVU(cfg VUConfig) *VU + func (vu *VU) BeginIteration(n int) + func (vu *VU) Check(name string, ok bool) bool + func (vu *VU) Checkf(name string, ok bool, format string, args ...any) bool + func (vu *VU) Close() error + func (vu *VU) EndIteration(elapsed time.Duration, err error) + func (vu *VU) Fail(err error) + func (vu *VU) HTTP() *HTTPClient + func (vu *VU) ID() int64 + func (vu *VU) Index() int + func (vu *VU) Iteration() int + func (vu *VU) Labels() Labels + func (vu *VU) Log() *slog.Logger + func (vu *VU) Metrics() Recorder + func (vu *VU) Rand() *rand.Rand + func (vu *VU) Scenario() string + func (vu *VU) SetState(key string, value any) + func (vu *VU) Shard() Shard + func (vu *VU) State(key string) (any, bool) + func (vu *VU) Tag(key, value string) + func (vu *VU) Think(ctx context.Context, d time.Duration) + func (vu *VU) ThinkBetween(ctx context.Context, minDur, maxDur time.Duration) + type VUConfig struct + HTTP *HTTPClient + ID int64 + Index int + Logger *slog.Logger + Rand *rand.Rand + Recorder Recorder + Scenario string + Shard Shard + Tags Labels