MCPcopy Create free account
hub / github.com/facebook/memlab / findLeaksBySnapshotFilePaths

Function findLeaksBySnapshotFilePaths

packages/api/src/API.ts:284–302  ·  view source on GitHub ↗
(
  baselineSnapshot: string,
  targetSnapshot: string,
  finalSnapshot: string,
  options: {workDir?: string; consoleMode?: ConsoleMode} = {},
)

Source from the content-addressed store, hash-verified

282 * @returns leak traces detected and clustered from the browser interaction
283 */
284export async function findLeaksBySnapshotFilePaths(
285 baselineSnapshot: string,
286 targetSnapshot: string,
287 finalSnapshot: string,
288 options: {workDir?: string; consoleMode?: ConsoleMode} = {},
289): Promise<ISerializedInfo[]> {
290 const state = stateManager.getAndUpdateState(defaultConfig, options);
291 defaultConfig.useExternalSnapshot = true;
292 defaultConfig.externalSnapshotFilePaths = [
293 baselineSnapshot,
294 targetSnapshot,
295 finalSnapshot,
296 ];
297 fileManager.initDirs(defaultConfig, {workDir: options.workDir});
298 defaultConfig.chaseWeakMapEdge = false;
299 const ret = await analysis.checkLeak();
300 stateManager.restoreState(defaultConfig, state);
301 return ret;
302}
303
304/**
305 * This API analyzes heap snapshot(s) with a specified heap analysis.

Calls 4

initDirsMethod · 0.80
checkLeakMethod · 0.80
getAndUpdateStateMethod · 0.45
restoreStateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…