@memlab/heap-analysis 1.0.34 → 1.0.36
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/dist/options/HeapAnalysisOutputOption.d.ts.map +1 -1
- package/dist/options/HeapAnalysisOutputOption.js +5 -1
- package/dist/plugins/ObjectContentAnalysis.d.ts +1 -2
- package/dist/plugins/ObjectContentAnalysis.d.ts.map +1 -1
- package/dist/plugins/ObjectContentAnalysis.js +8 -5
- package/dist/plugins/ObjectShapeAnalysis.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeapAnalysisOutputOption.d.ts","sourceRoot":"","sources":["../../src/options/HeapAnalysisOutputOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,EAAC,YAAY,EAAsB,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,UAAU;IAC9D,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"HeapAnalysisOutputOption.d.ts","sourceRoot":"","sources":["../../src/options/HeapAnalysisOutputOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,EAAC,YAAY,EAAsB,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,UAAU;IAC9D,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAUxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IASlE,OAAO,CAAC,MAAM,CAAC,iBAAiB;CAWjC"}
|
|
@@ -25,7 +25,11 @@ class HeapAnalysisOutputOption extends core_2.BaseOption {
|
|
|
25
25
|
return 'output';
|
|
26
26
|
}
|
|
27
27
|
getDescription() {
|
|
28
|
-
|
|
28
|
+
const options = this.getExampleValues()
|
|
29
|
+
.map(v => `'${v}'`)
|
|
30
|
+
.join(', ');
|
|
31
|
+
return ('specify output format of the analysis ' +
|
|
32
|
+
`(available options: ${options}; defaults to 'text')`);
|
|
29
33
|
}
|
|
30
34
|
getExampleValues() {
|
|
31
35
|
return ['text', 'json'];
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { AnalyzeSnapshotResult, HeapAnalysisOptions } from '../PluginUtils';
|
|
11
11
|
import { BaseOption } from '@memlab/core';
|
|
12
12
|
import BaseAnalysis from '../BaseAnalysis';
|
|
13
|
-
|
|
13
|
+
export default class ObjectContentAnalysis extends BaseAnalysis {
|
|
14
14
|
getCommandName(): string;
|
|
15
15
|
/** @internal */
|
|
16
16
|
getDescription(): string;
|
|
@@ -26,5 +26,4 @@ declare class GlobalVariableAnalysis extends BaseAnalysis {
|
|
|
26
26
|
/** @internal */
|
|
27
27
|
private getObjectReferrerEdges;
|
|
28
28
|
}
|
|
29
|
-
export default GlobalVariableAnalysis;
|
|
30
29
|
//# sourceMappingURL=ObjectContentAnalysis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectContentAnalysis.d.ts","sourceRoot":"","sources":["../../src/plugins/ObjectContentAnalysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAC,qBAAqB,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAG/E,OAAO,EAAC,UAAU,EAAoC,MAAM,cAAc,CAAC;AAG3E,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAI3C,
|
|
1
|
+
{"version":3,"file":"ObjectContentAnalysis.d.ts","sourceRoot":"","sources":["../../src/plugins/ObjectContentAnalysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAC,qBAAqB,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAG/E,OAAO,EAAC,UAAU,EAAoC,MAAM,cAAc,CAAC;AAG3E,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY;IAC7D,cAAc,IAAI,MAAM;IAIxB,gBAAgB;IAChB,cAAc,IAAI,MAAM;IAIxB,gBAAgB;IAChB,UAAU,IAAI,UAAU,EAAE;IAI1B,gBAAgB;IACV,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB1D,OAAO,CAAC,KAAK;IA8Bb,gBAAgB;IACH,2BAA2B,CACtC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC;IAQjC,gBAAgB;IAChB,OAAO,CAAC,mBAAmB;IAY3B,gBAAgB;IAChB,OAAO,CAAC,sBAAsB;CAW/B"}
|
|
@@ -28,7 +28,7 @@ const HeapAnalysisSnapshotFileOption_1 = __importDefault(require("../options/Hea
|
|
|
28
28
|
const BaseAnalysis_1 = __importDefault(require("../BaseAnalysis"));
|
|
29
29
|
const PluginUtils_1 = __importDefault(require("../PluginUtils"));
|
|
30
30
|
const HeapAnalysisOutputOption_1 = __importDefault(require("../options/HeapAnalysisOutputOption"));
|
|
31
|
-
class
|
|
31
|
+
class ObjectContentAnalysis extends BaseAnalysis_1.default {
|
|
32
32
|
getCommandName() {
|
|
33
33
|
return 'object';
|
|
34
34
|
}
|
|
@@ -43,12 +43,15 @@ class GlobalVariableAnalysis extends BaseAnalysis_1.default {
|
|
|
43
43
|
/** @internal */
|
|
44
44
|
process(options) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
const snapshot = yield PluginUtils_1.default.loadHeapSnapshot(options);
|
|
47
46
|
const nodeId = core_1.config.focusFiberNodeId;
|
|
47
|
+
if (nodeId < 0) {
|
|
48
|
+
core_1.utils.haltOrThrow('Specify an object by --node-id');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const snapshot = yield PluginUtils_1.default.loadHeapSnapshot(options);
|
|
48
52
|
const node = snapshot.getNodeById(nodeId);
|
|
49
53
|
if (!node) {
|
|
50
|
-
core_1.
|
|
51
|
-
core_1.info.lowLevel(`Specify an object by --node-id`);
|
|
54
|
+
core_1.utils.haltOrThrow(`Object @${nodeId} is not found.`);
|
|
52
55
|
return;
|
|
53
56
|
}
|
|
54
57
|
if (core_1.config.outputFormat === core_1.OutputFormat.Json) {
|
|
@@ -113,4 +116,4 @@ class GlobalVariableAnalysis extends BaseAnalysis_1.default {
|
|
|
113
116
|
return ret;
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
|
-
exports.default =
|
|
119
|
+
exports.default = ObjectContentAnalysis;
|
|
@@ -83,7 +83,7 @@ class ObjectShapeAnalysis extends BaseAnalysis_1.default {
|
|
|
83
83
|
const key = core_1.serializer.summarizeNodeShape(node);
|
|
84
84
|
breakdown[key] = breakdown[key] || new Set();
|
|
85
85
|
breakdown[key].add(node.id);
|
|
86
|
-
if (population[key] ===
|
|
86
|
+
if (population[key] === void 0) {
|
|
87
87
|
population[key] = { examples: [], n: 0 };
|
|
88
88
|
}
|
|
89
89
|
++population[key].n;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memlab/heap-analysis",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.36",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "heap analysis plugins for memlab",
|
|
6
6
|
"author": "Liang Gong <lgong@fb.com>",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"LICENSE"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@memlab/core": "^1.1.
|
|
24
|
-
"@memlab/e2e": "^1.0.
|
|
23
|
+
"@memlab/core": "^1.1.39",
|
|
24
|
+
"@memlab/e2e": "^1.0.39",
|
|
25
25
|
"ansi": "^0.3.1",
|
|
26
26
|
"babar": "^0.2.0",
|
|
27
27
|
"chalk": "^4.0.0",
|