Skip to content

feat(research): add --source off to the soak recorder - #207

Merged
tunjayoff merged 1 commit into
mainfrom
research/soak-source-off
Oct 13, 2026
Merged

tunjayoff merged 1 commit into
mainfrom
research/soak-source-off

Conversation

@tunjayoff

Copy link
Copy Markdown
Owner

Adds --source off to scripts/soak_live.py: no push source at all.

  • The live service is built with requested_source="poll" (the service's push=False path, as ssc watch --source poll), so the arbiter's leader is poll for the whole run and the recorder's fallback rule (joined every 60 s, others backlog, skips counted, --rate-schedule phases) drives the REST reads at the configured rate.
  • No credential reader, no direct connection, no page opener (the main bridge for REST reads stays).
  • leader.jsonl start row: leader: poll, reason: push_off; no switches follow. summary.json, requests.jsonl and fallback.jsonl keep their shape (fallback_time_share 1.0, notes[0] explains source off).
  • --kill-every / --kill-at (and, as before, --compare-credential-sports) are refused with --source off; Soak.kill returns False.
  • Soak takes optional wall/mono clocks and begin() (the start records) is split from start() (threads), for the fake-clock test.

Tests (offline; no SofaScore, no browser):

  • push off: leader poll from the start with reason push_off, no switch, no session or credential read (browser reader/opener patched to fail), minute reads joined 1 + listed 1, requests rows sum to the requests used.
  • fake-clock run, no threads: rate schedule 1 min at 1/s then 5/s, 200 live matches, list share 0.5: fallback cap 30 → 150, requests per minute 31 → 151 (peak 1 s: 1 → 5), rate phases in summary 31 / 302.

tests/test_soak_live.py + tests/test_research_privacy.py: 49 passed; ruff check clean. No shared code touched.

With --source off the live service runs without a push source (push=False,
like ssc watch --source poll): the arbiter's leader is poll for the whole
run and the recorder's fallback rule drives the REST reads at the configured
rate. No credential is read and no browser is opened for push. leader.jsonl
starts with leader poll and reason push_off; summary.json, requests.jsonl
and fallback.jsonl keep their shape. --kill-* is refused with --source off.
@tunjayoff
tunjayoff merged commit dd9f061 into main Oct 13, 2026
7 of 8 checks passed
@tunjayoff
tunjayoff deleted the research/soak-source-off branch October 13, 2026 14:28
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