feat(kitchen-sink): add load testing harness#5017
Conversation
Code Review: feat(kitchen-sink): add load testing harnessOverviewThis PR adds a load testing harness to the kitchen-sink example. Key changes:
Bugs / Correctness Issues
In both const handle = actorId
? client.tunnelStress.getForId(actorId)
: client.tunnelStress.getOrCreate([key]);
In both websocket.addEventListener("close", () => {
c.state.connectionCount -= 1;
});If Concurrent inference requests with no backpressure ( Each WebSocket message spawns a new concurrent inference IIFE wrapped in Performance Concerns
function countWorkerHealth(): { pending: number; healthy: number; warning: number; ended: number } {
for (const s of workerHealth.values()) { ... }
}This iterates all workers on every KV write on every received message with a shared key ( await c.kv.put("counter", String(c.state.messageCount));The key Heartbeat every 1s per actor instance ( A 1-second heartbeat timer plus state mutations ( Code Quality
Inconsistent config source:
The explicit Magic WebSocket readyState numbers
const WS_OPEN = 1;
addEventListener(type: ..., listener: (event: any) => void, ...): void;The Build Script Notes (
|
ec783c3 to
6127de0
Compare
5caf7f6 to
31a9bd4
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: