Skip to content

Commit b947e46

Browse files
committed
ci(sync): add manual sync benchmark workflow
Add a workflow_dispatch job that runs sync-bench-debug with benchmark secrets and uploads JSON output plus trace logs as artifacts.
1 parent 3dd271a commit b947e46

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

.github/workflows/sync-bench.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: sync benchmark
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
poll_delay_ms:
7+
description: Polling delay between receiver checks, in milliseconds
8+
required: false
9+
default: '250'
10+
max_polls:
11+
description: Maximum number of receiver polling attempts
12+
required: false
13+
default: '40'
14+
curl_pool:
15+
description: Enable curl connection pool; use 0 to disable
16+
required: false
17+
default: '1'
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
sync-bench-debug:
24+
name: sync-bench-debug linux x86_64
25+
runs-on: ubuntu-22.04
26+
timeout-minutes: 20
27+
28+
env:
29+
SYNC_BENCH_DATABASE_ID: ${{ secrets.SYNC_BENCH_DATABASE_ID }}
30+
SYNC_BENCH_CLOUDSYNC_ADDRESS: ${{ secrets.SYNC_BENCH_CLOUDSYNC_ADDRESS }}
31+
SYNC_BENCH_APIKEY: ${{ secrets.SYNC_BENCH_APIKEY }}
32+
SYNC_BENCH_OUTPUT: json
33+
SYNC_BENCH_POLL_DELAY_MS: ${{ inputs.poll_delay_ms }}
34+
SYNC_BENCH_MAX_POLLS: ${{ inputs.max_polls }}
35+
CLOUDSYNC_CURL_POOL: ${{ inputs.curl_pool }}
36+
37+
steps:
38+
- uses: actions/checkout@v4.2.2
39+
with:
40+
submodules: true
41+
42+
- name: Install dependencies
43+
run: |
44+
sudo apt-get update
45+
sudo apt-get install -y gcc make curl sqlite3 unzip
46+
47+
- name: Build debug benchmark
48+
run: make SYNC_BENCH_DEBUG=1 extension dist/sync_bench
49+
50+
- name: Run sync benchmark
51+
run: |
52+
mkdir -p artifacts
53+
./dist/sync_bench > artifacts/sync-bench.json 2> artifacts/sync-bench.trace.log
54+
55+
- name: Upload benchmark artifacts
56+
if: always()
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: sync-bench-debug-${{ github.run_id }}
60+
path: |
61+
artifacts/sync-bench.json
62+
artifacts/sync-bench.trace.log
63+
if-no-files-found: warn

0 commit comments

Comments
 (0)