Files
modules/measurement-rate-control/hyper-p2p-sla-budget
Raven ScottandCursor 2e7063eb53 feat(messaging-gossip,measurement): manually deepen category APIs and tests
- gossip-mesh: pruneSeen, listRecent, setDefaults, publish stats, peerCount
- dedup-filter: addBatch, mergeRemote, snapshot, fillRatio, remove
- percentile-sketch: addBatch, merge, range, median, gossip report path
- sla-budget: transfer, setCap, usageRatio, allSnapshots, refill
- Expanded brittle tests and category README highlights

Co-authored-by: Cursor <[email protected]>
2026-05-21 02:14:41 -04:00
..
2026-05-20 23:36:32 -04:00
2026-05-20 22:56:32 -04:00
2026-05-21 00:07:44 -04:00
2026-05-21 02:11:15 -04:00
2026-05-20 21:57:50 -04:00
2026-05-20 21:57:50 -04:00
2026-05-20 22:56:32 -04:00

hyper-p2p-sla-budget

Per-service token budgets for SLA-aware rate limiting.

Category: measurement-rate-control

Protocol: sla-budget/v1

When to use

Allocating and consuming request tokens per API or tenant service name.

When not to use

Time-windowed rate limits with automatic refill (pair with a scheduler module).

Quick start

const { HyperP2PSlaBudget } = require('hyper-p2p-sla-budget')
const b = new HyperP2PSlaBudget()
b.allocate('api', 100)
b.consume('api', 1)
console.log(b.remaining('api'))

Docs

Test

npm install && npm test