()
| 46 | }; |
| 47 | |
| 48 | export async function getSessionRuntimeStatusSnapshot(): Promise<SessionRuntimeStatusSnapshot> { |
| 49 | const debuggerManager = getDefaultDebuggerManager(); |
| 50 | const activitySnapshot = getDaemonActivitySnapshot(); |
| 51 | const sessionIds = debuggerManager |
| 52 | .listSessions() |
| 53 | .map((session) => session.id) |
| 54 | .sort(); |
| 55 | const memoryUsage = process.memoryUsage(); |
| 56 | |
| 57 | return { |
| 58 | logging: { |
| 59 | simulator: { |
| 60 | activeLaunchOsLogSessions: await listActiveSimulatorLaunchOsLogSessions(), |
| 61 | }, |
| 62 | }, |
| 63 | debug: { |
| 64 | currentSessionId: debuggerManager.getCurrentSessionId(), |
| 65 | sessionIds, |
| 66 | }, |
| 67 | watcher: { |
| 68 | running: isWatcherRunning(), |
| 69 | watchedPath: getWatchedPath(), |
| 70 | }, |
| 71 | video: { |
| 72 | activeSessionIds: listActiveVideoCaptureSessionIds(), |
| 73 | }, |
| 74 | swiftPackage: { |
| 75 | activePids: Array.from(activeProcesses.keys()).sort((left, right) => left - right), |
| 76 | }, |
| 77 | activity: activitySnapshot, |
| 78 | process: { |
| 79 | pid: process.pid, |
| 80 | uptimeMs: Math.max(0, Math.round(process.uptime() * 1000)), |
| 81 | rssBytes: memoryUsage.rss, |
| 82 | heapUsedBytes: memoryUsage.heapUsed, |
| 83 | }, |
| 84 | }; |
| 85 | } |
no test coverage detected