MCPcopy Index your code
hub / github.com/callstack/agent-device / resolveMemorySnapshotOutPath

Function resolveMemorySnapshotOutPath

src/daemon/handlers/session-perf.ts:521–531  ·  view source on GitHub ↗
(
  options: BuildPerfMemoryResponseOptions,
  kind: PerfKind,
)

Source from the content-addressed store, hash-verified

519}
520
521function resolveMemorySnapshotOutPath(
522 options: BuildPerfMemoryResponseOptions,
523 kind: PerfKind,
524): string {
525 if (options.out) return SessionStore.expandHome(options.out, options.cwd);
526 const extension =
527 kind === 'android-hprof' ? 'hprof' : kind === 'memgraph' ? 'memgraph' : 'artifact';
528 const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
529 const sessionDir = options.sessionStore.ensureSessionDir(options.sessionName);
530 return path.join(sessionDir, 'artifacts', `memory-${kind}-${timestamp}.${extension}`);
531}
532
533function unsupportedMemorySnapshotArtifact(
534 session: SessionState,

Callers 1

Calls 2

expandHomeMethod · 0.80
ensureSessionDirMethod · 0.80

Tested by

no test coverage detected