mochengqian commented on code in PR #965:
URL: https://github.com/apache/dubbo-go-pixiu/pull/965#discussion_r3372361221


##########
pkg/filter/llm/proxy/filter_test.go:
##########
@@ -412,3 +412,26 @@ func testLLMEndpoint(id string, port int) *model.Endpoint {
                },
        }
 }
+
+func BenchmarkCooldown_EndpointInCooldown(b *testing.B) {
+       const clusterName = "llm-cooldown-bench"
+       const endpointCount = 100
+       store := newCooldownStore()
+       executor := &RequestExecutor{
+               clusterName: clusterName,
+               cooldowns:   store,
+       }
+       endpoints := make([]*model.Endpoint, endpointCount)
+       for i := range endpoints {
+               endpoint := testLLMEndpoint(fmt.Sprintf("ep-%d", i), 19000+i)
+               endpoint.LLMMeta.APIKey = fmt.Sprintf("api-key-%d", i)
+               endpoints[i] = endpoint

Review Comment:
   Good catch — fixed in f2aa49be. The benchmark now sets each endpoint's 
`HealthCheckInterval` to 24h (via a `cooldownTTLMillis` const), so the cooldown 
TTL far exceeds any realistic `-benchtime`. Every iteration stays on the 
intended in-cooldown hot path and can't fall through to the delete+log path 
mid-run. Verified stable at `-benchtime=2s` (~13.5M iters): 164.8 ns/op, 40 
B/op, 3 allocs/op.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to