Documentation
¶
Overview ¶
Package loadgen holds the reusable, testable pieces of the livck-loadgen fake-fleet driver: the catalog-driven synthetic report generator and the sender-side latency/status recorder. The live orchestration (enroll storm, ramp, pulse sampling) lives in cmd/livck-loadgen so this package stays pure and unit-testable. ASCII only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator produces synthetic reports for one simulated agent. It is NOT safe for concurrent use: each simulated agent owns one generator on its own goroutine (matching a real agent's single collect loop).
func NewGenerator ¶
NewGenerator builds a generator seeded from seed so each simulated agent walks a distinct value path (distinct-looking hosts) while a run stays reproducible.
func (*Generator) KeyCount ¶
KeyCount is the number of base catalog keys a clean report carries (before avg+max companions). Exposed for the loadgen's throughput accounting.
func (*Generator) PoisonReport ¶
PoisonReport returns a deliberately malformed report to exercise pulse's validation ladder under load: unknown keys (dropped, counted) and out-of-range values (clamped). The envelope stays valid protobuf+zstd, so this probes the per-key validation cost, not the batch-reject path.
type Raw ¶
type Raw struct {
Total, OK, Retry429, Retry5xx, Drop4xx, Auth, Other, TransportErr int64
SumNanos uint64
Buckets []uint64
}
Raw is a lossless readout of the recorder's counters and histogram buckets at one instant, so two Raws can be diffed into a per-window Snapshot (percentiles included). It is the basis for measuring one ramp step in isolation instead of reporting cumulative totals.
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder accumulates ingest request outcomes lock-free (atomics only) so it can sit in the hot RoundTrip path of thousands of concurrent senders.
type Snapshot ¶
type Snapshot struct {
Total int64
OK int64
Retry429 int64
Retry5xx int64
Drop4xx int64
Auth int64
Other int64
TransportErr int64
MeanMs float64
P50Ms float64
P90Ms float64
P99Ms float64
}
Snapshot is an immutable readout of the recorder at one instant.
func DeltaSnapshot ¶
DeltaSnapshot returns the readout for the window (from, to]: counts are the difference and percentiles come from the difference of the histogram buckets, so one ramp step is measured without the earlier steps' history.