MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / getSessionRuntimeStatusSnapshot

Function getSessionRuntimeStatusSnapshot

src/utils/session-status.ts:48–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46};
47
48export 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}

Callers 1

Calls 8

isWatcherRunningFunction · 0.90
getWatchedPathFunction · 0.90
listSessionsMethod · 0.80
getCurrentSessionIdMethod · 0.80

Tested by

no test coverage detected