Load test suite for matchmaking, battles and messaging
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, node.js
- 领域
- backend, performance, testing
调研方向
Start by reading the backend socket protocol and existing test setup, then run the app with npm run dev and CODEARENA_RUNNER=local. Build the suite under backend/loadtest/ to cover matchmaking, battles and messaging, with correctness checks and latency summaries; ensure it refuses non-local targets unless explicitly overridden. Run npm test and node scripts/check-boundary.js, then commit docs/performance.md with real measurements and the first bottleneck found.
由索引模型根据 Issue 内容生成。
描述
Nobody knows how many simultaneous battles one CodeArena backend can handle, or what breaks first. There are no load tests in the repo.
What to do
Add a load test suite in backend/loadtest/ that drives the real socket protocol:
- Matchmaking: N players join the queue at once at a spread of ratings. Measure time to match and check nobody is matched twice or left behind.
- Battles: N concurrent battles where both players send throttled
code-updateevents and submit at realistic times. Measure event latency to the opponent and submission round trip. - Messaging: bursts of direct and group messages.
- Use a fake runner for code execution so the test measures CodeArena, not Judge0. A separate mode can hit a real Judge0 to find its limits.
- One command with flags for scale and duration, plus a summary of p50, p95 and p99 latencies and error counts.
Deliverable beyond the tool
A short report in docs/performance.md: the numbers on a stated machine, the first bottleneck found, and its cause. If the cause is a bug, open an issue or fix it.
Rules
- The suite must assert correctness, not just measure speed. For example, every battle ends with exactly one result and no player is in two battles.
- Never runs against production by default. Refuse unless the target is localhost or
--i-know-what-im-doingis passed.
Definition of done
- Runs locally against
npm run devwithCODEARENA_RUNNER=local. - Report committed with real numbers.
npm testandnode scripts/check-boundary.jspass.
- 主要语言
- JavaScript
- 星标
- 0
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sennaicodes/codearena 的其他 Issue
-
Add issue and pull request templates可能重新可做 @franciscorodr26 于 19 天前认领,目前没有进行中的 PR。 未关闭documentation good first issue
难度 2/5 1-3 小时 新手友好度 85/100
sennaicodes/codearena#13 · 1 条评论 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 45/100
sennaicodes/codearena#34 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 35/100
sennaicodes/codearena#33 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 38/100
sennaicodes/codearena#31 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 25/100
sennaicodes/codearena#30 ·
查看 sennaicodes/codearena 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
-
bug code-annotation
难度 2/5 1-3 小时 新手友好度 76/100
quarto-dev/quarto-cli#15215 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 70/100
521xueweihan/HelloGitHub#4133 ·
-
难度 1/5 1-3 小时 新手友好度 88/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
Hugo-SA/receita-random#20 ·
维护者通常 1 天内回复