Skip to content
Draft
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
20c635e
initial netbench cli code
GlenDC Jan 21, 2026
5241116
generate client requests
GlenDC Jan 22, 2026
466157f
minor patch
GlenDC Jan 22, 2026
3e291a6
Merge branch 'main' into feat/netbench
GlenDC Jan 22, 2026
96f451a
prepare code for proxy reusage and similar codebase refactor
GlenDC Jan 22, 2026
50f357b
Merge branch 'main' into feat/netbench
GlenDC Jan 22, 2026
d163dc9
migrate from main
GlenDC Jan 22, 2026
12139f5
integrate proxy in netbench tool
GlenDC Jan 22, 2026
59daa3f
reuse malware list download from safechain-proxy-lib
GlenDC Jan 22, 2026
153cf10
support egress overwrite (bench only)
GlenDC Jan 23, 2026
0b633ff
remove unused deps (in netbench)
GlenDC Jan 23, 2026
59b386c
improve numbers for bench runs
GlenDC Jan 23, 2026
cb77b1c
add tests for newly introduced utils
GlenDC Jan 23, 2026
17c2e06
add+support netbench mock server impl
GlenDC Jan 23, 2026
69dde14
Merge branch 'feat/netbench'
GlenDC Jan 23, 2026
1dc890f
finish off mock server netbench
GlenDC Jan 23, 2026
27139d3
improve proxy mock address support
GlenDC Jan 23, 2026
de83f70
pre-generate ok payloads for mock server
GlenDC Jan 24, 2026
1807f29
ensure forward traffic is also going to mock server
GlenDC Jan 24, 2026
434240e
add large payload for mock test that is highly compressable
GlenDC Jan 24, 2026
62d46eb
improve mock payload + related headers
GlenDC Jan 24, 2026
92c849f
support HAR replay in mock server
GlenDC Jan 24, 2026
ca27cb3
update rama deps
GlenDC Jan 25, 2026
e5c082c
bump rama
GlenDC Jan 25, 2026
cd97eeb
prepare runner code to be able to also use replay
GlenDC Jan 26, 2026
70b1f10
Merge branch 'main' into feat/netbench
GlenDC Jan 26, 2026
06c9e88
Merge branch 'main' into feat/netbench
GlenDC Jan 26, 2026
20a96f8
Merge branch 'main' into feat/netbench
GlenDC Jan 28, 2026
36ca9d8
Merge branch 'main' into feat/netbench
GlenDC Jan 29, 2026
d5f06ed
ensure proxy_fuzz makes now use of safechain-proxy-lib
GlenDC Jan 29, 2026
6da0baa
initial proxy bench runner code
GlenDC Jan 29, 2026
1c27be5
finish web client code for benching
GlenDC Jan 29, 2026
b508b8c
initial orchestrator netbench script
GlenDC Jan 29, 2026
bf45644
improve netbench script
GlenDC Jan 29, 2026
c81a6e7
improve netbencher code w/ comparison + add docs
GlenDC Jan 29, 2026
ae31be3
link from proxy.md
GlenDC Jan 29, 2026
166d9c9
support har replay from orchestrator
GlenDC Jan 29, 2026
583f920
support proxy-benchmarking from CI
GlenDC Jan 29, 2026
753e0d4
fix netbench proxy run script path in yml file
GlenDC Jan 29, 2026
344484a
attempt to fix reporting
GlenDC Jan 29, 2026
c83ad18
delete old connect-fail error (no longer a thing since last refactor)
GlenDC Jan 29, 2026
60c08ab
improve reporting / bug-fix e-traffic / et al
GlenDC Jan 30, 2026
dd86092
ensure reporter is hookedup in mock benching
GlenDC Jan 30, 2026
163c6a1
fix none=>direct for proxy-benchmark.yml
GlenDC Jan 30, 2026
f165653
fix typo in python script (argh)
GlenDC Jan 30, 2026
c2fabd2
improve default scenario values (bench)
GlenDC Jan 30, 2026
ffeef09
support also direct check for har replay in CI
GlenDC Jan 30, 2026
3ec46c4
refactor mock code so it can also be used elsewhere
GlenDC Jan 30, 2026
35e64af
support req emulation in netbench for one-off cases
GlenDC Jan 31, 2026
265195d
address feedback aikibot part 1
GlenDC Jan 31, 2026
d6dac0a
apply feedback aikibot part 2
GlenDC Jan 31, 2026
130062c
merge main + address feedback aikibot part 3
GlenDC Jan 31, 2026
ebf7506
fix CI benchmark + address more feedback
GlenDC Jan 31, 2026
792e5a6
prepare netbench emulate to also handle har replays
GlenDC Jan 31, 2026
44c4744
add remaining todo
GlenDC Jan 31, 2026
a4a3b6f
support filters in emulate cmd
GlenDC Jan 31, 2026
a690ce8
add har request e2e tests (made with emulate cmd of netbench)
GlenDC Jan 31, 2026
3f94f47
improve code + separate proxy troubleshooting doc
GlenDC Jan 31, 2026
abc81a8
fix transport bench (dns) + disallow unwraps/expects
GlenDC Jan 31, 2026
7bcbb46
fix dns in bench to ensure for non-overwritten paths we do use global…
GlenDC Feb 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ jobs:
key: cargo-fuzz-bin-${{ env.CARGO_FUZZ_VERSION }}
- run: echo "${{ runner.tool_cache }}/cargo-fuzz/bin" >> $GITHUB_PATH
- run: cargo install --root "${{ runner.tool_cache }}/cargo-fuzz" --version ${{ env.CARGO_FUZZ_VERSION }} cargo-fuzz --locked
- run: cargo fuzz build --fuzz-dir ./proxy-fuzz ${{ matrix.fuzz_target }}
- run: cargo fuzz run --fuzz-dir ./proxy-fuzz ${{ matrix.fuzz_target }} -- -max_total_time=${{ env.FUZZ_TIME }}
- run: cargo fuzz build --fuzz-dir ./proxy_fuzz ${{ matrix.fuzz_target }}
- run: cargo fuzz run --fuzz-dir ./proxy_fuzz ${{ matrix.fuzz_target }} -- -max_total_time=${{ env.FUZZ_TIME }}
- uses: actions/upload-artifact@v4
if: failure()
with:
Expand Down
261 changes: 261 additions & 0 deletions .github/workflows/proxy-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
name: proxy benchmark

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]

permissions:
contents: read
pull-requests: write

concurrency:
group: proxy-benchmark-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
NETBENCH_ORCHESTRATOR: proxy_netbench/run.py
BASELINE_ARTIFACT_NAME: netbench-baselines
BASELINE_DIR: baselines
RUN_DIR: run-metrics

jobs:
bench:
name: bench (${{ matrix.scenario }}, proxy=${{ matrix.proxy }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scenario: [baseline, latency-jitter, flaky-upstream]
proxy: [direct, global, scoped]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}

- name: Download baselines from latest successful main run
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
mkdir -p "$BASELINE_DIR"
python3 proxy_netbench/scripts/download_baselines.py \
--repo "${{ github.repository }}" \
--workflow "proxy-benchmark.yml" \
--artifact "$BASELINE_ARTIFACT_NAME" \
--out "$BASELINE_DIR" \
--branch "main"

- name: Run netbench (matrix)
env:
SCENARIO: ${{ matrix.scenario }}
PROXY: ${{ matrix.proxy }}
run: |
set -euo pipefail
mkdir -p reports "$RUN_DIR"

CUR_KV="$RUN_DIR/${SCENARIO}.${PROXY}.kv.txt"
BASE_KV="$BASELINE_DIR/${SCENARIO}.${PROXY}.kv.txt"
REPORT_PATH="reports/${SCENARIO}.${PROXY}.jsonl"

COMPARE_FLAG=""
if [ -f "$BASE_KV" ]; then
COMPARE_FLAG="--compare $BASE_KV"
fi

python3 "$NETBENCH_ORCHESTRATOR" \
--proxy "$PROXY" \
--scenario "$SCENARIO" \
--report-file "$REPORT_PATH" \
--save-baseline "$CUR_KV" \
$COMPARE_FLAG

- name: Upload run artifacts (jsonl, summary, kv)
uses: actions/upload-artifact@v4
with:
name: netbench-${{ matrix.scenario }}-proxy-${{ matrix.proxy }}
path: |
reports/${{ matrix.scenario }}.${{ matrix.proxy }}.jsonl
reports/${{ matrix.scenario }}.${{ matrix.proxy }}.jsonl.summary.txt
run-metrics/${{ matrix.scenario }}.${{ matrix.proxy }}.kv.txt
if-no-files-found: error

bench-replay:
name: bench replay (${{ matrix.name }}), proxy=${{ matrix.proxy }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: synthetic
har_fp: proxy_netbench/har_files/synthetic.har.json
proxy: direct
- name: synthetic
har_fp: proxy_netbench/har_files/synthetic.har.json
proxy: global

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}

- name: Download baselines from latest successful main run
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
mkdir -p "$BASELINE_DIR"
python3 proxy_netbench/scripts/download_baselines.py \
--repo "${{ github.repository }}" \
--workflow "proxy-benchmark.yml" \
--artifact "$BASELINE_ARTIFACT_NAME" \
--out "$BASELINE_DIR" \
--branch "main"

- name: Run netbench (matrix)
env:
PROXY: ${{ matrix.proxy }}
REPLAY_NAME: ${{ matrix.name }}
REPLAY_HAR_FP: ${{ matrix.har_fp }}
run: |
set -euo pipefail
mkdir -p reports "$RUN_DIR"

CUR_KV="$RUN_DIR/replay_${REPLAY_NAME}.${PROXY}.kv.txt"
BASE_KV="$BASELINE_DIR/replay_${REPLAY_NAME}.${PROXY}.kv.txt"
REPORT_PATH="reports/replay_${REPLAY_NAME}.${PROXY}.jsonl"

COMPARE_FLAG=""
if [ -f "$BASE_KV" ]; then
COMPARE_FLAG="--compare $BASE_KV"
fi

python3 "$NETBENCH_ORCHESTRATOR" \
--proxy "$PROXY" \
--har "$REPLAY_HAR_FP" \
--emulate \
--report-file "$REPORT_PATH" \
--save-baseline "$CUR_KV" \
$COMPARE_FLAG

- name: Upload run artifacts (jsonl, summary, kv)
uses: actions/upload-artifact@v4
with:
name: netbench-replay_${{ matrix.name }}-proxy-${{ matrix.proxy }}
path: |
reports/replay_${{ matrix.name }}.${{ matrix.proxy }}.jsonl
reports/replay_${{ matrix.name }}.${{ matrix.proxy }}.jsonl.summary.txt
run-metrics/replay_${{ matrix.name }}.${{ matrix.proxy }}.kv.txt
if-no-files-found: error

publish_baselines:
name: publish baselines
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [bench]
runs-on: ubuntu-latest
steps:
- name: Download all matrix artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Collect baseline kv files
run: |
set -euo pipefail
mkdir -p baselines
find artifacts -type f -name "*.kv.txt" -print -exec cp {} baselines/ \;
ls -la baselines

- name: Upload baselines artifact
uses: actions/upload-artifact@v4
with:
name: netbench-baselines
path: baselines
if-no-files-found: error

pr_comment:
name: report to PR
if: github.event_name == 'pull_request'
needs: [bench]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Download all matrix artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Download baselines from latest successful main run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
mkdir -p baselines
python3 proxy_netbench/scripts/download_baselines.py \
--repo "${{ github.repository }}" \
--workflow "proxy-benchmark.yml" \
--artifact "$BASELINE_ARTIFACT_NAME" \
--out "baselines" \
--branch "main"

- name: Build markdown report
run: |
set -euo pipefail
python3 proxy_netbench/scripts/build_report.py \
--artifacts-dir "artifacts" \
--baselines-dir "baselines" \
--out "report.md" \
--sha "${{ github.sha }}"

- name: Post or update PR comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
python3 proxy_netbench/scripts/post_pr_comment.py \
--repo "${{ github.repository }}" \
--pr "${{ github.event.pull_request.number }}" \
--report "report.md"
54 changes: 39 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading