Cyan = in flight, green = admitted, red = rejected (429)
Cumulative admitted requests

API Rate Limiter: Token Bucket, Fixed Window and Sliding Window (2D)

Send one request stream through a token bucket, a fixed-window counter and a sliding-window log at the same time. Change the client rate, sustained limit, burst capacity and window length, try spikes, Poisson traffic and the window-boundary burst, and watch packets cross a Blender-built gate while the bucket fills and drains. Numerical checks verify the C + R T bound, the sliding-window invariant and the 2N boundary flaw.

Made with 🟠 Blender