WorkerProfile returns the pod-shape profile (cpu/memory/ttl) of a worker by ID, or false if the worker is not in the pool. The zero profile is the default profile (empty cpu/memory).
(workerID int)
| 993 | // (only) pid in the worker's index is authoritative. Used by the admin |
| 994 | // live-query detail to address a query by worker id instead of the per-org pid. |
| 995 | func (sm *SessionManager) SessionForWorker(workerID int) (*ManagedSession, bool) { |
| 996 | sm.mu.RLock() |
| 997 | defer sm.mu.RUnlock() |
| 998 | pids := sm.byWorker[workerID] |
| 999 | if len(pids) == 0 { |
| 1000 | return nil, false |
| 1001 | } |
| 1002 | s, ok := sm.sessions[pids[0]] |
| 1003 | return s, ok |
| 1004 | } |
no test coverage detected