mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
feat: implement load testing script
- Adds scripts/agent/load-test.mjs to simulate N clients connecting to a relay. - Publishes video and view events at a configurable rate. - Measures write latency (Client -> Relay -> OK). - Monitors local relay process (CPU/Mem) if applicable. - Generates JSON report in artifacts/load-report-YYYYMMDD.json. - Includes guardrails against public relays. Test Run Summary (20 clients, 10s): - Total Requests: 377 - Successful: 377 - Throughput: 37.7 req/s - Avg Latency: 34.5ms - P95 Latency: 61.0ms
This commit is contained in:
1 parent
0d400a8bc5
commit
6ce9e9b8a8
1 file changed
+2
-1
@@ -332,7 +332,8 @@ async function run() {
|
||||
report.remediation.push('Check relay logs for validation errors or connection limits.');
|
||||
}
|
||||
|
||||
const reportPath = path.join(ARTIFACTS_DIR, `load-report-${new Date().toISOString().replace(/[:.]/g, '-')}.json`);
|
||||
const dateStr = new Date().toISOString().split('T')[0].replace(/-/g, '');
|
||||
const reportPath = path.join(ARTIFACTS_DIR, `load-report-${dateStr}.json`);
|
||||
fs.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
||||
console.log(`Report saved to ${reportPath}`);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user