Documentation
¶
Overview ¶
Package pace sends events on a fixed schedule (an open load model).
In a closed loop, a producer that waits for each reply sends nothing while the server is stalled, so a stall shows up as a single slow sample (coordinated omission). Run keeps the schedule: every event planned during a stall still fires on time, in its own goroutine, and callers measure latency from the planned time, so the stall reaches p99 as it would for real users.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(ctx context.Context, start time.Time, rate float64, maxInFlight int, fire func(planned time.Time)) (sent, dropped int64)
Run fires one call per planned time from start until ctx is done, never waiting for a call to return. At most maxInFlight calls run at once; an event planned while that many are still running is dropped and counted, and a run with drops is invalid (the load generator, not the server, set the pace). If Run falls behind (a slow scheduler), it fires the late events at once instead of skipping them. It returns after ctx is done and every call has returned.
Types ¶
This section is empty.