@memlab/heap-analysis 1.0.2 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/PluginUtils.js +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +19 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
This is the memlab heap analysis library. It contains all memlab built-in heap analysis and
|
|
4
4
|
provides a plugin interface for adding new heap analysis that can be easily added to memlab API and memlab CLI.
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
https://facebookincubator.github.io/memlab
|
|
6
|
+
## Online Resources
|
|
7
|
+
* [Official Website and Demo](https://facebookincubator.github.io/memlab)
|
|
8
|
+
* [Documentation](https://facebookincubator.github.io/memlab/docs/intro)
|
package/dist/PluginUtils.js
CHANGED
|
@@ -362,6 +362,7 @@ function loadProcessedSnapshot(options = {}) {
|
|
|
362
362
|
const file = options.file || core_2.utils.getSnapshotFilePathWithTabType(/.*/);
|
|
363
363
|
const snapshot = yield core_2.utils.getSnapshotFromFile(file, opt);
|
|
364
364
|
core_2.analysis.preparePathFinder(snapshot);
|
|
365
|
+
core_2.info.flush();
|
|
365
366
|
return snapshot;
|
|
366
367
|
});
|
|
367
368
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* @emails oncall+ws_labs
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare function registerPackage(): Promise<void>;
|
|
12
|
+
export declare const getDominatorNodes: (ids: Set<number>, snapshot: import("@memlab/core").IHeapSnapshot) => Set<number>, getHeapFromFile: (file: string) => Promise<import("@memlab/core").IHeapSnapshot>, getSnapshotDirForAnalysis: (options: import("./PluginUtils").HeapAnalysisOptions) => import("@memlab/core").Nullable<string>, getSnapshotFileForAnalysis: (options: import("./PluginUtils").HeapAnalysisOptions) => string, loadHeapSnapshot: (options: import("./PluginUtils").HeapAnalysisOptions) => Promise<import("@memlab/core").IHeapSnapshot>, snapshotMapReduce: <T1, T2>(mapCallback: (snapshot: import("@memlab/core").IHeapSnapshot, i: number, file: string) => T1, reduceCallback: (results: T1[]) => T2, options: import("./PluginUtils").HeapAnalysisOptions) => Promise<T2>;
|
|
11
13
|
export type { HeapAnalysisOptions } from './PluginUtils';
|
|
12
14
|
export { default as BaseAnalysis } from './BaseAnalysis';
|
|
13
15
|
export { default as DetachedDOMElementAnalysis } from './plugins/DetachedDOMElementAnalysis';
|
package/dist/index.js
CHANGED
|
@@ -8,11 +8,29 @@
|
|
|
8
8
|
* @emails oncall+ws_labs
|
|
9
9
|
* @format
|
|
10
10
|
*/
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
11
20
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
21
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
22
|
};
|
|
14
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.heapAnalysisLoader = exports.PluginUtils = exports.StringAnalysis = exports.ObjectUnboundGrowthAnalysis = exports.ObjectShapeAnalysis = exports.ObjectFanoutAnalysis = exports.ShapeUnboundGrowthAnalysis = exports.ObjectSizeAnalysis = exports.ObjectShallowAnalysis = exports.CollectionsHoldingStaleAnalysis = exports.GlobalVariableAnalysis = exports.DetachedDOMElementAnalysis = exports.BaseAnalysis = exports.snapshotMapReduce = exports.loadHeapSnapshot = exports.getSnapshotFileForAnalysis = exports.getSnapshotDirForAnalysis = exports.getHeapFromFile = exports.getDominatorNodes = void 0;
|
|
24
|
+
exports.heapAnalysisLoader = exports.PluginUtils = exports.StringAnalysis = exports.ObjectUnboundGrowthAnalysis = exports.ObjectShapeAnalysis = exports.ObjectFanoutAnalysis = exports.ShapeUnboundGrowthAnalysis = exports.ObjectSizeAnalysis = exports.ObjectShallowAnalysis = exports.CollectionsHoldingStaleAnalysis = exports.GlobalVariableAnalysis = exports.DetachedDOMElementAnalysis = exports.BaseAnalysis = exports.snapshotMapReduce = exports.loadHeapSnapshot = exports.getSnapshotFileForAnalysis = exports.getSnapshotDirForAnalysis = exports.getHeapFromFile = exports.getDominatorNodes = exports.registerPackage = void 0;
|
|
25
|
+
const path_1 = __importDefault(require("path"));
|
|
26
|
+
const core_1 = require("@memlab/core");
|
|
27
|
+
/** @internal */
|
|
28
|
+
function registerPackage() {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
return core_1.PackageInfoLoader.registerPackage(path_1.default.join(__dirname, '..'));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.registerPackage = registerPackage;
|
|
16
34
|
const PluginUtils_1 = __importDefault(require("./PluginUtils"));
|
|
17
35
|
exports.getDominatorNodes = PluginUtils_1.default.getDominatorNodes, exports.getHeapFromFile = PluginUtils_1.default.getHeapFromFile, exports.getSnapshotDirForAnalysis = PluginUtils_1.default.getSnapshotDirForAnalysis, exports.getSnapshotFileForAnalysis = PluginUtils_1.default.getSnapshotFileForAnalysis, exports.loadHeapSnapshot = PluginUtils_1.default.loadHeapSnapshot, exports.snapshotMapReduce = PluginUtils_1.default.snapshotMapReduce;
|
|
18
36
|
var BaseAnalysis_1 = require("./BaseAnalysis");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memlab/heap-analysis",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "heap analysis plugins for memlab",
|
|
6
6
|
"author": "Liang Gong <lgong@fb.com>",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@memlab/core": "^1.
|
|
23
|
-
"@memlab/e2e": "^1.0.
|
|
22
|
+
"@memlab/core": "^1.1.6",
|
|
23
|
+
"@memlab/e2e": "^1.0.7",
|
|
24
24
|
"ansi": "^0.3.1",
|
|
25
25
|
"babar": "^0.2.0",
|
|
26
26
|
"chalk": "^4.0.0",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build-pkg": "tsc",
|
|
51
51
|
"test-pkg": "jest .",
|
|
52
|
+
"publish-patch": "npm version patch --force && npm publish",
|
|
52
53
|
"clean-pkg": "rm -rf ./dist && rm -rf ./node_modules && rm -f ./tsconfig.tsbuildinfo"
|
|
53
54
|
},
|
|
54
55
|
"bugs": {
|