example

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command example runs a self-contained simulation of agilelimiter against a toy downstream whose latency rises as the offered rate approaches its capacity, and whose capacity changes over time:

0s .. 3s   healthy   (capacity ~150 req/s)
3s .. 6s   degraded  (capacity drops to ~60 req/s)
6s .. end  recovered (capacity back to ~150 req/s)

Watch the "rate" column: the controller discovers a safe rate, backs off when the downstream degrades, and ramps back up once it recovers. No real network is involved — the downstream is a formula — so this is deterministic enough to reason about and quick enough to run.

Run it with:

go run ./example

Directories

Path Synopsis
Command concurrency runs a self-contained simulation of the *inbound* ConcurrencyLimiter against a toy model of this very service, whose per-request handling time rises as more requests run at once, and whose capacity changes over time:
Command concurrency runs a self-contained simulation of the *inbound* ConcurrencyLimiter against a toy model of this very service, whose per-request handling time rises as more requests run at once, and whose capacity changes over time:
Command httpserver runs a tiny net/http service whose /api/* routes are protected by an adaptive concurrency limiter, then hammers it with a burst of concurrent clients.
Command httpserver runs a tiny net/http service whose /api/* routes are protected by an adaptive concurrency limiter, then hammers it with a burst of concurrent clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL