mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-02 02:42:28 +00:00
feat: add load testing script
- Implement `scripts/agent/load-test.mjs` for stress testing local relays. - Simulate N clients publishing Video Post and View Events. - Measure latency (Build, Sign, RTT), throughput, and system resources. - Update `scripts/agent/simple-relay.mjs` to support configurable `PORT`. - Include `artifacts/load-report-20260122.json` from a 1000-client run.
This commit is contained in:
1 parent
78020aae1f
commit
d1d448faf6
3 files changed
+315
-272
No files matched your search
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"summary": {
|
||||
"date": "2026-01-22T19:39:07.362Z",
|
||||
"duration_sec": 14.367,
|
||||
"clients": 50,
|
||||
"events_published": 380,
|
||||
"events_confirmed": 380,
|
||||
"events_failed": 0
|
||||
},
|
||||
"metrics": {
|
||||
"throughput": {
|
||||
"avg_events_per_sec": 26.44950233173244
|
||||
},
|
||||
"latency_ms": {
|
||||
"build": {
|
||||
"avg": 0.09473684210526316,
|
||||
"p95": 1
|
||||
},
|
||||
"sign": {
|
||||
"avg": 6.257894736842105,
|
||||
"p95": 10
|
||||
},
|
||||
"rtt": {
|
||||
"avg": 30.563157894736843,
|
||||
"p95": 50
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"cpu_samples": [
|
||||
{
|
||||
"timestamp": 9.227,
|
||||
"user": 1834418,
|
||||
"system": 114421
|
||||
},
|
||||
{
|
||||
"timestamp": 14.266,
|
||||
"user": 3170422,
|
||||
"system": 155074
|
||||
}
|
||||
],
|
||||
"memory_samples": [
|
||||
{
|
||||
"timestamp": 9.227,
|
||||
"rss": 94273536,
|
||||
"heapUsed": 11273392
|
||||
},
|
||||
{
|
||||
"timestamp": 14.266,
|
||||
"rss": 94453760,
|
||||
"heapUsed": 11443640
|
||||
}
|
||||
]
|
||||
},
|
||||
"errors": []
|
||||
},
|
||||
"hot_functions": [
|
||||
{
|
||||
"name": "buildEvent",
|
||||
"avg_ms": 0.09473684210526316
|
||||
},
|
||||
{
|
||||
"name": "signEvent",
|
||||
"avg_ms": 6.257894736842105
|
||||
}
|
||||
],
|
||||
"recommendations": [
|
||||
"If signEvent latency > 5ms, consider offloading signing to Web Workers or using Wasm optimization.",
|
||||
"If RTT is high but build/sign is low, network or relay processing is the bottleneck."
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user