Help us shape the future of Go! Take the 2026 Go Developer Survey

3-rate-limit

command
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Command spike3 measures the sustained request rate OpenAlex allows in the polite pool.

Spike 3 of docs/ARCHITECTURE_PHASE1.md §9: the documentation says 10 requests per second in one place and 100 in another. ADR-004 sets a rate.Limiter token bucket "well below the measured limit", and it cannot be set from a number that is off by 10x in an unknown direction.

This deliberately probes a free public service, so it is built to be polite:

  • single-work requests rather than list requests
  • a short burst at each target rate, not a sustained flood
  • it aborts the entire run on the first 429 rather than confirming it twice
  • rotating IDs, so a CDN cache does not make the test meaningless

The single-work choice was made to be cheap on credits, and the run then discovered why it was cheaper than expected: single-work fetches cost nothing at all, and list requests cost 1 credit against a 1,000/day allowance — the reverse of what the design documents assumed. See docs/SPIKES.md.

Usage:

go run ./spikes/3-rate-limit

Jump to

Keyboard shortcuts

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