新增运行策略 agentMaxSessions(默认 30,范围 1-64),保存后同时下发到内嵌进程闸门与独立 yingce-agent 的 /v1/limit,降低上限不会中断已开始的对话。系统性能页展示 Agent 服务健康、进行中/排队数量,并可直接修改上限。
32 lines
776 B
Go
32 lines
776 B
Go
package handler
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"infinite-canvas/backend/internal/service"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func TestAdminSystemPerformanceRoutesAreRegistered(t *testing.T) {
|
|
gin.SetMode(gin.TestMode)
|
|
router := gin.New()
|
|
RegisterAdminSystemPerformanceRoutes(router.Group("/api"), &service.Service{})
|
|
wanted := map[string]bool{
|
|
"GET /api/admin/system-performance": false,
|
|
"PUT /api/admin/system-performance/agent-limit": false,
|
|
"POST /api/admin/system-performance/cache/clear": false,
|
|
}
|
|
for _, route := range router.Routes() {
|
|
key := route.Method + " " + route.Path
|
|
if _, exists := wanted[key]; exists {
|
|
wanted[key] = true
|
|
}
|
|
}
|
|
for route, found := range wanted {
|
|
if !found {
|
|
t.Errorf("route %s is not registered", route)
|
|
}
|
|
}
|
|
}
|