diff --git a/404.html b/404.html index 5c173367a..a2658c87d 100644 --- a/404.html +++ b/404.html @@ -10,14 +10,14 @@ Page Not Found | memlab - - + +
-
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- - + + \ No newline at end of file diff --git a/docs/api/classes/api_src.SnapshotResultReader/index.html b/docs/api/classes/api_src.SnapshotResultReader/index.html index 15361b010..d5570972d 100644 --- a/docs/api/classes/api_src.SnapshotResultReader/index.html +++ b/docs/api/classes/api_src.SnapshotResultReader/index.html @@ -10,8 +10,8 @@ Class: SnapshotResultReader | memlab - - + +
@@ -19,11 +19,11 @@ baseline, target and final heap snapshots.

The most useful feature of this class is when you have three separate snapshots (baseline, target, and final) that are not taken from MemLab, but you still would -like to use the findLeaks to detect memory leaks:

const {SnapshotResultReader, findLeaks} = require('@memlab/api');

// baseline, target, and final are file paths of heap snapshot files
const reader = SnapshotResultReader.fromSnapshots(baseline, target, final);
const leaks = await findLeaks(reader);

Hierarchy

  • default

    SnapshotResultReader

Methods

getInteractionSteps()

browser interaction step sequence

  • Returns: E2EStepInfo[] | an array of browser interaction step information

  • Examples:

const {SnapshotResultReader} = require('@memlab/api');

// baseline, target, and final are file paths of heap snapshot files
const reader = SnapshotResultReader.fromSnapshots(baseline, target, final);
const paths = reader.getInteractionSteps();

getRootDirectory()

get the directory where the data and generated files of -the memlab run were stored

  • Returns: string | absolute path of the directory
  • Examples:
const {takeSnapshots} = require('@memlab/api');

(async function () {
const scenario = { url: () => 'https://www.npmjs.com'};
const result = await takeSnapshots({scenario});

// get the directory that stores all the files
// generated from the takeSnapshots call
const dataDir = result.getRootDirectory();
})();

getSnapshotFiles()

get all snapshot files related to this SnapshotResultReader

  • Returns: string[] | an array of snapshot file's absolute path

  • Examples:

const {SnapshotResultReader} = require('@memlab/api');

// baseline, target, and final are file paths of heap snapshot files
const reader = SnapshotResultReader.fromSnapshots(baseline, target, final);
const paths = reader.getSnapshotFiles();

Static fromSnapshots(baselineSnapshot, targetSnapshot, finalSnapshot)

Build a result reader from baseline, target, and final heap snapshot files. -The three snapshot files do not have to be in the same directory.

  • Parameters:

    • baselineSnapshot: string | file path of the baseline heap snapshot
    • targetSnapshot: string | file path of the target heap snapshot
    • finalSnapshot: string | file path of the final heap snapshot
  • Returns: SnapshotResultReader | the ResultReader instance

  • Examples:

const {SnapshotResultReader, findLeaks} = require('@memlab/api');

// baseline, target, and final are file paths of heap snapshot files
const reader = SnapshotResultReader.fromSnapshots(baseline, target, final);
const leaks = await findLeaks(reader);
  • Hierarchy
  • Methods
    • getInteractionSteps()
    • getRootDirectory()
    • getSnapshotFiles()
    • Static fromSnapshots(baselineSnapshot, targetSnapshot, finalSnapshot)