Add channel proxy mock sink and load test tools#4420
Merged
Conversation
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).
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
elixir benchmarking/channels/mock_sink.exs --help— prints usageelixir --sname lt --cookie test benchmarking/channels/load_test.exs --help— prints usagebenchmarking/channels/README.mdfor full 3-terminal walkthroughAdditional notes for the reviewer
Mix.install) — no changes to Lightning's depspossible refinement of scenarios/metrics
setup and memory sampling
AI Usage
Pre-submission checklist