@memlab/cli 1.0.21 → 1.0.22
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/commands/heap/CheckLeakCommand.d.ts +2 -2
- package/dist/commands/heap/CheckLeakCommand.js +12 -5
- package/dist/commands/heap/DiffLeakCommand.d.ts +21 -0
- package/dist/commands/heap/DiffLeakCommand.js +110 -0
- package/dist/commands/heap/interactive/ui-components/ListComponent.js +0 -1
- package/dist/options/SetWorkingDirectoryOption.d.ts +1 -1
- package/dist/options/SetWorkingDirectoryOption.js +3 -2
- package/dist/options/experiment/SetControlWorkDirOption.d.ts +20 -0
- package/dist/options/experiment/SetControlWorkDirOption.js +44 -0
- package/dist/options/experiment/SetTreatmentWorkDirOption.d.ts +20 -0
- package/dist/options/experiment/SetTreatmentWorkDirOption.js +44 -0
- package/dist/options/heap/CleanupSnapshotOption.d.ts +19 -0
- package/dist/options/heap/CleanupSnapshotOption.js +42 -0
- package/dist/options/lib/OptionConstant.d.ts +6 -0
- package/dist/options/lib/OptionConstant.js +3 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @format
|
|
8
8
|
* @oncall web_perf_infra
|
|
9
9
|
*/
|
|
10
|
-
import
|
|
10
|
+
import { CLIOptions } from '@memlab/core';
|
|
11
11
|
import BaseCommand, { CommandCategory } from '../../BaseCommand';
|
|
12
12
|
import { BaseOption } from '@memlab/core';
|
|
13
13
|
export default class CheckLeakCommand extends BaseCommand {
|
|
@@ -16,6 +16,6 @@ export default class CheckLeakCommand extends BaseCommand {
|
|
|
16
16
|
getCategory(): CommandCategory;
|
|
17
17
|
getPrerequisites(): BaseCommand[];
|
|
18
18
|
getOptions(): BaseOption[];
|
|
19
|
-
run(
|
|
19
|
+
run(options: CLIOptions): Promise<void>;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=CheckLeakCommand.d.ts.map
|
|
@@ -44,8 +44,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
44
44
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
45
45
|
};
|
|
46
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
-
const BaseCommand_1 = __importStar(require("../../BaseCommand"));
|
|
48
47
|
const core_1 = require("@memlab/core");
|
|
48
|
+
const BaseCommand_1 = __importStar(require("../../BaseCommand"));
|
|
49
|
+
const core_2 = require("@memlab/core");
|
|
49
50
|
const BaselineFileOption_1 = __importDefault(require("../../options/heap/BaselineFileOption"));
|
|
50
51
|
const FinalFileOption_1 = __importDefault(require("../../options/heap/FinalFileOption"));
|
|
51
52
|
const JSEngineOption_1 = __importDefault(require("../../options/heap/JSEngineOption"));
|
|
@@ -61,6 +62,7 @@ const LeakClusterSizeThresholdOption_1 = __importDefault(require("../../options/
|
|
|
61
62
|
const MLClusteringOption_1 = __importDefault(require("../../options/MLClusteringOption"));
|
|
62
63
|
const MLClusteringLinkageMaxDistanceOption_1 = __importDefault(require("../../options/MLClusteringLinkageMaxDistanceOption"));
|
|
63
64
|
const MLClusteringMaxDFOption_1 = __importDefault(require("../../options/MLClusteringMaxDFOption"));
|
|
65
|
+
const CleanupSnapshotOption_1 = __importDefault(require("../../options/heap/CleanupSnapshotOption"));
|
|
64
66
|
class CheckLeakCommand extends BaseCommand_1.default {
|
|
65
67
|
getCommandName() {
|
|
66
68
|
return 'find-leaks';
|
|
@@ -89,13 +91,18 @@ class CheckLeakCommand extends BaseCommand_1.default {
|
|
|
89
91
|
new MLClusteringOption_1.default(),
|
|
90
92
|
new MLClusteringLinkageMaxDistanceOption_1.default(),
|
|
91
93
|
new MLClusteringMaxDFOption_1.default(),
|
|
94
|
+
new CleanupSnapshotOption_1.default(),
|
|
92
95
|
];
|
|
93
96
|
}
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
run(options) {
|
|
98
|
+
var _a;
|
|
96
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
-
|
|
98
|
-
yield
|
|
100
|
+
core_2.config.chaseWeakMapEdge = false;
|
|
101
|
+
yield core_2.analysis.checkLeak();
|
|
102
|
+
const configFromOptions = (_a = options.configFromOptions) !== null && _a !== void 0 ? _a : {};
|
|
103
|
+
if (configFromOptions['cleanUpSnapshot']) {
|
|
104
|
+
core_1.fileManager.removeSnapshotFiles();
|
|
105
|
+
}
|
|
99
106
|
});
|
|
100
107
|
}
|
|
101
108
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 web_perf_infra
|
|
9
|
+
*/
|
|
10
|
+
import { CLIOptions } from '@memlab/core';
|
|
11
|
+
import BaseCommand, { CommandCategory } from '../../BaseCommand';
|
|
12
|
+
import { BaseOption } from '@memlab/core';
|
|
13
|
+
export default class CheckLeakCommand extends BaseCommand {
|
|
14
|
+
getCommandName(): string;
|
|
15
|
+
getDescription(): string;
|
|
16
|
+
getCategory(): CommandCategory;
|
|
17
|
+
getPrerequisites(): BaseCommand[];
|
|
18
|
+
getOptions(): BaseOption[];
|
|
19
|
+
run(options: CLIOptions): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=DiffLeakCommand.d.ts.map
|
|
@@ -0,0 +1,110 @@
|
|
|
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 web_perf_infra
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
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
|
+
};
|
|
34
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
37
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
38
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
39
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
40
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
44
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
const core_1 = require("@memlab/core");
|
|
48
|
+
const core_2 = require("@memlab/core");
|
|
49
|
+
const BaseCommand_1 = __importStar(require("../../BaseCommand"));
|
|
50
|
+
const core_3 = require("@memlab/core");
|
|
51
|
+
const JSEngineOption_1 = __importDefault(require("../../options/heap/JSEngineOption"));
|
|
52
|
+
const InitDirectoryCommand_1 = __importDefault(require("../InitDirectoryCommand"));
|
|
53
|
+
const OversizeThresholdOption_1 = __importDefault(require("../../options/heap/OversizeThresholdOption"));
|
|
54
|
+
const TraceAllObjectsOption_1 = __importDefault(require("../../options/heap/TraceAllObjectsOption"));
|
|
55
|
+
const LogTraceAsClusterOption_1 = __importDefault(require("../../options/heap/LogTraceAsClusterOption"));
|
|
56
|
+
const CleanLoggerDataCommand_1 = __importDefault(require("../CleanLoggerDataCommand"));
|
|
57
|
+
const LeakFilterFileOption_1 = __importDefault(require("../../options/heap/leak-filter/LeakFilterFileOption"));
|
|
58
|
+
const LeakClusterSizeThresholdOption_1 = __importDefault(require("../../options/heap/LeakClusterSizeThresholdOption"));
|
|
59
|
+
const MLClusteringOption_1 = __importDefault(require("../../options/MLClusteringOption"));
|
|
60
|
+
const MLClusteringLinkageMaxDistanceOption_1 = __importDefault(require("../../options/MLClusteringLinkageMaxDistanceOption"));
|
|
61
|
+
const MLClusteringMaxDFOption_1 = __importDefault(require("../../options/MLClusteringMaxDFOption"));
|
|
62
|
+
const SetControlWorkDirOption_1 = __importDefault(require("../../options/experiment/SetControlWorkDirOption"));
|
|
63
|
+
const SetTreatmentWorkDirOption_1 = __importDefault(require("../../options/experiment/SetTreatmentWorkDirOption"));
|
|
64
|
+
class CheckLeakCommand extends BaseCommand_1.default {
|
|
65
|
+
getCommandName() {
|
|
66
|
+
return 'diff-leaks';
|
|
67
|
+
}
|
|
68
|
+
getDescription() {
|
|
69
|
+
return 'find new memory leaks by diffing control and test heap snapshots';
|
|
70
|
+
}
|
|
71
|
+
getCategory() {
|
|
72
|
+
return BaseCommand_1.CommandCategory.COMMON;
|
|
73
|
+
}
|
|
74
|
+
getPrerequisites() {
|
|
75
|
+
return [new InitDirectoryCommand_1.default(), new CleanLoggerDataCommand_1.default()];
|
|
76
|
+
}
|
|
77
|
+
getOptions() {
|
|
78
|
+
return [
|
|
79
|
+
new SetControlWorkDirOption_1.default().required(),
|
|
80
|
+
new SetTreatmentWorkDirOption_1.default().required(),
|
|
81
|
+
new JSEngineOption_1.default(),
|
|
82
|
+
new LeakFilterFileOption_1.default(),
|
|
83
|
+
new OversizeThresholdOption_1.default(),
|
|
84
|
+
new LeakClusterSizeThresholdOption_1.default(),
|
|
85
|
+
new TraceAllObjectsOption_1.default(),
|
|
86
|
+
new LogTraceAsClusterOption_1.default(),
|
|
87
|
+
new MLClusteringOption_1.default(),
|
|
88
|
+
new MLClusteringLinkageMaxDistanceOption_1.default(),
|
|
89
|
+
new MLClusteringMaxDFOption_1.default(),
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
run(options) {
|
|
93
|
+
var _a, _b;
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
core_3.config.chaseWeakMapEdge = false;
|
|
96
|
+
// double check parameters
|
|
97
|
+
if (!((_a = options.configFromOptions) === null || _a === void 0 ? void 0 : _a.controlWorkDir) ||
|
|
98
|
+
!((_b = options.configFromOptions) === null || _b === void 0 ? void 0 : _b.treatmentWorkDir)) {
|
|
99
|
+
core_2.info.error('Please specify control and test working directory');
|
|
100
|
+
throw core_1.utils.haltOrThrow('No control or test working directory specified');
|
|
101
|
+
}
|
|
102
|
+
// get parameters
|
|
103
|
+
const controlWorkDir = options.configFromOptions['controlWorkDir'];
|
|
104
|
+
const treatmentWorkDir = options.configFromOptions['treatmentWorkDir'];
|
|
105
|
+
// diff memory leaks
|
|
106
|
+
yield core_3.analysis.diffLeakByWorkDir({ controlWorkDir, treatmentWorkDir });
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.default = CheckLeakCommand;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @oncall web_perf_infra
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
|
-
import
|
|
11
|
+
import { MemLabConfig } from '@memlab/core';
|
|
12
12
|
import { BaseOption } from '@memlab/core';
|
|
13
13
|
export default class SetWorkingDirectoryOption extends BaseOption {
|
|
14
14
|
getOptionName(): string;
|
|
@@ -34,8 +34,9 @@ class SetWorkingDirectoryOption extends core_1.BaseOption {
|
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
35
|
const name = this.getOptionName();
|
|
36
36
|
const ret = {};
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
const workDir = args[name];
|
|
38
|
+
if (workDir) {
|
|
39
|
+
ret.workDir = workDir;
|
|
39
40
|
}
|
|
40
41
|
return ret;
|
|
41
42
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
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 web_perf_infra
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import type { MemLabConfig } from '@memlab/core';
|
|
12
|
+
import { BaseOption } from '@memlab/core';
|
|
13
|
+
export default class SetControlWorkDirOption extends BaseOption {
|
|
14
|
+
getOptionName(): string;
|
|
15
|
+
getDescription(): string;
|
|
16
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<{
|
|
17
|
+
controlWorkDir?: string;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=SetControlWorkDirOption.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
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 web_perf_infra
|
|
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 core_1 = require("@memlab/core");
|
|
25
|
+
const OptionConstant_1 = __importDefault(require("../lib/OptionConstant"));
|
|
26
|
+
class SetControlWorkDirOption extends core_1.BaseOption {
|
|
27
|
+
getOptionName() {
|
|
28
|
+
return OptionConstant_1.default.optionNames.CONTROL_WORK_DIR;
|
|
29
|
+
}
|
|
30
|
+
getDescription() {
|
|
31
|
+
return 'set the working directory of the control run';
|
|
32
|
+
}
|
|
33
|
+
parse(config, args) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const name = this.getOptionName();
|
|
36
|
+
const ret = {};
|
|
37
|
+
if (args[name]) {
|
|
38
|
+
ret.controlWorkDir = args[name];
|
|
39
|
+
}
|
|
40
|
+
return ret;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = SetControlWorkDirOption;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 web_perf_infra
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import type { MemLabConfig } from '@memlab/core';
|
|
12
|
+
import { BaseOption } from '@memlab/core';
|
|
13
|
+
export default class SetTreatmentWorkDirOption extends BaseOption {
|
|
14
|
+
getOptionName(): string;
|
|
15
|
+
getDescription(): string;
|
|
16
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<{
|
|
17
|
+
treatmentWorkDir?: string;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=SetTreatmentWorkDirOption.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
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 web_perf_infra
|
|
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 core_1 = require("@memlab/core");
|
|
25
|
+
const OptionConstant_1 = __importDefault(require("../lib/OptionConstant"));
|
|
26
|
+
class SetTreatmentWorkDirOption extends core_1.BaseOption {
|
|
27
|
+
getOptionName() {
|
|
28
|
+
return OptionConstant_1.default.optionNames.TREATMENT_WORK_DIR;
|
|
29
|
+
}
|
|
30
|
+
getDescription() {
|
|
31
|
+
return 'set the working directory of the test (treatment) run';
|
|
32
|
+
}
|
|
33
|
+
parse(config, args) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const name = this.getOptionName();
|
|
36
|
+
const ret = {};
|
|
37
|
+
if (args[name]) {
|
|
38
|
+
ret.treatmentWorkDir = args[name];
|
|
39
|
+
}
|
|
40
|
+
return ret;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = SetTreatmentWorkDirOption;
|
|
@@ -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
|
+
* @format
|
|
8
|
+
* @oncall web_perf_infra
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import { BaseOption, MemLabConfig } from '@memlab/core';
|
|
12
|
+
export default class CleanupSnapshotOption extends BaseOption {
|
|
13
|
+
getOptionName(): string;
|
|
14
|
+
getDescription(): string;
|
|
15
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<{
|
|
16
|
+
cleanUpSnapshot: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=CleanupSnapshotOption.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
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 web_perf_infra
|
|
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 core_1 = require("@memlab/core");
|
|
25
|
+
const OptionConstant_1 = __importDefault(require("../lib/OptionConstant"));
|
|
26
|
+
class CleanupSnapshotOption extends core_1.BaseOption {
|
|
27
|
+
getOptionName() {
|
|
28
|
+
return OptionConstant_1.default.optionNames.CLEAN_UP_SNAPSHOT;
|
|
29
|
+
}
|
|
30
|
+
getDescription() {
|
|
31
|
+
return 'clean up heap snapshots after running';
|
|
32
|
+
}
|
|
33
|
+
parse(config, args) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const name = this.getOptionName();
|
|
36
|
+
return {
|
|
37
|
+
cleanUpSnapshot: !!args[name],
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.default = CleanupSnapshotOption;
|
|
@@ -11,7 +11,9 @@ declare const optionConstants: {
|
|
|
11
11
|
optionNames: {
|
|
12
12
|
APP: string;
|
|
13
13
|
BASELINE: string;
|
|
14
|
+
CLEAN_UP_SNAPSHOT: string;
|
|
14
15
|
CONTINUS_TEST: string;
|
|
16
|
+
CONTROL_WORK_DIR: string;
|
|
15
17
|
DEVICE: string;
|
|
16
18
|
DISABLE_WEB_SECURITY: string;
|
|
17
19
|
DISABLE_XVFB: string;
|
|
@@ -48,6 +50,7 @@ declare const optionConstants: {
|
|
|
48
50
|
TARGET: string;
|
|
49
51
|
TRACE_ALL_OBJECTS: string;
|
|
50
52
|
TRACE_OBJECT_SIZE_ABOVE: string;
|
|
53
|
+
TREATMENT_WORK_DIR: string;
|
|
51
54
|
USER_AGENT: string;
|
|
52
55
|
VERBOSE: string;
|
|
53
56
|
WORK_DIR: string;
|
|
@@ -64,7 +67,9 @@ declare const _default: {
|
|
|
64
67
|
optionNames: {
|
|
65
68
|
APP: string;
|
|
66
69
|
BASELINE: string;
|
|
70
|
+
CLEAN_UP_SNAPSHOT: string;
|
|
67
71
|
CONTINUS_TEST: string;
|
|
72
|
+
CONTROL_WORK_DIR: string;
|
|
68
73
|
DEVICE: string;
|
|
69
74
|
DISABLE_WEB_SECURITY: string;
|
|
70
75
|
DISABLE_XVFB: string;
|
|
@@ -101,6 +106,7 @@ declare const _default: {
|
|
|
101
106
|
TARGET: string;
|
|
102
107
|
TRACE_ALL_OBJECTS: string;
|
|
103
108
|
TRACE_OBJECT_SIZE_ABOVE: string;
|
|
109
|
+
TREATMENT_WORK_DIR: string;
|
|
104
110
|
USER_AGENT: string;
|
|
105
111
|
VERBOSE: string;
|
|
106
112
|
WORK_DIR: string;
|
|
@@ -13,7 +13,9 @@ const core_1 = require("@memlab/core");
|
|
|
13
13
|
const optionNames = {
|
|
14
14
|
APP: 'app',
|
|
15
15
|
BASELINE: 'baseline',
|
|
16
|
+
CLEAN_UP_SNAPSHOT: 'clean-up-snapshot',
|
|
16
17
|
CONTINUS_TEST: 'ContinuousTest',
|
|
18
|
+
CONTROL_WORK_DIR: 'control-work-dir',
|
|
17
19
|
DEVICE: 'device',
|
|
18
20
|
DISABLE_WEB_SECURITY: 'disable-web-security',
|
|
19
21
|
DISABLE_XVFB: 'disable-xvfb',
|
|
@@ -50,6 +52,7 @@ const optionNames = {
|
|
|
50
52
|
TARGET: 'target',
|
|
51
53
|
TRACE_ALL_OBJECTS: 'trace-all-objects',
|
|
52
54
|
TRACE_OBJECT_SIZE_ABOVE: 'trace-object-size-above',
|
|
55
|
+
TREATMENT_WORK_DIR: 'treatment-work-dir',
|
|
53
56
|
USER_AGENT: 'user-agent',
|
|
54
57
|
VERBOSE: 'verbose',
|
|
55
58
|
WORK_DIR: 'work-dir',
|