GetProgress returns the cached query progress for a session, or nil.
(pid int32)
| 1002 | s, ok := sm.sessions[pids[0]] |
| 1003 | return s, ok |
| 1004 | } |
| 1005 | |
| 1006 | // ProtocolForPID returns the session interface ("postgres"/"admin"), |
| 1007 | // or "" if not found. O(1) lookup for the admin live-query detail view. |
| 1008 | func (sm *SessionManager) ProtocolForPID(pid int32) string { |
| 1009 | sm.mu.RLock() |
| 1010 | defer sm.mu.RUnlock() |
| 1011 | if s, ok := sm.sessions[pid]; ok { |
| 1012 | return s.Protocol |
| 1013 | } |
| 1014 | return "" |
| 1015 | } |
| 1016 | |
| 1017 | // WorkerPodNameForPID returns the K8s pod name of the worker hosting the |
| 1018 | // session, or "" if not found or not running on K8s. |
| 1019 | func (sm *SessionManager) WorkerPodNameForPID(pid int32) string { |
no outgoing calls
no test coverage detected