Skip to content

Add channel proxy mock sink and load test tools#4420

Merged
stuartc merged 4 commits intochannelsfrom
4409-channel-mock-sink-and-load-tests
Feb 12, 2026
Merged

Add channel proxy mock sink and load test tools#4420
stuartc merged 4 commits intochannelsfrom
4409-channel-mock-sink-and-load-tests

Conversation

@stuartc
Copy link
Member

@stuartc stuartc commented Feb 11, 2026

Description

This PR adds Elixir benchmarking tools for the channel proxy — a mock sink
server and a load test runner. WIP: still needs end-to-end validation and
refinement against a running Lightning instance.

Closes #4409
Closes #4410

Validation steps

  1. elixir benchmarking/channels/mock_sink.exs --help — prints usage
  2. elixir --sname lt --cookie test benchmarking/channels/load_test.exs --help — prints usage
  3. See benchmarking/channels/README.md for full 3-terminal walkthrough

Additional notes for the reviewer

  1. Both scripts are standalone (Mix.install) — no changes to Lightning's deps
  2. WIP — needs validation against a running Lightning + mock sink setup and
    possible refinement of scenarios/metrics
  3. The load test connects to Lightning via distributed Erlang for channel
    setup and memory sampling

AI Usage

  • I have used Claude Code

Pre-submission checklist

  • I have performed an AI review of my code
  • I have implemented and tested all related authorization policies.
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

Standalone Elixir script using Bandit + Plug that simulates configurable
sink behaviour. Supports fixed, delay, timeout, auth, and mixed modes
with CLI-configurable status codes, delays, and body sizes.
Standalone Elixir script that drives HTTP traffic through the channel
proxy to a mock sink. Connects to Lightning via distributed Erlang for
channel setup and memory sampling. Supports happy_path, ramp_up,
large_payload, large_response, mixed_methods, and slow_sink scenarios.
Reports latency percentiles, throughput, error rates, and BEAM memory.
Documents mock sink modes, load test scenarios, CLI options, quick start
guide, and how to interpret results (especially memory delta for verifying
streaming proxy behaviour).
@github-project-automation github-project-automation bot moved this to New Issues in v2 Feb 11, 2026
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.35%. Comparing base (b59edcb) to head (00d0ee6).
⚠️ Report is 1 commits behind head on channels.

Additional details and impacted files
@@            Coverage Diff            @@
##           channels    #4420   +/-   ##
=========================================
  Coverage     89.35%   89.35%           
=========================================
  Files           431      431           
  Lines         20121    20121           
=========================================
  Hits          17980    17980           
  Misses         2141     2141           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Replace the mock sink's --delay CLI arg and delay mode with a ?delay=N
query parameter, matching the existing ?response_size=N pattern. Also add
?status=N for per-request status overrides. This lets the load test drive
all scenarios against a single mock sink instance without restarts.

Add --delay option to the load test script (defaults to 2000ms for
slow_sink scenario) which appends ?delay=N to the request URL.

Add run_all.sh which runs all 7 scenarios in sequence with preflight
checks, timestamped log/CSV output, and bail-on-first-failure.
@stuartc stuartc marked this pull request as ready for review February 12, 2026 13:54
@stuartc stuartc merged commit 2b713cf into channels Feb 12, 2026
7 checks passed
@stuartc stuartc deleted the 4409-channel-mock-sink-and-load-tests branch February 12, 2026 14:10
@github-project-automation github-project-automation bot moved this from New Issues to Done in v2 Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant

Comments