Commit Graph
1 Commits
  • perf(clients): scale-audit remaining client/inbound endpoints to 200k
    Drive every client/inbound/group endpoint at 100k-200k clients on PostgreSQL and fix the latent issues found in previously-unbenchmarked paths:
    
    - enrichClientStats: chunk the email IN lookup (was an unchunked bind that crashed past 65535 clients without traffic rows, taking down GetInbounds/GetInboundDetail/GetAllInbounds)
    
    - GetOnlineClients: add the missing nil-process guard its siblings already have, so ListPaged no longer panics before xray starts
    
    - GetClientTrafficByEmail: read UUID/subId from the indexed clients table instead of parsing the inbound's full settings JSON (439ms to ~1.5ms, flat in N)
    
    - BulkResetTraffic: replace the per-email serialized loop with one chunked bulk UPDATE in a single transaction
    
    - DelDepleted: delegate to the already-batched BulkDelete instead of deleting each depleted client one by one
    
    Adds a postgres-gated full endpoint sweep plus an A/B benchmark, and SQLite correctness tests for the changed methods.