Documentation
¶
Index ¶
- Constants
- func Bits(defaults ...uint64) ([]uint64, error)
- func Curves(curveIDs ...math.CurveID) []math.CurveID
- func Duration() time.Duration
- func Integers[T constraints.Integer](str string, defaults ...T) ([]T, error)
- func NumInputs(defaults ...int) ([]int, error)
- func NumOutputs(defaults ...int) ([]int, error)
- func Workers(defaults ...int) ([]int, error)
- type Bucket
- type Case
- type Result
- type TestCase
Constants ¶
const ( ColorReset = "\033[0m" ColorRed = "\033[31m" ColorGreen = "\033[32m" ColorYellow = "\033[33m" ColorBlue = "\033[34m" )
ANSI Color Codes for output.
Variables ¶
This section is empty.
Functions ¶
func Bits ¶
Bits parses the package-level `-bits` flag and returns a slice of bit sizes. If the flag is empty the provided defaults are returned. The returned values are uint64 and an error is returned if parsing fails.
func Curves ¶
Curves parses the package-level `-curves` flag and returns a slice of math.CurveID. The flag may contain comma-separated numeric curve IDs or known curve names (e.g. "BN254", "BLS12_381_BBS_GURVY", "BLS12_381_BBS_GURVY_FAST_RNG"). If the flag is empty, the provided curveIDs are returned as defaults.
func Duration ¶
Duration returns the parsed package-level `-duration` flag as a time.Duration. If the flag is zero, Duration returns 1 second as a sane default.
func Integers ¶
func Integers[T constraints.Integer](str string, defaults ...T) ([]T, error)
Integers is a generic helper that parses a comma-separated string of unsigned integers into a slice of type T (which must be an integer type). If the input string is empty the provided defaults are returned. It trims whitespace and returns a parsing error on invalid numeric values.
func NumInputs ¶
NumInputs parses the package-level `-num_inputs` flag and returns a slice of ints. If the flag is empty the provided defaults are returned. Parsing errors are returned.
func NumOutputs ¶
NumOutputs parses the package-level `-num_outputs` flag and returns a slice of ints. If the flag is empty the provided defaults are returned. Parsing errors are returned.
func Workers ¶
Workers parses the package-level `-workers` flag and returns a slice of worker counts. The flag accepts comma-separated integers and the special token "NumCPU" which is translated to the runtime.NumCPU() value. If the flag is empty the provided defaults are returned. Parsing errors are returned.
Types ¶
type Result ¶
type Result struct {
GoRoutines int
OpsTotal uint64
Duration time.Duration
OpsPerSecReal float64
OpsPerSecPure float64
AvgLatency time.Duration
StdDevLatency time.Duration
Variance float64
P50Latency time.Duration
P75Latency time.Duration
P95Latency time.Duration
P99Latency time.Duration
MinLatency time.Duration
MaxLatency time.Duration
IQR time.Duration // Interquartile Range (measure of spread)
Jitter time.Duration // Avg change between consecutive latencies
CoeffVar float64
BytesPerOp uint64
AllocsPerOp uint64
Histogram []Bucket
}
Result holds the comprehensive benchmark metrics.