Skip to content

docs: thundering-herd demo view + resilience-demo enrich pass#111

Merged
lesnik512 merged 9 commits into
mainfrom
resilience-demo-herd
Jul 19, 2026
Merged

docs: thundering-herd demo view + resilience-demo enrich pass#111
lesnik512 merged 9 commits into
mainfrom
resilience-demo-herd

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Adds a many-client thundering-herd macro view to the retry demo page and folds three visualization techniques across the resilience demo suite. Design + rationale: planning/changes/2026-07-19.02-resilience-demo-herd-and-enrich.md.

What's new

  • Herd view (retry page): below the single-client demo, two backend-call-rate strips — 20 naive clients vs 20 httpware clients — through a flapping outage (down → recover → down). Naive's unbounded retries surge on each dip and clear on recovery (real spikes-with-gaps, gaps = recovery, not lockstep); httpware stays flat. Peak load: ~18× vs ~3× (httpware bounded by max_attempts at demo scale; per-client budget, never shared). Faithful model — reuses the real RetryBudget.
  • Enrich pass: a CSS countdown ring on the timeout (deadline) and circuit-breaker (reset) pages only — retry's backoff is sub-tick at the demo's time compression, so a faithful ring there is impossible and was deliberately dropped, not faked; a color-independent jagged failure shape everywhere; a live macro strip with active-phase label on the full-stack page.

Notes

  • architecture/ untouched — docs only, no capability contract moves.
  • The engine's guided-tour driver was extracted to a shared makeTour factory so the herd's mini-tour reuses it (no divergent copies).

Verification

  • just docs-build --strict clean; just check-planning OK; node --check docs/demos/engine.js clean.
  • Headless jsdom harnesses green: real-order page load + every scenario's tour (verify-demos, verify-herd, verify-real-page); the herd trace asserts the spikes-with-gaps shape (3 separated naive spikes, recovery gaps) plus naive ≫ httpware and httpware bounded near max_attempts; the ring trace confirms activation on timeout + circuit-breaker.

🤖 Generated with Claude Code

lesnik512 and others added 9 commits July 19, 2026 17:39
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
One client retrying a blip is invisible; twenty clients retrying a
sustained outage is a traffic weapon unless retries are spread out and
capped. Adds mountHerd (composing Task 1's tour driver and Task 2's
simulateHerd/renderRateStrip) as a stacked "Now 20 clients" section
below the existing single-client retry demo, with a mini-tour
spotlighting the measured peak-load gap: naive ~70x (unbounded, still
growing) vs httpware ~3x (capped by each client's own max_attempts,
never a shared budget).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CSS-driven conic countdown ring on the timeout and circuit-breaker pages'
fixed lane-B elements (elapsedB / brkB), showing the multi-second deadline
and reset-timeout waits. Retry and bulkhead get no ring per the fidelity
decision (backoff is sub-tick at this demo's time compression). All pages
gain a jagged clip-path failure dot so outcomes read without color.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reuse renderRateStrip on the full-stack page: a small backend call-rate
strip below the lanes, revealed each tick with the single-client run,
labeled with the active incident phase. Gated by config.macroStrip so
every other lane page is unaffected. Finalizes the change summary with
the realized herd multipliers (naive ~70x vs httpware ~3x).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The design body still carried the pre-measurement ~10x/~1.2x placeholders and
a stale retry-ring mention. Align with the shipped model: httpware is bounded
near its max_attempts cap (~3x) at demo scale, naive ~70x; ring is CB+timeout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The herd's sustained outage produced a smooth rising ramp for
independent, un-synchronized naive clients, not the spikes-with-gaps
the tour copy claims. Switch the model input to a flapping backend
(down/recover x3) so unbounded retries genuinely surge on each dip
and clear on recovery -- real spikes-with-gaps, faithfully sourced
from backend recovery rather than client synchronization. The
existing simulateHerd algorithm already produces this shape once the
fault flaps; this is a scenario + rendering + copy change.

Add computeOutageBands so the rate strip shades each dip separately,
leaving recovery gaps visibly unshaded between them (falls back to
the single outage window for callers that don't pass bands, so the
full-stack macro strip is unaffected). Re-measure the naive
multiplier against the flapping scenario (~18x, down from the
sustained model's ~70x since each dip is shorter) and reconcile
retry.md's copy and the change-file's motivation/design/payoff
language to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… intro

The only mountHerd caller now passes an explicit flapping-aware intro; the
shared default's "sustained" was dead but a latent trap for future callers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesnik512
lesnik512 merged commit 48c0492 into main Jul 19, 2026
7 checks passed
@lesnik512
lesnik512 deleted the resilience-demo-herd branch July 19, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant