@memlab/cli 1.0.24 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseCommand.d.ts +3 -3
- package/dist/BaseCommand.js +5 -1
- package/dist/Dispatcher.js +6 -0
- package/dist/commands/MemLabRunCommand.d.ts +2 -2
- package/dist/commands/RunMeasureCommand.d.ts +2 -2
- package/dist/commands/RunMeasureCommand.js +2 -0
- package/dist/commands/WarmupAppCommand.d.ts +2 -2
- package/dist/commands/WarmupAppCommand.js +2 -0
- package/dist/commands/heap/CheckLeakCommand.d.ts +2 -1
- package/dist/commands/heap/CheckLeakCommand.js +44 -5
- package/dist/commands/heap/DiffLeakCommand.d.ts +13 -1
- package/dist/commands/heap/DiffLeakCommand.js +44 -14
- package/dist/commands/heap/GetRetainerTraceCommand.d.ts +2 -2
- package/dist/commands/heap/HeapAnalysisCommand.d.ts +2 -2
- package/dist/commands/heap/interactive/InteractiveHeapCommand.d.ts +2 -2
- package/dist/commands/heap/interactive/InteractiveHeapExploreCommand.d.ts +2 -2
- package/dist/commands/heap/interactive/ui-components/HeapViewUtils.d.ts +2 -0
- package/dist/commands/heap/interactive/ui-components/HeapViewUtils.js +25 -21
- package/dist/commands/heap/interactive/ui-components/ListComponent.js +1 -1
- package/dist/commands/helper/GenerateCLIDocCommand.js +10 -7
- package/dist/commands/helper/HelperCommand.d.ts +7 -4
- package/dist/commands/helper/HelperCommand.js +17 -13
- package/dist/commands/helper/lib/DocUtils.d.ts +19 -0
- package/dist/commands/helper/lib/DocUtils.js +39 -0
- package/dist/commands/snapshot/TakeSnapshotCommand.d.ts +2 -2
- package/dist/commands/snapshot/TakeSnapshotCommand.js +2 -0
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.d.ts +3 -1
- package/dist/commands/snapshot/WarmupAndSnapshotCommand.js +23 -0
- package/dist/lib/CLIUtils.js +15 -2
- package/dist/options/SetMaxClusterSampleSizeOption.d.ts +19 -0
- package/dist/options/SetMaxClusterSampleSizeOption.js +49 -0
- package/dist/options/e2e/SetChromiumBinaryOption.d.ts +18 -0
- package/dist/options/e2e/SetChromiumBinaryOption.js +43 -0
- package/dist/options/experiment/ExperimentOptionUtils.d.ts +13 -0
- package/dist/options/experiment/ExperimentOptionUtils.js +39 -0
- package/dist/options/experiment/SetControlWorkDirOption.d.ts +3 -4
- package/dist/options/experiment/SetControlWorkDirOption.js +3 -25
- package/dist/options/experiment/SetTreatmentWorkDirOption.d.ts +2 -2
- package/dist/options/experiment/SetTreatmentWorkDirOption.js +4 -13
- package/dist/options/heap/SetTraceContainsFilterOption.d.ts +18 -0
- package/dist/options/heap/SetTraceContainsFilterOption.js +42 -0
- package/dist/options/heap/TraceAllObjectsOption.d.ts +4 -2
- package/dist/options/heap/TraceAllObjectsOption.js +26 -4
- package/dist/options/lib/OptionConstant.d.ts +6 -0
- package/dist/options/lib/OptionConstant.js +3 -0
- package/package.json +1 -1
|
@@ -22,26 +22,48 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
const core_1 = require("@memlab/core");
|
|
25
|
+
const core_2 = require("@memlab/core");
|
|
25
26
|
const OptionConstant_1 = __importDefault(require("../lib/OptionConstant"));
|
|
26
27
|
const OversizeThresholdOption_1 = __importDefault(require("./OversizeThresholdOption"));
|
|
27
|
-
|
|
28
|
+
const optionMapping = new Map([
|
|
29
|
+
['selected-js-objects', core_2.TraceObjectMode.SelectedJSObjects],
|
|
30
|
+
['default', core_2.TraceObjectMode.Default],
|
|
31
|
+
]);
|
|
32
|
+
class TraceAllObjectsOption extends core_2.BaseOption {
|
|
28
33
|
getOptionName() {
|
|
29
34
|
return OptionConstant_1.default.optionNames.TRACE_ALL_OBJECTS;
|
|
30
35
|
}
|
|
31
36
|
getDescription() {
|
|
32
|
-
return 'dump retainer trace for all allocated objects (ignore the leak filter)'
|
|
37
|
+
return ('dump retainer trace for all allocated objects (ignore the leak filter), ' +
|
|
38
|
+
`available option modes: ${this.getAvailableOptions().join(', ')}`);
|
|
39
|
+
}
|
|
40
|
+
getAvailableOptions() {
|
|
41
|
+
return Array.from(optionMapping.keys()).map(mode => `--${this.getOptionName()}=${mode}`);
|
|
42
|
+
}
|
|
43
|
+
getMode(optionValue) {
|
|
44
|
+
// if the user specified an option value (--flag=value instead of --flag)
|
|
45
|
+
if (typeof optionValue === 'boolean') {
|
|
46
|
+
return optionMapping.get('default');
|
|
47
|
+
}
|
|
48
|
+
if (!optionMapping.has(optionValue)) {
|
|
49
|
+
throw core_1.utils.haltOrThrow(`Unknown option value ${optionValue}. ` +
|
|
50
|
+
`Available options: ${this.getAvailableOptions().join(', ')}`);
|
|
51
|
+
}
|
|
52
|
+
return optionMapping.get(optionValue);
|
|
33
53
|
}
|
|
34
54
|
parse(config, args) {
|
|
35
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
|
|
56
|
+
const optionValue = args[this.getOptionName()];
|
|
57
|
+
if (optionValue == null) {
|
|
37
58
|
return;
|
|
38
59
|
}
|
|
39
60
|
config.oversizeObjectAsLeak = true;
|
|
40
61
|
const overSizeOptionName = new OversizeThresholdOption_1.default().getOptionName();
|
|
41
|
-
//
|
|
62
|
+
// oversize option will set the oversize threshold
|
|
42
63
|
if (!args[overSizeOptionName]) {
|
|
43
64
|
config.oversizeThreshold = 0;
|
|
44
65
|
}
|
|
66
|
+
config.traceAllObjectsMode = this.getMode(optionValue);
|
|
45
67
|
});
|
|
46
68
|
}
|
|
47
69
|
}
|
|
@@ -14,6 +14,7 @@ declare const optionConstants: {
|
|
|
14
14
|
CLEAN_UP_SNAPSHOT: string;
|
|
15
15
|
CONTINUS_TEST: string;
|
|
16
16
|
CONTROL_WORK_DIR: string;
|
|
17
|
+
CHROMIUM_BINARY: string;
|
|
17
18
|
DEVICE: string;
|
|
18
19
|
DISABLE_WEB_SECURITY: string;
|
|
19
20
|
DISABLE_XVFB: string;
|
|
@@ -27,6 +28,7 @@ declare const optionConstants: {
|
|
|
27
28
|
LEAK_FILTER: string;
|
|
28
29
|
LOCAL_PUPPETEER: string;
|
|
29
30
|
LOG_SCRIPT: string;
|
|
31
|
+
MAX_CLUSTER_SAMPLE_SIZE: string;
|
|
30
32
|
ML_CLUSTERING: string;
|
|
31
33
|
ML_CLUSTERING_MAX_DF: string;
|
|
32
34
|
ML_LINKAGE_MAX_DIST: string;
|
|
@@ -49,6 +51,7 @@ declare const optionConstants: {
|
|
|
49
51
|
SNAPSHOT_DIR: string;
|
|
50
52
|
TARGET: string;
|
|
51
53
|
TRACE_ALL_OBJECTS: string;
|
|
54
|
+
TRACE_CONTAINS: string;
|
|
52
55
|
TRACE_OBJECT_SIZE_ABOVE: string;
|
|
53
56
|
TREATMENT_WORK_DIR: string;
|
|
54
57
|
USER_AGENT: string;
|
|
@@ -71,6 +74,7 @@ declare const _default: {
|
|
|
71
74
|
CLEAN_UP_SNAPSHOT: string;
|
|
72
75
|
CONTINUS_TEST: string;
|
|
73
76
|
CONTROL_WORK_DIR: string;
|
|
77
|
+
CHROMIUM_BINARY: string;
|
|
74
78
|
DEVICE: string;
|
|
75
79
|
DISABLE_WEB_SECURITY: string;
|
|
76
80
|
DISABLE_XVFB: string;
|
|
@@ -84,6 +88,7 @@ declare const _default: {
|
|
|
84
88
|
LEAK_FILTER: string;
|
|
85
89
|
LOCAL_PUPPETEER: string;
|
|
86
90
|
LOG_SCRIPT: string;
|
|
91
|
+
MAX_CLUSTER_SAMPLE_SIZE: string;
|
|
87
92
|
ML_CLUSTERING: string;
|
|
88
93
|
ML_CLUSTERING_MAX_DF: string;
|
|
89
94
|
ML_LINKAGE_MAX_DIST: string;
|
|
@@ -106,6 +111,7 @@ declare const _default: {
|
|
|
106
111
|
SNAPSHOT_DIR: string;
|
|
107
112
|
TARGET: string;
|
|
108
113
|
TRACE_ALL_OBJECTS: string;
|
|
114
|
+
TRACE_CONTAINS: string;
|
|
109
115
|
TRACE_OBJECT_SIZE_ABOVE: string;
|
|
110
116
|
TREATMENT_WORK_DIR: string;
|
|
111
117
|
USER_AGENT: string;
|
|
@@ -16,6 +16,7 @@ const optionNames = {
|
|
|
16
16
|
CLEAN_UP_SNAPSHOT: 'clean-up-snapshot',
|
|
17
17
|
CONTINUS_TEST: 'ContinuousTest',
|
|
18
18
|
CONTROL_WORK_DIR: 'control-work-dir',
|
|
19
|
+
CHROMIUM_BINARY: 'chromium-binary',
|
|
19
20
|
DEVICE: 'device',
|
|
20
21
|
DISABLE_WEB_SECURITY: 'disable-web-security',
|
|
21
22
|
DISABLE_XVFB: 'disable-xvfb',
|
|
@@ -29,6 +30,7 @@ const optionNames = {
|
|
|
29
30
|
LEAK_FILTER: 'leak-filter',
|
|
30
31
|
LOCAL_PUPPETEER: 'local-puppeteer',
|
|
31
32
|
LOG_SCRIPT: 'log-script',
|
|
33
|
+
MAX_CLUSTER_SAMPLE_SIZE: 'max-cluster-sample-size',
|
|
32
34
|
ML_CLUSTERING: 'ml-clustering',
|
|
33
35
|
ML_CLUSTERING_MAX_DF: 'ml-clustering-max-df',
|
|
34
36
|
ML_LINKAGE_MAX_DIST: 'ml-linkage-max-dist',
|
|
@@ -51,6 +53,7 @@ const optionNames = {
|
|
|
51
53
|
SNAPSHOT_DIR: 'snapshot-dir',
|
|
52
54
|
TARGET: 'target',
|
|
53
55
|
TRACE_ALL_OBJECTS: 'trace-all-objects',
|
|
56
|
+
TRACE_CONTAINS: 'trace-contains',
|
|
54
57
|
TRACE_OBJECT_SIZE_ABOVE: 'trace-object-size-above',
|
|
55
58
|
TREATMENT_WORK_DIR: 'treatment-work-dir',
|
|
56
59
|
USER_AGENT: 'user-agent',
|