Documentation
¶
Overview ¶
Package bench measures token performance with strictly bounded load.
Every run is capped by both wall-clock duration and an absolute operation budget per primitive, so a benchmark can never hammer a production HSM indefinitely. All key material is ephemeral (session objects only).
Index ¶
Constants ¶
View Source
const ( DefaultDuration = 3 * time.Second MaxDuration = 60 * time.Second DefaultMaxOps = 5000 HardMaxOps = 1_000_000 DefaultSessions = 1 MaxSessions = 32 )
Limits protecting tokens from unbounded load.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Measurement ¶
type Measurement struct {
Name string `json:"name"`
Supported bool `json:"supported"`
Ops int64 `json:"ops"`
Elapsed time.Duration `json:"elapsed_ns"`
OpsPerSec float64 `json:"ops_per_sec"`
Error string `json:"error,omitempty"`
}
Measurement is the result for one primitive.
type Options ¶
type Options struct {
Duration time.Duration `json:"duration_ns"`
MaxOps int `json:"max_ops"`
Sessions int `json:"sessions"`
}
Options bounds a benchmark run.
type Result ¶
type Result struct {
Options Options `json:"options"`
Measurements []Measurement `json:"measurements"`
}
Result is a full benchmark run.
Click to show internal directories.
Click to hide internal directories.