mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-08 22:03:19 +00:00
Stabilise CLI P2P smoke readiness
This commit is contained in:
@@ -60,10 +60,17 @@ jobs:
|
|||||||
BENCH_BIN_SIZE_BYTES: '512'
|
BENCH_BIN_SIZE_BYTES: '512'
|
||||||
BENCH_COUCHDB_RTT_MS: ${{ inputs.couchdb_rtt_ms || '20' }}
|
BENCH_COUCHDB_RTT_MS: ${{ inputs.couchdb_rtt_ms || '20' }}
|
||||||
BENCH_SYNC_TIMEOUT: '180'
|
BENCH_SYNC_TIMEOUT: '180'
|
||||||
BENCH_PEERS_TIMEOUT: '90'
|
BENCH_PEERS_TIMEOUT: '20'
|
||||||
|
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: '60000'
|
||||||
BENCH_LIVESYNC_TEST_TEE: '0'
|
BENCH_LIVESYNC_TEST_TEE: '0'
|
||||||
run: docker compose -f test/bench-network/compose.yml run --rm bench-runner
|
run: docker compose -f test/bench-network/compose.yml run --rm bench-runner
|
||||||
|
|
||||||
|
- name: Show Compose diagnostics
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
docker compose -f test/bench-network/compose.yml ps
|
||||||
|
docker compose -f test/bench-network/compose.yml logs --no-color couchdb nostr-relay
|
||||||
|
|
||||||
- name: Upload benchmark results
|
- name: Upload benchmark results
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
@@ -179,9 +179,9 @@ async function main(): Promise<void> {
|
|||||||
await host.waitUntilContains("P2P host is running", 20000);
|
await host.waitUntilContains("P2P host is running", 20000);
|
||||||
const hostReadyElapsed = nowMs() - hostReadyStart;
|
const hostReadyElapsed = nowMs() - hostReadyStart;
|
||||||
|
|
||||||
const peerDiscoveryStart = nowMs();
|
const peerDiscoveryCommandStart = nowMs();
|
||||||
const peer = await discoverPeer(clientVault, clientSettings, config.peersTimeoutSeconds);
|
const peer = await discoverPeer(clientVault, clientSettings, config.peersTimeoutSeconds);
|
||||||
const peerDiscoveryElapsed = nowMs() - peerDiscoveryStart;
|
const peerDiscoveryCommandElapsed = nowMs() - peerDiscoveryCommandStart;
|
||||||
|
|
||||||
const syncStart = nowMs();
|
const syncStart = nowMs();
|
||||||
await runCliOrFail(
|
await runCliOrFail(
|
||||||
@@ -223,7 +223,10 @@ async function main(): Promise<void> {
|
|||||||
binFileCount: seedFiles.binCount,
|
binFileCount: seedFiles.binCount,
|
||||||
mirrorElapsedMs: Number(mirrorElapsed.toFixed(1)),
|
mirrorElapsedMs: Number(mirrorElapsed.toFixed(1)),
|
||||||
hostReadyElapsedMs: Number(hostReadyElapsed.toFixed(1)),
|
hostReadyElapsedMs: Number(hostReadyElapsed.toFixed(1)),
|
||||||
peerDiscoveryElapsedMs: Number(peerDiscoveryElapsed.toFixed(1)),
|
peerDiscoveryTimeoutSeconds: config.peersTimeoutSeconds,
|
||||||
|
peerDiscoveryCommandElapsedMs: Number(peerDiscoveryCommandElapsed.toFixed(1)),
|
||||||
|
peerDiscoveryNote:
|
||||||
|
"p2p-peers waits for the requested timeout before printing discovered peers, so this is command duration, not first-peer latency.",
|
||||||
syncElapsedMs: Number(syncElapsed.toFixed(1)),
|
syncElapsedMs: Number(syncElapsed.toFixed(1)),
|
||||||
throughputBytesPerSec: Number((seedFiles.totalBytes / (syncElapsed / 1000)).toFixed(2)),
|
throughputBytesPerSec: Number((seedFiles.totalBytes / (syncElapsed / 1000)).toFixed(2)),
|
||||||
throughputMiBPerSec: Number((seedFiles.totalBytes / (syncElapsed / 1000) / 1024 / 1024).toFixed(4)),
|
throughputMiBPerSec: Number((seedFiles.totalBytes / (syncElapsed / 1000) / 1024 / 1024).toFixed(4)),
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ The current CouchDB latency model is the existing HTTP proxy inside
|
|||||||
latency, but it does not model packet loss, jitter, MTU, bandwidth limits,
|
latency, but it does not model packet loss, jitter, MTU, bandwidth limits,
|
||||||
bufferbloat, or VPN encapsulation.
|
bufferbloat, or VPN encapsulation.
|
||||||
|
|
||||||
|
For P2P runs, `BENCH_PEERS_TIMEOUT` is passed to `p2p-peers`. That command waits
|
||||||
|
for the requested observation window before printing discovered peers, so the
|
||||||
|
reported peer discovery command time should not be read as first-peer latency.
|
||||||
|
|
||||||
## Latency sweep
|
## Latency sweep
|
||||||
|
|
||||||
To run P2P once and CouchDB at several requested RTT values:
|
To run P2P once and CouchDB at several requested RTT values:
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ services:
|
|||||||
exec /app/strfry --config /tmp/strfry.conf relay
|
exec /app/strfry --config /tmp/strfry.conf relay
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- /app/strfry-db:rw,size=256m
|
- /app/strfry-db:rw,size=256m
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "nc -z 127.0.0.1 7777"]
|
||||||
|
interval: 2s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 30
|
||||||
|
|
||||||
coturn:
|
coturn:
|
||||||
image: coturn/coturn:latest
|
image: coturn/coturn:latest
|
||||||
@@ -64,7 +69,7 @@ services:
|
|||||||
couchdb:
|
couchdb:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
nostr-relay:
|
nostr-relay:
|
||||||
condition: service_started
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
BENCH_COMMAND: ${BENCH_COMMAND:-cases}
|
BENCH_COMMAND: ${BENCH_COMMAND:-cases}
|
||||||
BENCH_CASES: ${BENCH_CASES:-couchdb-baseline,p2p-direct-local}
|
BENCH_CASES: ${BENCH_CASES:-couchdb-baseline,p2p-direct-local}
|
||||||
@@ -88,6 +93,7 @@ services:
|
|||||||
BENCH_TETHERING_VPN_RTT_MS: ${BENCH_TETHERING_VPN_RTT_MS:-120}
|
BENCH_TETHERING_VPN_RTT_MS: ${BENCH_TETHERING_VPN_RTT_MS:-120}
|
||||||
BENCH_SYNC_TIMEOUT: ${BENCH_SYNC_TIMEOUT:-300}
|
BENCH_SYNC_TIMEOUT: ${BENCH_SYNC_TIMEOUT:-300}
|
||||||
BENCH_PEERS_TIMEOUT: ${BENCH_PEERS_TIMEOUT:-60}
|
BENCH_PEERS_TIMEOUT: ${BENCH_PEERS_TIMEOUT:-60}
|
||||||
|
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: ${LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS:-60000}
|
||||||
BENCH_LIVESYNC_TEST_TEE: ${BENCH_LIVESYNC_TEST_TEE:-0}
|
BENCH_LIVESYNC_TEST_TEE: ${BENCH_LIVESYNC_TEST_TEE:-0}
|
||||||
volumes:
|
volumes:
|
||||||
- ./bench-results:/workspace/src/apps/cli/testdeno/bench-results
|
- ./bench-results:/workspace/src/apps/cli/testdeno/bench-results
|
||||||
|
|||||||
Reference in New Issue
Block a user