@memlab/cli 1.0.43 → 1.0.45
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/BaseCommand.d.ts +1 -1
- package/dist/BaseCommand.d.ts.map +1 -1
- package/dist/BaseCommand.js +2 -2
- package/dist/Dispatcher.js +6 -6
- package/dist/commands/CleanLoggerDataCommand.js +1 -1
- package/dist/commands/CleanRunDataCommand.js +1 -1
- package/dist/commands/InitDirectoryCommand.js +1 -1
- package/dist/commands/MemLabRunCommand.js +8 -18
- package/dist/commands/PrintSummaryCommand.js +1 -1
- package/dist/commands/ResetDirectoryCommand.js +1 -1
- package/dist/commands/RunMeasureCommand.d.ts +1 -1
- package/dist/commands/RunMeasureCommand.d.ts.map +1 -1
- package/dist/commands/RunMeasureCommand.js +1 -1
- package/dist/commands/heap/CheckLeakCommand.d.ts +1 -1
- package/dist/commands/heap/CheckLeakCommand.d.ts.map +1 -1
- package/dist/commands/heap/CheckLeakCommand.js +11 -21
- package/dist/commands/heap/DiffLeakCommand.js +7 -17
- package/dist/commands/heap/GetRetainerTraceCommand.js +8 -18
- package/dist/commands/heap/HeapAnalysisCommand.js +8 -18
- package/dist/commands/heap/HeapAnalysisSubCommandWrapper.js +7 -17
- package/dist/commands/heap/interactive/InteractiveHeapCommand.js +8 -18
- package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.js +8 -18
- package/dist/commands/heap/interactive/ui-components/CliScreen.js +1 -1
- package/dist/commands/heap/interactive/ui-components/HeapViewUtils.js +6 -6
- package/dist/commands/heap/interactive/ui-components/ListComponent.js +1 -1
- package/dist/commands/helper/GenerateCLIDocCommand.js +8 -18
- package/dist/commands/helper/HelperCommand.js +10 -20
- package/dist/commands/query/QueryDefaultWorkDirCommand.js +7 -17
- package/dist/commands/snapshot/Snapshot.js +2 -1
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.d.ts +1 -1
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.d.ts.map +1 -1
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.js +1 -1
- package/dist/index.js +2 -1
- package/dist/lib/CLIUtils.js +5 -5
- package/dist/options/experiment/ExperimentOptionUtils.js +2 -1
- package/dist/options/experiment/utils/ExperimentOptionsUtils.js +3 -2
- package/dist/options/heap/leak-filter/examples/FilterLib.js +2 -1
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.js +3 -2
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.d.ts.map +1 -1
- package/dist/runner.js +2 -1
- package/package.json +5 -5
package/dist/BaseCommand.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export default class BaseCommand extends Command {
|
|
|
27
27
|
getExamples(): CommandOptionExample[];
|
|
28
28
|
getCategory(): CommandCategory;
|
|
29
29
|
getDescription(): string;
|
|
30
|
-
|
|
30
|
+
getDocumentation(): string;
|
|
31
31
|
getPrerequisites(): BaseCommand[];
|
|
32
32
|
isInternalCommand(): boolean;
|
|
33
33
|
getOptions(): BaseOption[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseCommand.d.ts","sourceRoot":"","sources":["../src/BaseCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,QAAQ,EACT,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,uBAAe,OAAO;IACpB,cAAc,IAAI,MAAM;IAUxB,OAAO,CAAC,aAAa,CAA+B;IAEpD,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAI3C,gBAAgB,IAAI,QAAQ,CAAC,WAAW,CAAC;IAIzC,cAAc,IAAI,MAAM;IAOxB,mCAAmC,IAAI,UAAU,EAAE;CA6BpD;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAG9C,cAAc,IAAI,MAAM;IAOxB,WAAW,IAAI,oBAAoB,EAAE;IAMrC,WAAW,IAAI,eAAe;IAM9B,cAAc,IAAI,MAAM;IAQxB,
|
|
1
|
+
{"version":3,"file":"BaseCommand.d.ts","sourceRoot":"","sources":["../src/BaseCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,QAAQ,EACT,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,uBAAe,OAAO;IACpB,cAAc,IAAI,MAAM;IAUxB,OAAO,CAAC,aAAa,CAA+B;IAEpD,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAI3C,gBAAgB,IAAI,QAAQ,CAAC,WAAW,CAAC;IAIzC,cAAc,IAAI,MAAM;IAOxB,mCAAmC,IAAI,UAAU,EAAE;CA6BpD;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAG9C,cAAc,IAAI,MAAM;IAOxB,WAAW,IAAI,oBAAoB,EAAE;IAMrC,WAAW,IAAI,eAAe;IAM9B,cAAc,IAAI,MAAM;IAQxB,gBAAgB,IAAI,MAAM;IAM1B,gBAAgB,IAAI,WAAW,EAAE;IAKjC,iBAAiB,IAAI,OAAO;IAK5B,UAAU,IAAI,UAAU,EAAE;IAQ1B,kBAAkB,IAAI,UAAU,EAAE;IAYlC,cAAc,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;IAOnC,GAAG,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAI/C"}
|
package/dist/BaseCommand.js
CHANGED
|
@@ -24,7 +24,7 @@ var CommandCategory;
|
|
|
24
24
|
CommandCategory["COMMON"] = "COMMON";
|
|
25
25
|
CommandCategory["DEV"] = "DEV";
|
|
26
26
|
CommandCategory["MISC"] = "MISC";
|
|
27
|
-
})(CommandCategory
|
|
27
|
+
})(CommandCategory = exports.CommandCategory || (exports.CommandCategory = {}));
|
|
28
28
|
class Command {
|
|
29
29
|
constructor() {
|
|
30
30
|
// If you are trying to add a new CLI command in MemLab,
|
|
@@ -104,7 +104,7 @@ class BaseCommand extends Command {
|
|
|
104
104
|
// More detailed description or documentation about this command.
|
|
105
105
|
// This will be printed as helper text in CLI for a specific command.
|
|
106
106
|
// Documentation generator will also use the description returned here.
|
|
107
|
-
|
|
107
|
+
getDocumentation() {
|
|
108
108
|
return '';
|
|
109
109
|
}
|
|
110
110
|
// get a sequence of commands that must be executed before
|
package/dist/Dispatcher.js
CHANGED
|
@@ -112,9 +112,9 @@ class CommandDispatcher {
|
|
|
112
112
|
}
|
|
113
113
|
return arr1;
|
|
114
114
|
}
|
|
115
|
-
runCommand(
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
runCommand(command, args, runCmdOpt = { configFromOptions: {} }) {
|
|
116
|
+
var _a;
|
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
118
118
|
const commandName = command.getCommandName();
|
|
119
119
|
// make sure commands on the prerequisite are only executed once
|
|
120
120
|
if (this.executedCommands.has(commandName)) {
|
|
@@ -149,8 +149,8 @@ class CommandDispatcher {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
runSubCommandIfAny(command, args, runCmdOpt) {
|
|
152
|
+
var _a;
|
|
152
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
-
var _a;
|
|
154
154
|
const subCommandIndex = (_a = runCmdOpt.commandIndex) !== null && _a !== void 0 ? _a : 0;
|
|
155
155
|
if (args._.length <= subCommandIndex) {
|
|
156
156
|
return;
|
|
@@ -170,8 +170,8 @@ class CommandDispatcher {
|
|
|
170
170
|
yield this.helper(args, command);
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
helper(
|
|
174
|
-
return __awaiter(this,
|
|
173
|
+
helper(cliArgs, command = null) {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
175
|
yield helperCommand.run({
|
|
176
176
|
modules: this.modules,
|
|
177
177
|
command,
|
|
@@ -39,8 +39,8 @@ class CleanTraceDataCommand extends BaseCommand_1.default {
|
|
|
39
39
|
return [new SetWorkingDirectoryOption_1.default()];
|
|
40
40
|
}
|
|
41
41
|
run(options) {
|
|
42
|
+
var _a;
|
|
42
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
var _a;
|
|
44
44
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
45
45
|
core_1.fileManager.emptyTraceLogDataDir({ workDir });
|
|
46
46
|
yield new InitDirectoryCommand_1.default().run(options);
|
|
@@ -38,8 +38,8 @@ class CleanRunDataCommand extends BaseCommand_1.default {
|
|
|
38
38
|
return [new SetWorkingDirectoryOption_1.default()];
|
|
39
39
|
}
|
|
40
40
|
run(options) {
|
|
41
|
+
var _a;
|
|
41
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
var _a;
|
|
43
43
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
44
44
|
core_1.fileManager.clearDataDirs({ workDir });
|
|
45
45
|
});
|
|
@@ -38,8 +38,8 @@ class InitDirectoryCommand extends BaseCommand_1.default {
|
|
|
38
38
|
return [new SetWorkingDirectoryOption_1.default()];
|
|
39
39
|
}
|
|
40
40
|
run(options) {
|
|
41
|
+
var _a;
|
|
41
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
var _a;
|
|
43
43
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
44
44
|
core_1.fileManager.initDirs(core_1.config, { workDir });
|
|
45
45
|
});
|
|
@@ -24,23 +24,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) ||
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
44
34
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
45
35
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
46
36
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -114,8 +104,8 @@ class MemLabRunCommand extends BaseCommand_1.default {
|
|
|
114
104
|
return BaseCommand_1.CommandCategory.COMMON;
|
|
115
105
|
}
|
|
116
106
|
run(options) {
|
|
107
|
+
var _a;
|
|
117
108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
-
var _a;
|
|
119
109
|
// move leaks.txt file
|
|
120
110
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
121
111
|
const outDir = core_1.fileManager.getDataOutDir({ workDir });
|
|
@@ -40,8 +40,8 @@ class PrintSummaryCommand extends BaseCommand_1.default {
|
|
|
40
40
|
return [new SetWorkingDirectoryOption_1.default()];
|
|
41
41
|
}
|
|
42
42
|
run(options) {
|
|
43
|
+
var _a;
|
|
43
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
45
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
46
46
|
const summaryFile = core_2.fileManager.getLeakSummaryFile({ workDir });
|
|
47
47
|
if (!fs_extra_1.default.existsSync(summaryFile)) {
|
|
@@ -35,8 +35,8 @@ class ResetDirectoryCommand extends BaseCommand_1.default {
|
|
|
35
35
|
return [new SetWorkingDirectoryOption_1.default()];
|
|
36
36
|
}
|
|
37
37
|
run(options) {
|
|
38
|
+
var _a;
|
|
38
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
var _a;
|
|
40
40
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
41
41
|
core_1.fileManager.rmWorkDir({ workDir });
|
|
42
42
|
core_1.fileManager.initDirs(core_1.config, { workDir });
|
|
@@ -16,7 +16,7 @@ export default class RunMeasureCommand extends BaseCommand {
|
|
|
16
16
|
getPrerequisites(): BaseCommand[];
|
|
17
17
|
getExamples(): CommandOptionExample[];
|
|
18
18
|
getOptions(): BaseOption[];
|
|
19
|
-
|
|
19
|
+
getDocumentation(): string;
|
|
20
20
|
run(options: CLIOptions): Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=RunMeasureCommand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunMeasureCommand.d.ts","sourceRoot":"","sources":["../../src/commands/RunMeasureCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAE,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAEnE,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAgB,UAAU,EAAC,MAAM,cAAc,CAAC;AA0BvD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,cAAc,IAAI,MAAM;IAIxB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,WAAW,EAAE;IAIjC,WAAW,IAAI,oBAAoB,EAAE;IAQrC,UAAU,IAAI,UAAU,EAAE;IA2B1B,
|
|
1
|
+
{"version":3,"file":"RunMeasureCommand.d.ts","sourceRoot":"","sources":["../../src/commands/RunMeasureCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAE,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAEnE,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAgB,UAAU,EAAC,MAAM,cAAc,CAAC;AA0BvD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,cAAc,IAAI,MAAM;IAIxB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,WAAW,EAAE;IAIjC,WAAW,IAAI,oBAAoB,EAAE;IAQrC,UAAU,IAAI,UAAU,EAAE;IA2B1B,gBAAgB,IAAI,MAAM;IAYpB,GAAG,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAS9C"}
|
|
@@ -91,7 +91,7 @@ class RunMeasureCommand extends BaseCommand_1.default {
|
|
|
91
91
|
new EnableJSInterceptOption_1.default(),
|
|
92
92
|
];
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
getDocumentation() {
|
|
95
95
|
return ('In some web apps, the heap size can show considerable variability' +
|
|
96
96
|
' across various runs. This fluctuation can often make it hard to' +
|
|
97
97
|
' understand the impact of memory leaks. The introduction of the measure' +
|
|
@@ -22,7 +22,7 @@ export default class CheckLeakCommand extends BaseCommand {
|
|
|
22
22
|
getCommandName(): string;
|
|
23
23
|
getExamples(): CommandOptionExample[];
|
|
24
24
|
getDescription(): string;
|
|
25
|
-
|
|
25
|
+
getDocumentation(): string;
|
|
26
26
|
getCategory(): CommandCategory;
|
|
27
27
|
getPrerequisites(): BaseCommand[];
|
|
28
28
|
getOptions(): BaseOption[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckLeakCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/heap/CheckLeakCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,oBAAoB,EAErB,MAAM,cAAc,CAAC;AAEtB,OAAO,WAAW,EAAE,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAsB/D,MAAM,MAAM,uBAAuB,GAAG;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACvD,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,0BAA0B,CAAS;IAE3C,SAAS,CAAC,6BAA6B,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IAOlE,SAAS,CAAC,iCAAiC,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;gBAM1D,OAAO,GAAE,uBAA4B;IAKjD,cAAc,IAAI,MAAM;IAIxB,WAAW,IAAI,oBAAoB,EAAE;IAgCrC,cAAc,IAAI,MAAM;IAIxB,
|
|
1
|
+
{"version":3,"file":"CheckLeakCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/heap/CheckLeakCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,oBAAoB,EAErB,MAAM,cAAc,CAAC;AAEtB,OAAO,WAAW,EAAE,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAsB/D,MAAM,MAAM,uBAAuB,GAAG;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACvD,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,0BAA0B,CAAS;IAE3C,SAAS,CAAC,6BAA6B,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IAOlE,SAAS,CAAC,iCAAiC,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;gBAM1D,OAAO,GAAE,uBAA4B;IAKjD,cAAc,IAAI,MAAM;IAIxB,WAAW,IAAI,oBAAoB,EAAE;IAgCrC,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM;IAqB1B,WAAW,IAAI,eAAe;IAI9B,gBAAgB,IAAI,WAAW,EAAE;IAIjC,UAAU,IAAI,UAAU,EAAE;IAqBpB,GAAG,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB9C"}
|
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -105,7 +95,7 @@ class CheckLeakCommand extends BaseCommand_1.default {
|
|
|
105
95
|
cliOptionExample: `${baselineOption} /tmp/baseline.heapsnapshot ${targetOption} /tmp/target.heapsnapshot ${finalOption} /tmp/final.heapsnapshot`,
|
|
106
96
|
},
|
|
107
97
|
{
|
|
108
|
-
description: 'specifies the directory that
|
|
98
|
+
description: 'specifies the directory that contains all three heap snapshot files',
|
|
109
99
|
cliOptionExample: `${snapshotDirOption} /dir/containing/heapsnapshot/files/`,
|
|
110
100
|
},
|
|
111
101
|
{
|
|
@@ -117,7 +107,7 @@ class CheckLeakCommand extends BaseCommand_1.default {
|
|
|
117
107
|
getDescription() {
|
|
118
108
|
return 'find memory leaks in heap snapshots';
|
|
119
109
|
}
|
|
120
|
-
|
|
110
|
+
getDocumentation() {
|
|
121
111
|
const optionNames = OptionConstant_1.default.optionNames;
|
|
122
112
|
const workDirOption = `--${optionNames.WORK_DIR}`;
|
|
123
113
|
const snapshotDirOption = `--${optionNames.SNAPSHOT_DIR}`;
|
|
@@ -126,7 +116,7 @@ class CheckLeakCommand extends BaseCommand_1.default {
|
|
|
126
116
|
const finalOption = `--${optionNames.FINAL}`;
|
|
127
117
|
return `There are three ways to specify inputs for the \`memlab ${this.getCommandName()}\` command:
|
|
128
118
|
1. \`${baselineOption}\`, \`${targetOption}\`, \`${finalOption}\` specifies each heap snapshot input individually;
|
|
129
|
-
2. \`${snapshotDirOption}\` specifies the directory that
|
|
119
|
+
2. \`${snapshotDirOption}\` specifies the directory that contains all three heap snapshot files (MemLab will assign baseline, target, and final based on alphabetic order of the file);
|
|
130
120
|
3. \`${workDirOption}\` specifies the output working directory of the \`memlab run\` or the \`memlab snapshot\` command;
|
|
131
121
|
|
|
132
122
|
Please only use one of the three ways to specify the input.
|
|
@@ -163,8 +153,8 @@ or option 2 mentioned above).
|
|
|
163
153
|
];
|
|
164
154
|
}
|
|
165
155
|
run(options) {
|
|
156
|
+
var _a, _b;
|
|
166
157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
-
var _a, _b;
|
|
168
158
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
169
159
|
core_1.fileManager.initDirs(core_1.config, { workDir });
|
|
170
160
|
const { runMetaInfoManager } = core_1.runInfoUtils;
|
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -24,23 +24,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) ||
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
44
34
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
45
35
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
46
36
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -96,8 +86,8 @@ class GetRetainerTraceCommand extends BaseCommand_1.default {
|
|
|
96
86
|
];
|
|
97
87
|
}
|
|
98
88
|
run(options) {
|
|
89
|
+
var _a;
|
|
99
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
var _a;
|
|
101
91
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
102
92
|
const reportOutDir = core_2.fileManager.getReportOutDir({ workDir });
|
|
103
93
|
fs_extra_1.default.emptyDirSync(reportOutDir);
|
|
@@ -24,23 +24,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) ||
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
44
34
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
45
35
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
46
36
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -112,8 +102,8 @@ class RunHeapAnalysisCommand extends BaseCommand_1.default {
|
|
|
112
102
|
});
|
|
113
103
|
}
|
|
114
104
|
run(options) {
|
|
105
|
+
var _a;
|
|
115
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
-
var _a;
|
|
117
107
|
// process command line arguments and load analysis modules
|
|
118
108
|
const args = options.cliArgs;
|
|
119
109
|
let plugin = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.heapAnalysisPlugin;
|
|
@@ -24,23 +24,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) ||
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
44
34
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
45
35
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
46
36
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -24,23 +24,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) ||
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
44
34
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
45
35
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
46
36
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -166,8 +156,8 @@ class InteractiveHeapCommand extends BaseCommand_1.default {
|
|
|
166
156
|
rl.prompt();
|
|
167
157
|
}
|
|
168
158
|
run(options) {
|
|
159
|
+
var _a;
|
|
169
160
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
-
var _a;
|
|
171
161
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
172
162
|
const reportOutDir = core_3.fileManager.getReportOutDir({ workDir });
|
|
173
163
|
fs_extra_1.default.emptyDirSync(reportOutDir);
|
|
@@ -24,23 +24,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) ||
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
44
34
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
45
35
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
46
36
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -171,8 +161,8 @@ class InteractiveHeapViewCommand extends BaseCommand_1.default {
|
|
|
171
161
|
});
|
|
172
162
|
}
|
|
173
163
|
run(options) {
|
|
164
|
+
var _a;
|
|
174
165
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
-
var _a;
|
|
176
166
|
const workDir = (_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.workDir;
|
|
177
167
|
core_1.fileManager.initDirs(core_1.config, { workDir, errorWhenAbsent: true });
|
|
178
168
|
const reportOutDir = core_1.fileManager.getReportOutDir({ workDir });
|
|
@@ -3,11 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ComponentData = exports.ComponentDataItem = void 0;
|
|
7
|
-
exports.throwIfNodesEmpty = throwIfNodesEmpty;
|
|
8
|
-
exports.getHeapObjectAt = getHeapObjectAt;
|
|
9
|
-
exports.substringWithColor = substringWithColor;
|
|
10
|
-
exports.debounce = debounce;
|
|
6
|
+
exports.debounce = exports.substringWithColor = exports.getHeapObjectAt = exports.throwIfNodesEmpty = exports.ComponentData = exports.ComponentDataItem = void 0;
|
|
11
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
12
8
|
const core_1 = require("@memlab/core");
|
|
13
9
|
const lessUsefulEdgeTypeForDebugging = new Set([
|
|
@@ -109,7 +105,7 @@ class ComponentDataItem {
|
|
|
109
105
|
if (data.referenceEdge) {
|
|
110
106
|
ret += this.getHeapEdgeTextContent(data.referenceEdge);
|
|
111
107
|
}
|
|
112
|
-
return ret === '' ? chalk_1.default.grey('<
|
|
108
|
+
return ret === '' ? chalk_1.default.grey('<undefined>') : ret;
|
|
113
109
|
}
|
|
114
110
|
}
|
|
115
111
|
exports.ComponentDataItem = ComponentDataItem;
|
|
@@ -131,6 +127,7 @@ function throwIfNodesEmpty(nodes) {
|
|
|
131
127
|
}
|
|
132
128
|
return true;
|
|
133
129
|
}
|
|
130
|
+
exports.throwIfNodesEmpty = throwIfNodesEmpty;
|
|
134
131
|
function getHeapObjectAt(nodes, index) {
|
|
135
132
|
throwIfNodesEmpty(nodes);
|
|
136
133
|
if (index < 0 || index >= nodes.length) {
|
|
@@ -138,6 +135,7 @@ function getHeapObjectAt(nodes, index) {
|
|
|
138
135
|
}
|
|
139
136
|
return nodes[index].heapObject;
|
|
140
137
|
}
|
|
138
|
+
exports.getHeapObjectAt = getHeapObjectAt;
|
|
141
139
|
// eslint-disable-next-line no-control-regex
|
|
142
140
|
const colorBegin = /^\u001b\[(\d+)m/;
|
|
143
141
|
// eslint-disable-next-line no-control-regex
|
|
@@ -195,6 +193,7 @@ function substringWithColor(input, begin) {
|
|
|
195
193
|
}
|
|
196
194
|
return curStr;
|
|
197
195
|
}
|
|
196
|
+
exports.substringWithColor = substringWithColor;
|
|
198
197
|
function debounce(timeInMs) {
|
|
199
198
|
let id = null;
|
|
200
199
|
return (callback) => {
|
|
@@ -207,3 +206,4 @@ function debounce(timeInMs) {
|
|
|
207
206
|
}, timeInMs);
|
|
208
207
|
};
|
|
209
208
|
}
|
|
209
|
+
exports.debounce = debounce;
|
|
@@ -24,23 +24,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) ||
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
44
34
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
45
35
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
46
36
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -149,7 +139,7 @@ npm install -g memlab
|
|
|
149
139
|
var _a, _b;
|
|
150
140
|
const name = command.getFullCommand();
|
|
151
141
|
const desc = core_1.utils.upperCaseFirstCharacter(command.getDescription().trim());
|
|
152
|
-
const cmdDoc = command.
|
|
142
|
+
const cmdDoc = command.getDocumentation().trim();
|
|
153
143
|
// write command title
|
|
154
144
|
this.writeTextWithNewLine(docFile, `\n###${indent} memlab ${name}\n`);
|
|
155
145
|
// write description
|
|
@@ -24,23 +24,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) ||
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
44
34
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
45
35
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
46
36
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -204,7 +194,7 @@ class HelperCommand extends BaseCommand_1.default {
|
|
|
204
194
|
const indent = ' ' + extraIndent;
|
|
205
195
|
const name = command.getFullCommand();
|
|
206
196
|
const desc = core_1.utils.upperCaseFirstCharacter(command.getDescription().trim());
|
|
207
|
-
const cmdDoc = command.
|
|
197
|
+
const cmdDoc = command.getDocumentation().trim();
|
|
208
198
|
// get example
|
|
209
199
|
const examples = command.getExamples();
|
|
210
200
|
const example = (_a = examples[0]) !== null && _a !== void 0 ? _a : '';
|
|
@@ -236,8 +226,8 @@ class HelperCommand extends BaseCommand_1.default {
|
|
|
236
226
|
core_1.info.topLevel('');
|
|
237
227
|
}
|
|
238
228
|
printHelperTextForCommand(command, options) {
|
|
229
|
+
var _a;
|
|
239
230
|
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
-
var _a;
|
|
241
231
|
// print helper text for a specific command
|
|
242
232
|
this.printCommand(command, options.indent, options);
|
|
243
233
|
// print helper text for its subcommands
|
|
@@ -251,8 +241,8 @@ class HelperCommand extends BaseCommand_1.default {
|
|
|
251
241
|
});
|
|
252
242
|
}
|
|
253
243
|
printFullHelperTextForCommand(args, modules) {
|
|
244
|
+
var _a, _b;
|
|
254
245
|
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
-
var _a, _b;
|
|
256
246
|
// get the command to print
|
|
257
247
|
let map = modules;
|
|
258
248
|
let command;
|
|
@@ -24,23 +24,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
24
24
|
}) : function(o, v) {
|
|
25
25
|
o["default"] = v;
|
|
26
26
|
});
|
|
27
|
-
var __importStar = (this && this.__importStar) ||
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
44
34
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
45
35
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
46
36
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -18,7 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.runPageInteractionFromCLI =
|
|
21
|
+
exports.runPageInteractionFromCLI = void 0;
|
|
22
22
|
const core_1 = require("@memlab/core");
|
|
23
23
|
const api_1 = require("@memlab/api");
|
|
24
24
|
function runPageInteractionFromCLI() {
|
|
@@ -44,3 +44,4 @@ function runPageInteractionFromCLI() {
|
|
|
44
44
|
core_1.info.topLevel(`total time: ${core_1.utils.getReadableTime(end - start)}`);
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
+
exports.runPageInteractionFromCLI = runPageInteractionFromCLI;
|
|
@@ -12,7 +12,7 @@ import BaseCommand from '../../BaseCommand';
|
|
|
12
12
|
export default class WarmupAndSnapshotCommand extends BaseCommand {
|
|
13
13
|
getCommandName(): string;
|
|
14
14
|
getDescription(): string;
|
|
15
|
-
|
|
15
|
+
getDocumentation(): string;
|
|
16
16
|
getExamples(): CommandOptionExample[];
|
|
17
17
|
getPrerequisites(): BaseCommand[];
|
|
18
18
|
run(_options: CLIOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarmupAndSnapshotCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/snapshot/WarmupAndSnapshotCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAE,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAEnE,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAM5C,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,WAAW;IAC/D,cAAc,IAAI,MAAM;IAIxB,cAAc,IAAI,MAAM;IAIxB,
|
|
1
|
+
{"version":3,"file":"WarmupAndSnapshotCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/snapshot/WarmupAndSnapshotCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAE,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAEnE,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAM5C,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,WAAW;IAC/D,cAAc,IAAI,MAAM;IAIxB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM;IAW1B,WAAW,IAAI,oBAAoB,EAAE;IAiBrC,gBAAgB,IAAI,WAAW,EAAE;IAS3B,GAAG,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"}
|
|
@@ -33,7 +33,7 @@ class WarmupAndSnapshotCommand extends BaseCommand_1.default {
|
|
|
33
33
|
getDescription() {
|
|
34
34
|
return 'Warm up server and take heap snapshots';
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
getDocumentation() {
|
|
37
37
|
const warmupCommand = new WarmupAppCommand_1.default();
|
|
38
38
|
const warmupCLI = `memlab ${warmupCommand.getCommandName()}`;
|
|
39
39
|
const takeSnapshotCommand = new TakeSnapshotCommand_1.default();
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.registerPackage =
|
|
38
|
+
exports.registerPackage = void 0;
|
|
39
39
|
const path_1 = __importDefault(require("path"));
|
|
40
40
|
const core_1 = require("@memlab/core");
|
|
41
41
|
/** @internal */
|
|
@@ -44,4 +44,5 @@ function registerPackage() {
|
|
|
44
44
|
return core_1.PackageInfoLoader.registerPackage(path_1.default.join(__dirname, '..'));
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
+
exports.registerPackage = registerPackage;
|
|
47
48
|
__exportStar(require("./runner"), exports);
|
package/dist/lib/CLIUtils.js
CHANGED
|
@@ -3,11 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.READABLE_TEXT_WIDTH = exports.READABLE_CMD_FLAG_WIDTH = void 0;
|
|
7
|
-
exports.filterAndGetUndefinedArgs = filterAndGetUndefinedArgs;
|
|
8
|
-
exports.argsToString = argsToString;
|
|
9
|
-
exports.getBlankSpaceString = getBlankSpaceString;
|
|
10
|
-
exports.alignTextInBlock = alignTextInBlock;
|
|
6
|
+
exports.alignTextInBlock = exports.getBlankSpaceString = exports.argsToString = exports.filterAndGetUndefinedArgs = exports.READABLE_TEXT_WIDTH = exports.READABLE_CMD_FLAG_WIDTH = void 0;
|
|
11
7
|
const string_width_1 = __importDefault(require("string-width"));
|
|
12
8
|
const core_1 = require("@memlab/core");
|
|
13
9
|
const OptionConstant_1 = __importDefault(require("../options/lib/OptionConstant"));
|
|
@@ -42,6 +38,7 @@ function filterAndGetUndefinedArgs(cliArgs) {
|
|
|
42
38
|
}
|
|
43
39
|
return ret;
|
|
44
40
|
}
|
|
41
|
+
exports.filterAndGetUndefinedArgs = filterAndGetUndefinedArgs;
|
|
45
42
|
function quoteIfNecessary(v) {
|
|
46
43
|
if (typeof v !== 'string') {
|
|
47
44
|
return v;
|
|
@@ -76,6 +73,7 @@ function argsToString(args) {
|
|
|
76
73
|
}
|
|
77
74
|
return ret.trim();
|
|
78
75
|
}
|
|
76
|
+
exports.argsToString = argsToString;
|
|
79
77
|
function getBlankSpaceString(length) {
|
|
80
78
|
let ret = '';
|
|
81
79
|
for (let i = 0; i < length; ++i) {
|
|
@@ -83,6 +81,7 @@ function getBlankSpaceString(length) {
|
|
|
83
81
|
}
|
|
84
82
|
return ret;
|
|
85
83
|
}
|
|
84
|
+
exports.getBlankSpaceString = getBlankSpaceString;
|
|
86
85
|
function alignTextInBlock(text, options) {
|
|
87
86
|
var _a, _b;
|
|
88
87
|
const indent = (_a = options.leftIndent) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -109,6 +108,7 @@ function alignTextInBlock(text, options) {
|
|
|
109
108
|
}
|
|
110
109
|
return outputLines.join('\n');
|
|
111
110
|
}
|
|
111
|
+
exports.alignTextInBlock = alignTextInBlock;
|
|
112
112
|
function splitIntoReadableSubstrings(text, intendedSplitPoint) {
|
|
113
113
|
if (intendedSplitPoint >= text.length) {
|
|
114
114
|
return [text];
|
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.extractAndCheckWorkDirs =
|
|
15
|
+
exports.extractAndCheckWorkDirs = void 0;
|
|
16
16
|
const fs_1 = __importDefault(require("fs"));
|
|
17
17
|
const core_1 = require("@memlab/core");
|
|
18
18
|
function extractAndCheckWorkDirs(optionName, args) {
|
|
@@ -36,3 +36,4 @@ function extractAndCheckWorkDirs(optionName, args) {
|
|
|
36
36
|
}
|
|
37
37
|
return dirs;
|
|
38
38
|
}
|
|
39
|
+
exports.extractAndCheckWorkDirs = extractAndCheckWorkDirs;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateHeapSnapshotFileOrThrow =
|
|
4
|
-
exports.createTransientWorkDirFromSingleHeapSnapshot = createTransientWorkDirFromSingleHeapSnapshot;
|
|
3
|
+
exports.createTransientWorkDirFromSingleHeapSnapshot = exports.validateHeapSnapshotFileOrThrow = void 0;
|
|
5
4
|
/**
|
|
6
5
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
6
|
*
|
|
@@ -25,8 +24,10 @@ function validateHeapSnapshotFileOrThrow(file) {
|
|
|
25
24
|
}
|
|
26
25
|
return file;
|
|
27
26
|
}
|
|
27
|
+
exports.validateHeapSnapshotFileOrThrow = validateHeapSnapshotFileOrThrow;
|
|
28
28
|
function createTransientWorkDirFromSingleHeapSnapshot(file) {
|
|
29
29
|
const config = core_1.MemLabConfig.resetConfigWithTransientDir();
|
|
30
30
|
core_1.fileManager.createOrOverrideVisitOrderMetaFileForExternalSnapshot(file);
|
|
31
31
|
return config.workDir;
|
|
32
32
|
}
|
|
33
|
+
exports.createTransientWorkDirFromSingleHeapSnapshot = createTransientWorkDirFromSingleHeapSnapshot;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.initMap =
|
|
12
|
+
exports.initMap = void 0;
|
|
13
13
|
const core_1 = require("@memlab/core");
|
|
14
14
|
function initMap(snapshot) {
|
|
15
15
|
const map = Object.create(null);
|
|
@@ -27,3 +27,4 @@ function initMap(snapshot) {
|
|
|
27
27
|
});
|
|
28
28
|
return map;
|
|
29
29
|
}
|
|
30
|
+
exports.initMap = initMap;
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.beforeLeakFilter =
|
|
13
|
-
exports.leakFilter = leakFilter;
|
|
12
|
+
exports.leakFilter = exports.beforeLeakFilter = void 0;
|
|
14
13
|
const core_1 = require("@memlab/core");
|
|
15
14
|
const FilterLib_1 = require("./FilterLib");
|
|
16
15
|
let map = Object.create(null);
|
|
@@ -19,6 +18,7 @@ function beforeLeakFilter(snapshot,
|
|
|
19
18
|
_leakedNodeIds) {
|
|
20
19
|
map = (0, FilterLib_1.initMap)(snapshot);
|
|
21
20
|
}
|
|
21
|
+
exports.beforeLeakFilter = beforeLeakFilter;
|
|
22
22
|
// duplicated string with size > 1KB as memory leak
|
|
23
23
|
function leakFilter(node) {
|
|
24
24
|
if (node.type !== 'string' || node.retainedSize < 1000) {
|
|
@@ -27,3 +27,4 @@ function leakFilter(node) {
|
|
|
27
27
|
const str = core_1.utils.getStringNodeValue(node);
|
|
28
28
|
return map[str] > 1;
|
|
29
29
|
}
|
|
30
|
+
exports.leakFilter = leakFilter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dup-string-as-leak.example-2.d.ts","sourceRoot":"","sources":["../../../../../src/options/heap/leak-filter/examples/dup-string-as-leak.example-2.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,aAAa,EAAQ,MAAM,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"dup-string-as-leak.example-2.d.ts","sourceRoot":"","sources":["../../../../../src/options/heap/leak-filter/examples/dup-string-as-leak.example-2.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,aAAa,EAAQ,MAAM,cAAc,CAAC;;;;;AAsB5E,wBAA8C"}
|
package/dist/runner.js
CHANGED
|
@@ -21,7 +21,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
21
21
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.run =
|
|
24
|
+
exports.run = void 0;
|
|
25
25
|
const minimist_1 = __importDefault(require("minimist"));
|
|
26
26
|
const core_1 = require("@memlab/core");
|
|
27
27
|
const Dispatcher_1 = __importDefault(require("./Dispatcher"));
|
|
@@ -31,6 +31,7 @@ function run() {
|
|
|
31
31
|
Dispatcher_1.default.dispatch(argv);
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
exports.run = run;
|
|
34
35
|
if (require.main === module) {
|
|
35
36
|
// called from command line
|
|
36
37
|
core_1.utils.callAsync(run);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memlab/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "command line interface for memlab",
|
|
6
6
|
"author": "Liang Gong <lgong@meta.com>",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@memlab/api": "^1.0.
|
|
30
|
-
"@memlab/core": "^1.1.
|
|
31
|
-
"@memlab/e2e": "^1.0.
|
|
32
|
-
"@memlab/heap-analysis": "^1.0.
|
|
29
|
+
"@memlab/api": "^1.0.42",
|
|
30
|
+
"@memlab/core": "^1.1.43",
|
|
31
|
+
"@memlab/e2e": "^1.0.43",
|
|
32
|
+
"@memlab/heap-analysis": "^1.0.40",
|
|
33
33
|
"ansi": "^0.3.1",
|
|
34
34
|
"babar": "^0.2.0",
|
|
35
35
|
"blessed": "^0.1.81",
|