SessionCountForWorker returns the number of sessions on a specific worker.
(workerID int)
| 932 | func (sm *SessionManager) SessionCountForWorker(workerID int) int { |
| 933 | sm.mu.RLock() |
| 934 | defer sm.mu.RUnlock() |
| 935 | return len(sm.byWorker[workerID]) |
| 936 | } |
| 937 | |
| 938 | // WorkerIDForPID returns the worker ID for a session, or -1 if not found. |
| 939 | func (sm *SessionManager) WorkerIDForPID(pid int32) int { |
| 940 | sm.mu.RLock() |
| 941 | defer sm.mu.RUnlock() |