Documentation
¶
Overview ¶
Package benchtest provides shared benchmark helpers for LogLayer transport and framework benchmarks. Mirrors the role of transport/transporttest for contract tests: lets every wrapper-module bench file share a single set of fixtures and runner shapes so the numbers are directly comparable and so per-module copies can't drift.
Index ¶
Constants ¶
const Msg = "user logged in"
Msg is the standard benchmark message. Use it as the argument to every Info call inside a runner so the per-call payload is constant across modules.
Variables ¶
var Discard discardWriter
Discard is a no-op io.Writer suitable for any transport whose throughput is being measured. We use this in place of io.Discard because some libraries (charmbracelet/log) detect io.Discard and short-circuit their formatting pipeline; that would understate their real cost. Discard looks like any other writer so every library exercises its full write path.
var TestUser = User{ID: 42, Name: "Alice", Email: "alice@example.com"}
TestUser is the standard benchmark value passed to every struct- metadata runner.
Functions ¶
func Metadata ¶
func Metadata() loglayer.Metadata
Metadata returns the standard benchmark map[string]any. A fresh map is returned each call so map-mutating plugins under benchmark don't pollute later iterations.