Skip to content

Add opt-in STAGGERED onboarding mode - #95

Open
ShvaykaD wants to merge 13 commits into
feature/gateway-rpcfrom
feat/staggered-onboarding-mode
Open

Add opt-in STAGGERED onboarding mode#95
ShvaykaD wants to merge 13 commits into
feature/gateway-rpcfrom
feat/staggered-onboarding-mode

Conversation

@ShvaykaD

Copy link
Copy Markdown
Contributor

Summary

Adds an opt-in STAGGERED onboarding mode for the persistent gateway and device tests. Instead of the phased warmup (connect-all → subscribe-all → announce-all), each entity runs its own lifecycle — connect → announce sub-devices (gateway) → subscribe → per-entity telemetry — paced by a concurrency cap and startup jitter. When all entities reach a terminal state (onboarded or failed), the existing RPC burst sender starts unchanged on the full device list.

Motivation: the phased warmup produces a synchronized connect/announce storm at startup. Staggering onboarding is closer to a real device fleet coming online gradually and avoids the artificial cold-start spike, while keeping the same steady-state load so results stay comparable to PHASED.

Opt-in / backward compatibility

  • New ONBOARD_MODE config key; default PHASED = existing behavior, unchanged.
  • Every new behavior is gated on ONBOARD_MODE=STAGGERED. The PHASED, ephemeral, and device-default paths are unchanged.

Config keys

Key Default Purpose
ONBOARD_MODE PHASED PHASED (existing) or STAGGERED
ONBOARD_MAX_CONCURRENT 200 max entities onboarding at once
ONBOARD_FIRST_JITTER_SEC 60 spread of per-entity onboarding start times

Steady-state matches PHASED: per-entity telemetry period = entityCount / MESSAGES_PER_SECOND seconds; no telemetry timer is scheduled when MESSAGES_PER_SECOND <= 0.

Scope / known limitations

  • Gateway STAGGERED requires gateway.batch=true and no alarms; it fails fast on other combinations rather than silently diverging.
  • Device STAGGERED is telemetry-only (there is no device-RPC path in the tool).
  • No live CONNECTIONS gauge under STAGGERED. Throughput and RPC/announce stats print periodically, and end-of-run totals are reported.

Tests

  • New unit tests: onboarding engine (concurrency cap ≤ max, ramp-complete fires exactly once, per-entity failure counting), per-entity telemetry cadence derivation, commit-on-success only (a mid-onboard failure leaves no entry in the shared collections / RPC target list), and PHASED vs STAGGERED device-assignment parity.
  • Full suite green: 178/178 via mvn -T 1C clean install.

See STAGGERED-ONBOARDING-RUNBOOK.md for a usage/verification runbook.

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