Label: complexity: high
Points: 200
Description
The existing round-robin distribution does not account for endpoint health or response times. This issue adds an intelligent load balancer that routes requests to the fastest healthy endpoint based on rolling latency measurements.
Technical Context
Involves a new src/loadBalancer.ts. Maintain a rolling average latency per endpoint (last 10 requests). Select the endpoint with the lowest average latency for each request. Mark endpoints as unhealthy after 3 consecutive failures. Re-probe unhealthy endpoints every 30 seconds.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
The existing round-robin distribution does not account for endpoint health or response times. This issue adds an intelligent load balancer that routes requests to the fastest healthy endpoint based on rolling latency measurements.
Technical Context
Involves a new
src/loadBalancer.ts. Maintain a rolling average latency per endpoint (last 10 requests). Select the endpoint with the lowest average latency for each request. Mark endpoints as unhealthy after 3 consecutive failures. Re-probe unhealthy endpoints every 30 seconds.Acceptance Criteria
LoadBalancerclass exported fromsrc/index.tsanytypes