load

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package load aggregates latency samples from a load run and reports k6-style summary statistics. It holds no MCP logic: the caller drives the virtual users through the existing rondo engine and feeds results here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector accumulates per-call results across goroutines.

func (*Collector) Record

func (c *Collector) Record(d time.Duration, ok bool)

Record adds one call's latency and whether it passed.

func (*Collector) Summarize

func (c *Collector) Summarize(elapsed time.Duration) Summary

Summarize computes the summary over the elapsed wall-clock time. Percentiles use the nearest-rank method on the sorted samples; swap in an HdrHistogram if sample counts ever grow past what a slice should hold.

type Summary

type Summary struct {
	Calls   int
	Failed  int
	Elapsed time.Duration
	RPS     float64
	P50     time.Duration
	P90     time.Duration
	P95     time.Duration
	P99     time.Duration
	Max     time.Duration
}

Summary is the k6-shaped result of a load run.

func (Summary) PassRate

func (s Summary) PassRate() float64

func (Summary) String

func (s Summary) String() string

type Threshold

type Threshold struct {
	Metric string // p50, p90, p95, p99, max
	Limit  time.Duration
}

Threshold is a pass/fail gate like k6's, e.g. "p95<500ms".

func ParseThreshold

func ParseThreshold(s string) (Threshold, error)

ParseThreshold parses "p95<500ms".

func (Threshold) Met

func (t Threshold) Met(s Summary) bool

Met reports whether the summary satisfies the threshold.

func (Threshold) String

func (t Threshold) String() string

Jump to

Keyboard shortcuts

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