@memlab/cli 1.0.0
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 +11 -0
- package/bin/memlab +14 -0
- package/dist/BaseCommand.d.ts +37 -0
- package/dist/BaseCommand.d.ts.map +1 -0
- package/dist/BaseCommand.js +132 -0
- package/dist/Dispatcher.d.ts +35 -0
- package/dist/Dispatcher.d.ts.map +1 -0
- package/dist/Dispatcher.js +205 -0
- package/dist/TypesThirdParty.d.ts +17 -0
- package/dist/TypesThirdParty.d.ts.map +1 -0
- package/dist/TypesThirdParty.js +10 -0
- package/dist/commands/CleanLoggerDataCommand.d.ts +20 -0
- package/dist/commands/CleanLoggerDataCommand.d.ts.map +1 -0
- package/dist/commands/CleanLoggerDataCommand.js +50 -0
- package/dist/commands/CleanRunDataCommand.d.ts +20 -0
- package/dist/commands/CleanRunDataCommand.d.ts.map +1 -0
- package/dist/commands/CleanRunDataCommand.js +48 -0
- package/dist/commands/InitDirectoryCommand.d.ts +20 -0
- package/dist/commands/InitDirectoryCommand.d.ts.map +1 -0
- package/dist/commands/InitDirectoryCommand.js +48 -0
- package/dist/commands/ListScenariosCommand.d.ts +17 -0
- package/dist/commands/ListScenariosCommand.d.ts.map +1 -0
- package/dist/commands/ListScenariosCommand.js +51 -0
- package/dist/commands/MemLabRunCommand.d.ts +20 -0
- package/dist/commands/MemLabRunCommand.d.ts.map +1 -0
- package/dist/commands/MemLabRunCommand.js +66 -0
- package/dist/commands/PrintSummaryCommand.d.ts +20 -0
- package/dist/commands/PrintSummaryCommand.d.ts.map +1 -0
- package/dist/commands/PrintSummaryCommand.js +55 -0
- package/dist/commands/ResetDirectoryCommand.d.ts +19 -0
- package/dist/commands/ResetDirectoryCommand.d.ts.map +1 -0
- package/dist/commands/ResetDirectoryCommand.js +46 -0
- package/dist/commands/RunMeasureCommand.d.ts +20 -0
- package/dist/commands/RunMeasureCommand.d.ts.map +1 -0
- package/dist/commands/RunMeasureCommand.js +82 -0
- package/dist/commands/WarmupAppCommand.d.ts +20 -0
- package/dist/commands/WarmupAppCommand.d.ts.map +1 -0
- package/dist/commands/WarmupAppCommand.js +65 -0
- package/dist/commands/heap/CheckLeakCommand.d.ts +21 -0
- package/dist/commands/heap/CheckLeakCommand.d.ts.map +1 -0
- package/dist/commands/heap/CheckLeakCommand.js +94 -0
- package/dist/commands/heap/GetRetainerTraceCommand.d.ts +21 -0
- package/dist/commands/heap/GetRetainerTraceCommand.d.ts.map +1 -0
- package/dist/commands/heap/GetRetainerTraceCommand.js +92 -0
- package/dist/commands/heap/HeapAnalysisCommand.d.ts +21 -0
- package/dist/commands/heap/HeapAnalysisCommand.d.ts.map +1 -0
- package/dist/commands/heap/HeapAnalysisCommand.js +98 -0
- package/dist/commands/heap/HeapAnalysisSubCommandWrapper.d.ts +23 -0
- package/dist/commands/heap/HeapAnalysisSubCommandWrapper.d.ts.map +1 -0
- package/dist/commands/heap/HeapAnalysisSubCommandWrapper.js +68 -0
- package/dist/commands/helper/HelperCommand.d.ts +37 -0
- package/dist/commands/helper/HelperCommand.d.ts.map +1 -0
- package/dist/commands/helper/HelperCommand.js +262 -0
- package/dist/commands/helper/lib/CommandOrder.d.ts +13 -0
- package/dist/commands/helper/lib/CommandOrder.d.ts.map +1 -0
- package/dist/commands/helper/lib/CommandOrder.js +42 -0
- package/dist/commands/helper/lib/Types.d.ts +16 -0
- package/dist/commands/helper/lib/Types.d.ts.map +1 -0
- package/dist/commands/helper/lib/Types.js +11 -0
- package/dist/commands/query/QueryDefaultWorkDirCommand.d.ts +20 -0
- package/dist/commands/query/QueryDefaultWorkDirCommand.d.ts.map +1 -0
- package/dist/commands/query/QueryDefaultWorkDirCommand.js +67 -0
- package/dist/commands/snapshot/CheckXvfbSupportCommand.d.ts +18 -0
- package/dist/commands/snapshot/CheckXvfbSupportCommand.d.ts.map +1 -0
- package/dist/commands/snapshot/CheckXvfbSupportCommand.js +55 -0
- package/dist/commands/snapshot/Snapshot.d.ts +11 -0
- package/dist/commands/snapshot/Snapshot.d.ts.map +1 -0
- package/dist/commands/snapshot/Snapshot.js +47 -0
- package/dist/commands/snapshot/TakeSnapshotCommand.d.ts +20 -0
- package/dist/commands/snapshot/TakeSnapshotCommand.d.ts.map +1 -0
- package/dist/commands/snapshot/TakeSnapshotCommand.js +80 -0
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.d.ts +18 -0
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.d.ts.map +1 -0
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.js +49 -0
- package/dist/commands/test/BrowserTest.d.ts +11 -0
- package/dist/commands/test/BrowserTest.d.ts.map +1 -0
- package/dist/commands/test/BrowserTest.js +41 -0
- package/dist/commands/test/RunAllInteractionTestsCommand.d.ts +19 -0
- package/dist/commands/test/RunAllInteractionTestsCommand.d.ts.map +1 -0
- package/dist/commands/test/RunAllInteractionTestsCommand.js +71 -0
- package/dist/commands/test/RunInteractionTestCommand.d.ts +19 -0
- package/dist/commands/test/RunInteractionTestCommand.d.ts.map +1 -0
- package/dist/commands/test/RunInteractionTestCommand.js +75 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/options/AppOption.d.ts +19 -0
- package/dist/options/AppOption.d.ts.map +1 -0
- package/dist/options/AppOption.js +42 -0
- package/dist/options/DebugOption.d.ts +18 -0
- package/dist/options/DebugOption.d.ts.map +1 -0
- package/dist/options/DebugOption.js +37 -0
- package/dist/options/DisableXvfbOption.d.ts +18 -0
- package/dist/options/DisableXvfbOption.d.ts.map +1 -0
- package/dist/options/DisableXvfbOption.js +37 -0
- package/dist/options/FullExecutionOption.d.ts +18 -0
- package/dist/options/FullExecutionOption.d.ts.map +1 -0
- package/dist/options/FullExecutionOption.js +37 -0
- package/dist/options/HeapNodeIdOption.d.ts +19 -0
- package/dist/options/HeapNodeIdOption.d.ts.map +1 -0
- package/dist/options/HeapNodeIdOption.js +46 -0
- package/dist/options/HelperOption.d.ts +19 -0
- package/dist/options/HelperOption.d.ts.map +1 -0
- package/dist/options/HelperOption.js +39 -0
- package/dist/options/InteractionOption.d.ts +19 -0
- package/dist/options/InteractionOption.d.ts.map +1 -0
- package/dist/options/InteractionOption.js +42 -0
- package/dist/options/NumberOfRunsOption.d.ts +20 -0
- package/dist/options/NumberOfRunsOption.d.ts.map +1 -0
- package/dist/options/NumberOfRunsOption.js +44 -0
- package/dist/options/RemoteBrowserDebugOption.d.ts +18 -0
- package/dist/options/RemoteBrowserDebugOption.d.ts.map +1 -0
- package/dist/options/RemoteBrowserDebugOption.js +37 -0
- package/dist/options/RunningModeOption.d.ts +19 -0
- package/dist/options/RunningModeOption.d.ts.map +1 -0
- package/dist/options/RunningModeOption.js +40 -0
- package/dist/options/ScenarioFileOption.d.ts +19 -0
- package/dist/options/ScenarioFileOption.d.ts.map +1 -0
- package/dist/options/ScenarioFileOption.js +44 -0
- package/dist/options/SetContinuousTestOption.d.ts +18 -0
- package/dist/options/SetContinuousTestOption.d.ts.map +1 -0
- package/dist/options/SetContinuousTestOption.js +37 -0
- package/dist/options/SetDeviceOption.d.ts +19 -0
- package/dist/options/SetDeviceOption.d.ts.map +1 -0
- package/dist/options/SetDeviceOption.js +46 -0
- package/dist/options/SetWorkingDirectoryOption.d.ts +20 -0
- package/dist/options/SetWorkingDirectoryOption.d.ts.map +1 -0
- package/dist/options/SetWorkingDirectoryOption.js +40 -0
- package/dist/options/SilentOption.d.ts +19 -0
- package/dist/options/SilentOption.d.ts.map +1 -0
- package/dist/options/SilentOption.js +40 -0
- package/dist/options/SkipExtraOperationOption.d.ts +18 -0
- package/dist/options/SkipExtraOperationOption.d.ts.map +1 -0
- package/dist/options/SkipExtraOperationOption.js +37 -0
- package/dist/options/SkipGCOption.d.ts +18 -0
- package/dist/options/SkipGCOption.d.ts.map +1 -0
- package/dist/options/SkipGCOption.js +37 -0
- package/dist/options/SkipScreenshotOption.d.ts +18 -0
- package/dist/options/SkipScreenshotOption.d.ts.map +1 -0
- package/dist/options/SkipScreenshotOption.js +37 -0
- package/dist/options/SkipScrollOption.d.ts +18 -0
- package/dist/options/SkipScrollOption.d.ts.map +1 -0
- package/dist/options/SkipScrollOption.js +37 -0
- package/dist/options/SkipSnapshotOption.d.ts +18 -0
- package/dist/options/SkipSnapshotOption.d.ts.map +1 -0
- package/dist/options/SkipSnapshotOption.js +37 -0
- package/dist/options/SkipWarmupOption.d.ts +18 -0
- package/dist/options/SkipWarmupOption.d.ts.map +1 -0
- package/dist/options/SkipWarmupOption.js +37 -0
- package/dist/options/VerboseOption.d.ts +19 -0
- package/dist/options/VerboseOption.d.ts.map +1 -0
- package/dist/options/VerboseOption.js +40 -0
- package/dist/options/heap/BaselineFileOption.d.ts +18 -0
- package/dist/options/heap/BaselineFileOption.d.ts.map +1 -0
- package/dist/options/heap/BaselineFileOption.js +53 -0
- package/dist/options/heap/FinalFileOption.d.ts +18 -0
- package/dist/options/heap/FinalFileOption.d.ts.map +1 -0
- package/dist/options/heap/FinalFileOption.js +53 -0
- package/dist/options/heap/JSEngineOption.d.ts +18 -0
- package/dist/options/heap/JSEngineOption.d.ts.map +1 -0
- package/dist/options/heap/JSEngineOption.js +46 -0
- package/dist/options/heap/LogTraceAsClusterOption.d.ts +18 -0
- package/dist/options/heap/LogTraceAsClusterOption.d.ts.map +1 -0
- package/dist/options/heap/LogTraceAsClusterOption.js +37 -0
- package/dist/options/heap/OversizeThresholdOption.d.ts +19 -0
- package/dist/options/heap/OversizeThresholdOption.d.ts.map +1 -0
- package/dist/options/heap/OversizeThresholdOption.js +45 -0
- package/dist/options/heap/SnapshotDirectoryOption.d.ts +18 -0
- package/dist/options/heap/SnapshotDirectoryOption.d.ts.map +1 -0
- package/dist/options/heap/SnapshotDirectoryOption.js +50 -0
- package/dist/options/heap/SnapshotFileOption.d.ts +18 -0
- package/dist/options/heap/SnapshotFileOption.d.ts.map +1 -0
- package/dist/options/heap/SnapshotFileOption.js +50 -0
- package/dist/options/heap/TargetFileOption.d.ts +18 -0
- package/dist/options/heap/TargetFileOption.d.ts.map +1 -0
- package/dist/options/heap/TargetFileOption.js +53 -0
- package/dist/options/heap/TraceAllObjectsOption.d.ts +18 -0
- package/dist/options/heap/TraceAllObjectsOption.d.ts.map +1 -0
- package/dist/options/heap/TraceAllObjectsOption.js +38 -0
- package/dist/options/heap/leak-filter/LeakFilterFileOption.d.ts +19 -0
- package/dist/options/heap/leak-filter/LeakFilterFileOption.d.ts.map +1 -0
- package/dist/options/heap/leak-filter/LeakFilterFileOption.js +41 -0
- package/dist/options/heap/leak-filter/examples/FilterLib.d.ts +12 -0
- package/dist/options/heap/leak-filter/examples/FilterLib.d.ts.map +1 -0
- package/dist/options/heap/leak-filter/examples/FilterLib.js +30 -0
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.d.ts +13 -0
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.d.ts.map +1 -0
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.js +30 -0
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.d.ts +16 -0
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.d.ts.map +1 -0
- package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.js +28 -0
- package/dist/options/heap/leak-filter/examples/large-object-as-leak.example.d.ts +3 -0
- package/dist/options/heap/leak-filter/examples/large-object-as-leak.example.d.ts.map +1 -0
- package/dist/options/heap/leak-filter/examples/large-object-as-leak.example.js +13 -0
- package/dist/runner.d.ts +11 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +38 -0
- package/package.json +59 -0
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import { BaseOption, MemLabConfig } from '@memlab/core';
|
|
12
|
+
export default class FinalFileOption extends BaseOption {
|
|
13
|
+
getOptionName(): string;
|
|
14
|
+
getDescription(): string;
|
|
15
|
+
getExampleValues(): string[];
|
|
16
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=FinalFileOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FinalFileOption.d.ts","sourceRoot":"","sources":["../../../src/options/heap/FinalFileOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAC,UAAU,EAAE,YAAY,EAAQ,MAAM,cAAc,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IACrD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAcnE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
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
|
+
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
const fs_1 = __importDefault(require("fs"));
|
|
25
|
+
const core_1 = require("@memlab/core");
|
|
26
|
+
class FinalFileOption extends core_1.BaseOption {
|
|
27
|
+
getOptionName() {
|
|
28
|
+
return 'final';
|
|
29
|
+
}
|
|
30
|
+
getDescription() {
|
|
31
|
+
return 'set file path of the final heap snapshot';
|
|
32
|
+
}
|
|
33
|
+
getExampleValues() {
|
|
34
|
+
return ['/tmp/final.heapsnapshot'];
|
|
35
|
+
}
|
|
36
|
+
parse(config, args) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (!args.final) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const file = args.final;
|
|
42
|
+
if (!fs_1.default.existsSync(file)) {
|
|
43
|
+
core_1.utils.haltOrThrow(`Invalid snapshot file: ${file}`);
|
|
44
|
+
}
|
|
45
|
+
config.useExternalSnapshot = true;
|
|
46
|
+
if (!config.externalSnapshotFilePaths) {
|
|
47
|
+
config.externalSnapshotFilePaths = [];
|
|
48
|
+
}
|
|
49
|
+
config.externalSnapshotFilePaths[2] = file;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = FinalFileOption;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import { BaseOption, MemLabConfig } from '@memlab/core';
|
|
12
|
+
export default class JSEngineOption extends BaseOption {
|
|
13
|
+
getOptionName(): string;
|
|
14
|
+
getDescription(): string;
|
|
15
|
+
getExampleValues(): string[];
|
|
16
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=JSEngineOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSEngineOption.d.ts","sourceRoot":"","sources":["../../../src/options/heap/JSEngineOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAC,UAAU,EAAE,YAAY,EAAkB,MAAM,cAAc,CAAC;AAEvE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU;IACpD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAanE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
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
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const core_1 = require("@memlab/core");
|
|
22
|
+
class JSEngineOption extends core_1.BaseOption {
|
|
23
|
+
getOptionName() {
|
|
24
|
+
return 'engine';
|
|
25
|
+
}
|
|
26
|
+
getDescription() {
|
|
27
|
+
return 'set the JavaScript engine (default to v8)';
|
|
28
|
+
}
|
|
29
|
+
getExampleValues() {
|
|
30
|
+
return ['v8', 'hermes'];
|
|
31
|
+
}
|
|
32
|
+
parse(config, args) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (!args.engine) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
config.jsEngine = args.engine;
|
|
38
|
+
config.specifiedEngine = true;
|
|
39
|
+
if (core_1.constant.supportedEngines.indexOf(config.jsEngine) < 0) {
|
|
40
|
+
core_1.utils.haltOrThrow(`Invalid engine: ${config.jsEngine} ` +
|
|
41
|
+
`(supported engines: ${core_1.constant.supportedEngines.join(', ')})`);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.default = JSEngineOption;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import type { MemLabConfig } from '@memlab/core';
|
|
12
|
+
import { BaseOption } from '@memlab/core';
|
|
13
|
+
export default class LogTraceAsClusterOption extends BaseOption {
|
|
14
|
+
getOptionName(): string;
|
|
15
|
+
getDescription(): string;
|
|
16
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=LogTraceAsClusterOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogTraceAsClusterOption.d.ts","sourceRoot":"","sources":["../../../src/options/heap/LogTraceAsClusterOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU;IAC7D,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIlB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAKnE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
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
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const core_1 = require("@memlab/core");
|
|
22
|
+
class LogTraceAsClusterOption extends core_1.BaseOption {
|
|
23
|
+
getOptionName() {
|
|
24
|
+
return 'save-trace-as-unclassified-cluster';
|
|
25
|
+
}
|
|
26
|
+
getDescription() {
|
|
27
|
+
return 'dump each retainer trace as an unclassified trace cluster';
|
|
28
|
+
}
|
|
29
|
+
parse(config, args) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
if (args[this.getOptionName()]) {
|
|
32
|
+
config.logUnclassifiedClusters = true;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = LogTraceAsClusterOption;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import type { MemLabConfig } from '@memlab/core';
|
|
12
|
+
import { BaseOption } from '@memlab/core';
|
|
13
|
+
export default class OversizeThresholdOption extends BaseOption {
|
|
14
|
+
getOptionName(): string;
|
|
15
|
+
getDescription(): string;
|
|
16
|
+
getExampleValues(): string[];
|
|
17
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=OversizeThresholdOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OversizeThresholdOption.d.ts","sourceRoot":"","sources":["../../../src/options/heap/OversizeThresholdOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU;IAC7D,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAOxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CASnE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
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
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const core_1 = require("@memlab/core");
|
|
22
|
+
class OversizeThresholdOption extends core_1.BaseOption {
|
|
23
|
+
getOptionName() {
|
|
24
|
+
return 'oversize-threshold';
|
|
25
|
+
}
|
|
26
|
+
getDescription() {
|
|
27
|
+
return ('set oversize threshold (in bytes), objects with retained size ' +
|
|
28
|
+
'bigger than the threshold will be considered as leaks');
|
|
29
|
+
}
|
|
30
|
+
getExampleValues() {
|
|
31
|
+
return ['1000', '1000000'];
|
|
32
|
+
}
|
|
33
|
+
parse(config, args) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (args[this.getOptionName()]) {
|
|
36
|
+
const sizeThreshold = parseInt(args[this.getOptionName()], 10);
|
|
37
|
+
if (!isNaN(sizeThreshold)) {
|
|
38
|
+
config.oversizeObjectAsLeak = true;
|
|
39
|
+
config.oversizeThreshold = sizeThreshold;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = OversizeThresholdOption;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import { BaseOption, MemLabConfig } from '@memlab/core';
|
|
12
|
+
export default class SnapshotDirectoryOption extends BaseOption {
|
|
13
|
+
getOptionName(): string;
|
|
14
|
+
getDescription(): string;
|
|
15
|
+
getExampleValues(): string[];
|
|
16
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=SnapshotDirectoryOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnapshotDirectoryOption.d.ts","sourceRoot":"","sources":["../../../src/options/heap/SnapshotDirectoryOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAC,UAAU,EAAE,YAAY,EAAQ,MAAM,cAAc,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU;IAC7D,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAWnE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
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
|
+
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
const fs_1 = __importDefault(require("fs"));
|
|
25
|
+
const core_1 = require("@memlab/core");
|
|
26
|
+
class SnapshotDirectoryOption extends core_1.BaseOption {
|
|
27
|
+
getOptionName() {
|
|
28
|
+
return 'snapshot-dir';
|
|
29
|
+
}
|
|
30
|
+
getDescription() {
|
|
31
|
+
return 'set directory path containing all heap snapshots under analysis';
|
|
32
|
+
}
|
|
33
|
+
getExampleValues() {
|
|
34
|
+
return ['/tmp/snapshots/'];
|
|
35
|
+
}
|
|
36
|
+
parse(config, args) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (!args['snapshot-dir']) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const dir = args['snapshot-dir'];
|
|
42
|
+
if (!fs_1.default.existsSync(dir)) {
|
|
43
|
+
core_1.utils.haltOrThrow(`Invalid directory: ${dir}`);
|
|
44
|
+
}
|
|
45
|
+
config.externalSnapshotDir = dir;
|
|
46
|
+
config.useExternalSnapshot = true;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.default = SnapshotDirectoryOption;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import { BaseOption, MemLabConfig } from '@memlab/core';
|
|
12
|
+
export default class SnapshotFileOption extends BaseOption {
|
|
13
|
+
getOptionName(): string;
|
|
14
|
+
getDescription(): string;
|
|
15
|
+
getExampleValues(): string[];
|
|
16
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=SnapshotFileOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnapshotFileOption.d.ts","sourceRoot":"","sources":["../../../src/options/heap/SnapshotFileOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAC,UAAU,EAAE,YAAY,EAAQ,MAAM,cAAc,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU;IACxD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAWnE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
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
|
+
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
const fs_1 = __importDefault(require("fs"));
|
|
25
|
+
const core_1 = require("@memlab/core");
|
|
26
|
+
class SnapshotFileOption extends core_1.BaseOption {
|
|
27
|
+
getOptionName() {
|
|
28
|
+
return 'snapshot';
|
|
29
|
+
}
|
|
30
|
+
getDescription() {
|
|
31
|
+
return 'set file path of the heap snapshot under analysis';
|
|
32
|
+
}
|
|
33
|
+
getExampleValues() {
|
|
34
|
+
return ['/tmp/file.heapsnapshot'];
|
|
35
|
+
}
|
|
36
|
+
parse(config, args) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (!args.snapshot) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const file = args.snapshot;
|
|
42
|
+
if (!fs_1.default.existsSync(file)) {
|
|
43
|
+
core_1.utils.haltOrThrow(`Invalid snapshot file: ${file}`);
|
|
44
|
+
}
|
|
45
|
+
config.useExternalSnapshot = true;
|
|
46
|
+
config.externalSnapshotFilePaths[0] = file;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.default = SnapshotFileOption;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import { BaseOption, MemLabConfig } from '@memlab/core';
|
|
12
|
+
export default class TargetFileOption extends BaseOption {
|
|
13
|
+
getOptionName(): string;
|
|
14
|
+
getDescription(): string;
|
|
15
|
+
getExampleValues(): string[];
|
|
16
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=TargetFileOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TargetFileOption.d.ts","sourceRoot":"","sources":["../../../src/options/heap/TargetFileOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAC,UAAU,EAAE,YAAY,EAAQ,MAAM,cAAc,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU;IACtD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAcnE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
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
|
+
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
const fs_1 = __importDefault(require("fs"));
|
|
25
|
+
const core_1 = require("@memlab/core");
|
|
26
|
+
class TargetFileOption extends core_1.BaseOption {
|
|
27
|
+
getOptionName() {
|
|
28
|
+
return 'target';
|
|
29
|
+
}
|
|
30
|
+
getDescription() {
|
|
31
|
+
return 'set file path of the target heap snapshot';
|
|
32
|
+
}
|
|
33
|
+
getExampleValues() {
|
|
34
|
+
return ['/tmp/target.heapsnapshot'];
|
|
35
|
+
}
|
|
36
|
+
parse(config, args) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (!args.target) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const file = args.target;
|
|
42
|
+
if (!fs_1.default.existsSync(file)) {
|
|
43
|
+
core_1.utils.haltOrThrow(`Invalid snapshot file: ${file}`);
|
|
44
|
+
}
|
|
45
|
+
config.useExternalSnapshot = true;
|
|
46
|
+
if (!config.externalSnapshotFilePaths) {
|
|
47
|
+
config.externalSnapshotFilePaths = [];
|
|
48
|
+
}
|
|
49
|
+
config.externalSnapshotFilePaths[1] = file;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = TargetFileOption;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import type { MemLabConfig } from '@memlab/core';
|
|
12
|
+
import { BaseOption } from '@memlab/core';
|
|
13
|
+
export default class TraceAllObjectsOption extends BaseOption {
|
|
14
|
+
getOptionName(): string;
|
|
15
|
+
getDescription(): string;
|
|
16
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=TraceAllObjectsOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraceAllObjectsOption.d.ts","sourceRoot":"","sources":["../../../src/options/heap/TraceAllObjectsOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,UAAU;IAC3D,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIlB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAMnE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
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
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const core_1 = require("@memlab/core");
|
|
22
|
+
class TraceAllObjectsOption extends core_1.BaseOption {
|
|
23
|
+
getOptionName() {
|
|
24
|
+
return 'trace-all-objects';
|
|
25
|
+
}
|
|
26
|
+
getDescription() {
|
|
27
|
+
return 'dump retainer trace for all allocated objects (ignore the leak filter)';
|
|
28
|
+
}
|
|
29
|
+
parse(config, args) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
if (args[this.getOptionName()]) {
|
|
32
|
+
config.oversizeObjectAsLeak = true;
|
|
33
|
+
config.oversizeThreshold = 0;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = TraceAllObjectsOption;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import type { MemLabConfig } from '@memlab/core';
|
|
12
|
+
import { BaseOption } from '@memlab/core';
|
|
13
|
+
export default class LeakFilterFileOption extends BaseOption {
|
|
14
|
+
getOptionName(): string;
|
|
15
|
+
getDescription(): string;
|
|
16
|
+
getExampleValues(): string[];
|
|
17
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=LeakFilterFileOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LeakFilterFileOption.d.ts","sourceRoot":"","sources":["../../../../src/options/heap/leak-filter/LeakFilterFileOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAQ,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,UAAU;IAC1D,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAMnE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
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
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const core_1 = require("@memlab/core");
|
|
22
|
+
class LeakFilterFileOption extends core_1.BaseOption {
|
|
23
|
+
getOptionName() {
|
|
24
|
+
return 'leak-filter';
|
|
25
|
+
}
|
|
26
|
+
getDescription() {
|
|
27
|
+
return 'specify a definition JS file for leak filter';
|
|
28
|
+
}
|
|
29
|
+
getExampleValues() {
|
|
30
|
+
return ['/tmp/leak-filter.js'];
|
|
31
|
+
}
|
|
32
|
+
parse(config, args) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (args[this.getOptionName()]) {
|
|
35
|
+
const file = args[this.getOptionName()];
|
|
36
|
+
config.externalLeakFilter = core_1.utils.loadLeakFilter(file);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = LeakFilterFileOption;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import { IHeapSnapshot } from '@memlab/core';
|
|
11
|
+
export declare function initMap(snapshot: IHeapSnapshot): Record<string, number>;
|
|
12
|
+
//# sourceMappingURL=FilterLib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterLib.d.ts","sourceRoot":"","sources":["../../../../../src/options/heap/leak-filter/examples/FilterLib.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,aAAa,EAAQ,MAAM,cAAc,CAAC;AAElD,wBAAgB,OAAO,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcvE"}
|