@memlab/cli 1.0.7 → 1.0.11
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/bin/{memlab → memlab.js} +5 -3
- package/dist/BaseCommand.d.ts +1 -1
- package/dist/BaseCommand.js +1 -1
- package/dist/CommandLoader.d.ts +8 -7
- package/dist/CommandLoader.js +8 -1
- package/dist/Dispatcher.d.ts +8 -3
- package/dist/Dispatcher.js +13 -6
- package/dist/TypesThirdParty.d.ts +1 -1
- package/dist/TypesThirdParty.js +1 -1
- package/dist/commands/CleanLoggerDataCommand.d.ts +1 -1
- package/dist/commands/CleanLoggerDataCommand.js +1 -1
- package/dist/commands/CleanRunDataCommand.d.ts +1 -1
- package/dist/commands/CleanRunDataCommand.js +1 -1
- package/dist/commands/GetVersionCommand.d.ts +1 -1
- package/dist/commands/GetVersionCommand.js +2 -2
- package/dist/commands/InitDirectoryCommand.d.ts +1 -1
- package/dist/commands/InitDirectoryCommand.js +1 -1
- package/dist/commands/ListScenariosCommand.d.ts +1 -1
- package/dist/commands/ListScenariosCommand.js +1 -1
- package/dist/commands/MemLabRunCommand.d.ts +1 -1
- package/dist/commands/MemLabRunCommand.js +1 -1
- package/dist/commands/PrintSummaryCommand.d.ts +1 -1
- package/dist/commands/PrintSummaryCommand.js +1 -1
- package/dist/commands/ResetDirectoryCommand.d.ts +1 -1
- package/dist/commands/ResetDirectoryCommand.js +1 -1
- package/dist/commands/RunMeasureCommand.d.ts +1 -1
- package/dist/commands/RunMeasureCommand.js +1 -1
- package/dist/commands/WarmupAppCommand.d.ts +1 -1
- package/dist/commands/WarmupAppCommand.js +1 -1
- package/dist/commands/heap/CheckLeakCommand.d.ts +1 -1
- package/dist/commands/heap/CheckLeakCommand.js +3 -1
- package/dist/commands/heap/GetRetainerTraceCommand.d.ts +1 -1
- package/dist/commands/heap/GetRetainerTraceCommand.js +1 -1
- package/dist/commands/heap/HeapAnalysisCommand.d.ts +1 -1
- package/dist/commands/heap/HeapAnalysisCommand.js +1 -1
- package/dist/commands/heap/HeapAnalysisSubCommandWrapper.d.ts +1 -1
- package/dist/commands/heap/HeapAnalysisSubCommandWrapper.js +1 -1
- package/dist/commands/heap/interactive/InteractiveCommandLoader.d.ts +16 -0
- package/dist/commands/heap/interactive/InteractiveCommandLoader.js +33 -0
- package/dist/commands/heap/interactive/InteractiveHeapCommand.d.ts +28 -0
- package/dist/commands/heap/interactive/InteractiveHeapCommand.js +166 -0
- package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.d.ts +25 -0
- package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.js +169 -0
- package/dist/commands/heap/interactive/ui-components/CliScreen.d.ts +38 -0
- package/dist/commands/heap/interactive/ui-components/CliScreen.js +253 -0
- package/dist/commands/heap/interactive/ui-components/HeapViewController.d.ts +73 -0
- package/dist/commands/heap/interactive/ui-components/HeapViewController.js +358 -0
- package/dist/commands/heap/interactive/ui-components/HeapViewUtils.d.ts +32 -0
- package/dist/commands/heap/interactive/ui-components/HeapViewUtils.js +205 -0
- package/dist/commands/heap/interactive/ui-components/ListComponent.d.ts +65 -0
- package/dist/commands/heap/interactive/ui-components/ListComponent.js +237 -0
- package/dist/commands/helper/GenerateCLIDocCommand.d.ts +1 -1
- package/dist/commands/helper/GenerateCLIDocCommand.js +1 -1
- package/dist/commands/helper/HelperCommand.d.ts +1 -1
- package/dist/commands/helper/HelperCommand.js +17 -5
- package/dist/commands/helper/lib/CommandOrder.d.ts +1 -1
- package/dist/commands/helper/lib/CommandOrder.js +1 -1
- package/dist/commands/helper/lib/Types.d.ts +1 -1
- package/dist/commands/helper/lib/Types.js +1 -1
- package/dist/commands/query/QueryDefaultWorkDirCommand.d.ts +1 -1
- package/dist/commands/query/QueryDefaultWorkDirCommand.js +1 -1
- package/dist/commands/snapshot/CheckXvfbSupportCommand.d.ts +1 -1
- package/dist/commands/snapshot/CheckXvfbSupportCommand.js +1 -1
- package/dist/commands/snapshot/Snapshot.d.ts +1 -1
- package/dist/commands/snapshot/Snapshot.js +1 -1
- package/dist/commands/snapshot/TakeSnapshotCommand.d.ts +1 -1
- package/dist/commands/snapshot/TakeSnapshotCommand.js +1 -1
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.d.ts +1 -1
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/options/AppOption.d.ts +1 -1
- package/dist/options/AppOption.js +1 -1
- package/dist/options/DebugOption.d.ts +1 -1
- package/dist/options/DebugOption.js +1 -1
- package/dist/options/DisableXvfbOption.d.ts +1 -1
- package/dist/options/DisableXvfbOption.js +1 -1
- package/dist/options/FullExecutionOption.d.ts +1 -1
- package/dist/options/FullExecutionOption.js +1 -1
- package/dist/options/HeadfulBrowserOption.d.ts +1 -1
- package/dist/options/HeadfulBrowserOption.js +1 -1
- package/dist/options/HeapNodeIdOption.d.ts +1 -1
- package/dist/options/HeapNodeIdOption.js +1 -1
- package/dist/options/HelperOption.d.ts +1 -1
- package/dist/options/HelperOption.js +1 -1
- package/dist/options/InteractionOption.d.ts +1 -1
- package/dist/options/InteractionOption.js +1 -1
- package/dist/options/MLClusteringLinkageMaxDistanceOption.d.ts +1 -1
- package/dist/options/MLClusteringLinkageMaxDistanceOption.js +1 -1
- package/dist/options/MLClusteringMaxDFOption.d.ts +18 -0
- package/dist/options/MLClusteringMaxDFOption.js +47 -0
- package/dist/options/MLClusteringOption.d.ts +1 -1
- package/dist/options/MLClusteringOption.js +1 -1
- package/dist/options/NumberOfRunsOption.d.ts +1 -1
- package/dist/options/NumberOfRunsOption.js +1 -1
- package/dist/options/RemoteBrowserDebugOption.d.ts +1 -1
- package/dist/options/RemoteBrowserDebugOption.js +1 -1
- package/dist/options/RunningModeOption.d.ts +1 -1
- package/dist/options/RunningModeOption.js +1 -1
- package/dist/options/ScenarioFileOption.d.ts +1 -1
- package/dist/options/ScenarioFileOption.js +1 -1
- package/dist/options/SetContinuousTestOption.d.ts +1 -1
- package/dist/options/SetContinuousTestOption.js +1 -1
- package/dist/options/SetDeviceOption.d.ts +1 -1
- package/dist/options/SetDeviceOption.js +1 -1
- package/dist/options/SetWorkingDirectoryOption.d.ts +1 -1
- package/dist/options/SetWorkingDirectoryOption.js +1 -1
- package/dist/options/SilentOption.d.ts +1 -1
- package/dist/options/SilentOption.js +1 -1
- package/dist/options/SkipExtraOperationOption.d.ts +1 -1
- package/dist/options/SkipExtraOperationOption.js +1 -1
- package/dist/options/SkipGCOption.d.ts +1 -1
- package/dist/options/SkipGCOption.js +1 -1
- package/dist/options/SkipScreenshotOption.d.ts +1 -1
- package/dist/options/SkipScreenshotOption.js +1 -1
- package/dist/options/SkipScrollOption.d.ts +1 -1
- package/dist/options/SkipScrollOption.js +1 -1
- package/dist/options/SkipSnapshotOption.d.ts +1 -1
- package/dist/options/SkipSnapshotOption.js +1 -1
- package/dist/options/SkipWarmupOption.d.ts +1 -1
- package/dist/options/SkipWarmupOption.js +1 -1
- package/dist/options/VerboseOption.d.ts +1 -1
- package/dist/options/VerboseOption.js +1 -1
- package/dist/options/heap/BaselineFileOption.d.ts +1 -1
- package/dist/options/heap/BaselineFileOption.js +1 -1
- package/dist/options/heap/FinalFileOption.d.ts +1 -1
- package/dist/options/heap/FinalFileOption.js +1 -1
- package/dist/options/heap/JSEngineOption.d.ts +1 -1
- package/dist/options/heap/JSEngineOption.js +1 -1
- package/dist/options/heap/LeakClusterSizeThresholdOption.d.ts +1 -1
- package/dist/options/heap/LeakClusterSizeThresholdOption.js +1 -1
- package/dist/options/heap/LogTraceAsClusterOption.d.ts +1 -1
- package/dist/options/heap/LogTraceAsClusterOption.js +1 -1
- package/dist/options/heap/OversizeThresholdOption.d.ts +1 -1
- package/dist/options/heap/OversizeThresholdOption.js +1 -1
- package/dist/options/heap/SnapshotDirectoryOption.d.ts +1 -1
- package/dist/options/heap/SnapshotDirectoryOption.js +1 -1
- package/dist/options/heap/SnapshotFileOption.d.ts +1 -1
- package/dist/options/heap/SnapshotFileOption.js +1 -1
- package/dist/options/heap/TargetFileOption.d.ts +1 -1
- package/dist/options/heap/TargetFileOption.js +1 -1
- package/dist/options/heap/TraceAllObjectsOption.d.ts +1 -1
- package/dist/options/heap/TraceAllObjectsOption.js +1 -1
- package/dist/options/heap/leak-filter/LeakFilterFileOption.d.ts +1 -1
- package/dist/options/heap/leak-filter/LeakFilterFileOption.js +1 -1
- package/dist/options/heap/leak-filter/examples/FilterLib.d.ts +1 -1
- package/dist/options/heap/leak-filter/examples/FilterLib.js +1 -1
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.d.ts +1 -1
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.js +1 -1
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.d.ts +1 -1
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.js +1 -1
- package/dist/options/lib/UniversalOptions.d.ts +1 -1
- package/dist/options/lib/UniversalOptions.js +1 -1
- package/dist/runner.d.ts +1 -1
- package/dist/runner.js +1 -1
- package/package.json +8 -6
package/bin/{memlab → memlab.js}
RENAMED
|
@@ -6,14 +6,16 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*
|
|
9
|
-
* @emails oncall+ws_labs
|
|
10
9
|
* @format
|
|
10
|
+
* @oncall ws_labs
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// eslint-disable-next-line no-var
|
|
14
|
+
var cli = require('../dist/index');
|
|
14
15
|
|
|
15
16
|
// register the `@memlab/cli` package info
|
|
16
17
|
// so that `memlab version` get use the info
|
|
17
|
-
|
|
18
|
+
// eslint-disable-next-line fb-www/promise-termination
|
|
19
|
+
cli.registerPackage().then(() => {
|
|
18
20
|
cli.run();
|
|
19
21
|
});
|
package/dist/BaseCommand.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions, Nullable } from '@memlab/core';
|
|
11
11
|
import { BaseOption } from '@memlab/core';
|
package/dist/BaseCommand.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/dist/CommandLoader.d.ts
CHANGED
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import BaseCommand from './BaseCommand';
|
|
11
11
|
export default class CommandLoader {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
protected isLoaded: boolean;
|
|
13
|
+
protected OSSModules: Map<string, BaseCommand>;
|
|
14
|
+
protected modules: Map<string, BaseCommand>;
|
|
15
|
+
protected modulePaths: Map<string, string>;
|
|
16
16
|
getModules(): Map<string, BaseCommand>;
|
|
17
17
|
getModulePaths(): Map<string, string>;
|
|
18
18
|
registerCommands(): void;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
protected shouldRegisterCommand(command: BaseCommand): boolean;
|
|
20
|
+
protected registerCommandsFromDir(modulesDir: string): void;
|
|
21
|
+
protected postRegistration(): void;
|
|
21
22
|
}
|
|
22
23
|
//# sourceMappingURL=CommandLoader.d.ts.map
|
package/dist/CommandLoader.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -41,6 +41,10 @@ class CommandLoader {
|
|
|
41
41
|
this.registerCommandsFromDir(modulesDir);
|
|
42
42
|
this.postRegistration();
|
|
43
43
|
}
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
45
|
+
shouldRegisterCommand(command) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
44
48
|
registerCommandsFromDir(modulesDir) {
|
|
45
49
|
const moduleFiles = fs_1.default.readdirSync(modulesDir);
|
|
46
50
|
for (const moduleFile of moduleFiles) {
|
|
@@ -61,6 +65,9 @@ class CommandLoader {
|
|
|
61
65
|
if (!(moduleInstance instanceof BaseCommand_1.default)) {
|
|
62
66
|
core_1.utils.haltOrThrow('loading a command that does not extend BaseCommand');
|
|
63
67
|
}
|
|
68
|
+
if (!this.shouldRegisterCommand(moduleInstance)) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
64
71
|
const commandName = moduleInstance.getCommandName();
|
|
65
72
|
const loadingOssCommand = !core_1.fileManager.isWithinInternalDirectory(modulePath);
|
|
66
73
|
// reigster OSS commands
|
package/dist/Dispatcher.d.ts
CHANGED
|
@@ -4,22 +4,27 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
11
|
import type { AnyRecord, MemLabConfig } from '@memlab/core';
|
|
12
12
|
import BaseCommand from './BaseCommand';
|
|
13
|
+
import CommandLoader from './CommandLoader';
|
|
13
14
|
declare type RunCommandOptions = {
|
|
14
15
|
isPrerequisite?: boolean;
|
|
15
16
|
commandIndex?: number;
|
|
16
17
|
configFromOptions: AnyRecord;
|
|
17
18
|
};
|
|
18
|
-
declare
|
|
19
|
+
declare type CommandDispatcherOptions = {
|
|
20
|
+
commandLoader?: CommandLoader;
|
|
21
|
+
};
|
|
22
|
+
export declare class CommandDispatcher {
|
|
19
23
|
private modules;
|
|
20
24
|
private executedCommands;
|
|
21
25
|
private executingCommandStack;
|
|
22
|
-
constructor();
|
|
26
|
+
constructor(options?: CommandDispatcherOptions);
|
|
27
|
+
protected resetData(): void;
|
|
23
28
|
dispatch(args: ParsedArgs): Promise<void>;
|
|
24
29
|
parseOptions(command: BaseCommand, config: MemLabConfig, args: ParsedArgs): Promise<AnyRecord>;
|
|
25
30
|
private runCommand;
|
package/dist/Dispatcher.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -21,21 +21,27 @@ 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.CommandDispatcher = void 0;
|
|
24
25
|
const core_1 = require("@memlab/core");
|
|
25
26
|
const HelperCommand_1 = __importDefault(require("./commands/helper/HelperCommand"));
|
|
26
27
|
const UniversalOptions_1 = __importDefault(require("./options/lib/UniversalOptions"));
|
|
27
28
|
const CommandLoader_1 = __importDefault(require("./CommandLoader"));
|
|
28
29
|
const helperCommand = new HelperCommand_1.default();
|
|
29
30
|
class CommandDispatcher {
|
|
30
|
-
constructor() {
|
|
31
|
-
|
|
32
|
-
this.
|
|
31
|
+
constructor(options = {}) {
|
|
32
|
+
var _a;
|
|
33
|
+
this.resetData();
|
|
33
34
|
// auto load all command modules
|
|
34
|
-
const commandLoader = new CommandLoader_1.default();
|
|
35
|
+
const commandLoader = (_a = options.commandLoader) !== null && _a !== void 0 ? _a : new CommandLoader_1.default();
|
|
35
36
|
this.modules = commandLoader.getModules();
|
|
36
37
|
}
|
|
38
|
+
resetData() {
|
|
39
|
+
this.executedCommands = new Set();
|
|
40
|
+
this.executingCommandStack = [];
|
|
41
|
+
}
|
|
37
42
|
dispatch(args) {
|
|
38
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
this.resetData();
|
|
39
45
|
// triggered by `memlab` (without specific command)
|
|
40
46
|
if (!args._ || !(args._.length >= 1)) {
|
|
41
47
|
core_1.info.error('\n command argument missing');
|
|
@@ -121,7 +127,7 @@ class CommandDispatcher {
|
|
|
121
127
|
const subCommands = command.getSubCommands();
|
|
122
128
|
for (const subCommand of subCommands) {
|
|
123
129
|
if (subCommand.getCommandName() === args._[subCommandIndex]) {
|
|
124
|
-
this.runCommand(subCommand, args, runCmdOpt);
|
|
130
|
+
yield this.runCommand(subCommand, args, runCmdOpt);
|
|
125
131
|
return;
|
|
126
132
|
}
|
|
127
133
|
}
|
|
@@ -140,4 +146,5 @@ class CommandDispatcher {
|
|
|
140
146
|
});
|
|
141
147
|
}
|
|
142
148
|
}
|
|
149
|
+
exports.CommandDispatcher = CommandDispatcher;
|
|
143
150
|
exports.default = new CommandDispatcher();
|
package/dist/TypesThirdParty.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -53,7 +53,7 @@ class GetVersionCommand extends BaseCommand_1.default {
|
|
|
53
53
|
run(options) {
|
|
54
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
55
|
yield this.loadDepencyPackageInfo();
|
|
56
|
-
const packages = core_1.config.packageInfo;
|
|
56
|
+
const packages = [...core_1.config.packageInfo].sort((p1, p2) => p1.name < p2.name ? 1 : -1);
|
|
57
57
|
core_1.info.topLevel('');
|
|
58
58
|
for (const pkg of packages) {
|
|
59
59
|
const version = chalk_1.default.grey(`@${pkg.version}`);
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { BaseOption, CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand, { CommandCategory } from '../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand from '../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import { BaseOption } from '@memlab/core';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand, { CommandCategory } from '../../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -60,6 +60,7 @@ const LeakFilterFileOption_1 = __importDefault(require("../../options/heap/leak-
|
|
|
60
60
|
const LeakClusterSizeThresholdOption_1 = __importDefault(require("../../options/heap/LeakClusterSizeThresholdOption"));
|
|
61
61
|
const MLClusteringOption_1 = __importDefault(require("../../options/MLClusteringOption"));
|
|
62
62
|
const MLClusteringLinkageMaxDistanceOption_1 = __importDefault(require("../../options/MLClusteringLinkageMaxDistanceOption"));
|
|
63
|
+
const MLClusteringMaxDFOption_1 = __importDefault(require("../../options/MLClusteringMaxDFOption"));
|
|
63
64
|
class CheckLeakCommand extends BaseCommand_1.default {
|
|
64
65
|
getCommandName() {
|
|
65
66
|
return 'find-leaks';
|
|
@@ -87,6 +88,7 @@ class CheckLeakCommand extends BaseCommand_1.default {
|
|
|
87
88
|
new LogTraceAsClusterOption_1.default(),
|
|
88
89
|
new MLClusteringOption_1.default(),
|
|
89
90
|
new MLClusteringLinkageMaxDistanceOption_1.default(),
|
|
91
|
+
new MLClusteringMaxDFOption_1.default(),
|
|
90
92
|
];
|
|
91
93
|
}
|
|
92
94
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand, { CommandCategory } from '../../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand, { CommandCategory } from '../../BaseCommand';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { CLIOptions } from '@memlab/core';
|
|
11
11
|
import { BaseOption } from '@memlab/core';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
|
+
*/
|
|
10
|
+
import BaseCommand from '../../../BaseCommand';
|
|
11
|
+
import CommandLoader from '../../../CommandLoader';
|
|
12
|
+
export default class InteractiveCommandLoader extends CommandLoader {
|
|
13
|
+
protected shouldRegisterCommand(command: BaseCommand): boolean;
|
|
14
|
+
protected postRegistration(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=InteractiveCommandLoader.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
|
+
*/
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const CommandLoader_1 = __importDefault(require("../../../CommandLoader"));
|
|
16
|
+
const HelperCommand_1 = __importDefault(require("../../helper/HelperCommand"));
|
|
17
|
+
const GetRetainerTraceCommand_1 = __importDefault(require("../GetRetainerTraceCommand"));
|
|
18
|
+
const HeapAnalysisCommand_1 = __importDefault(require("../HeapAnalysisCommand"));
|
|
19
|
+
const commandToInclude = new Set([
|
|
20
|
+
HeapAnalysisCommand_1.default,
|
|
21
|
+
GetRetainerTraceCommand_1.default,
|
|
22
|
+
HelperCommand_1.default,
|
|
23
|
+
]);
|
|
24
|
+
class InteractiveCommandLoader extends CommandLoader_1.default {
|
|
25
|
+
shouldRegisterCommand(command) {
|
|
26
|
+
const constructor = command.constructor;
|
|
27
|
+
return commandToInclude.has(constructor);
|
|
28
|
+
}
|
|
29
|
+
postRegistration() {
|
|
30
|
+
// do nothing
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = InteractiveCommandLoader;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
|
+
*/
|
|
10
|
+
import { CLIOptions } from '@memlab/core';
|
|
11
|
+
import BaseCommand, { CommandCategory } from '../../../BaseCommand';
|
|
12
|
+
import { BaseOption } from '@memlab/core';
|
|
13
|
+
export default class InteractiveHeapCommand extends BaseCommand {
|
|
14
|
+
getCommandName(): string;
|
|
15
|
+
getDescription(): string;
|
|
16
|
+
getCategory(): CommandCategory;
|
|
17
|
+
getExamples(): string[];
|
|
18
|
+
getOptions(): BaseOption[];
|
|
19
|
+
private exitAttempt;
|
|
20
|
+
private printPromptInfo;
|
|
21
|
+
private quit;
|
|
22
|
+
private initPrompt;
|
|
23
|
+
private setupInterruptHandle;
|
|
24
|
+
private setupCommandHandle;
|
|
25
|
+
private startInteractiveCLI;
|
|
26
|
+
run(options: CLIOptions): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=InteractiveHeapCommand.d.ts.map
|