@memlab/core 1.1.12 → 1.1.16

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.
Files changed (123) hide show
  1. package/README.md +2 -2
  2. package/dist/__tests__/parser/HeapParser.test.d.ts +1 -1
  3. package/dist/__tests__/parser/HeapParser.test.js +2 -2
  4. package/dist/__tests__/parser/NodeHeap.test.d.ts +1 -1
  5. package/dist/__tests__/parser/NodeHeap.test.js +1 -1
  6. package/dist/__tests__/parser/StringNode.test.d.ts +1 -1
  7. package/dist/__tests__/parser/StringNode.test.js +1 -1
  8. package/dist/__tests__/parser/traverse/HeapNodeTraverse.test.d.ts +1 -1
  9. package/dist/__tests__/parser/traverse/HeapNodeTraverse.test.js +1 -1
  10. package/dist/__tests__/utils/utils.test.d.ts +1 -1
  11. package/dist/__tests__/utils/utils.test.js +1 -1
  12. package/dist/index.d.ts +5 -1
  13. package/dist/index.js +7 -2
  14. package/dist/lib/BaseOption.d.ts +1 -1
  15. package/dist/lib/BaseOption.js +1 -1
  16. package/dist/lib/BrowserInfo.d.ts +1 -1
  17. package/dist/lib/BrowserInfo.js +1 -1
  18. package/dist/lib/Config.d.ts +11 -2
  19. package/dist/lib/Config.js +36 -3
  20. package/dist/lib/Console.d.ts +1 -1
  21. package/dist/lib/Console.js +1 -1
  22. package/dist/lib/Constant.d.ts +1 -1
  23. package/dist/lib/Constant.js +1 -1
  24. package/dist/lib/FileManager.d.ts +5 -3
  25. package/dist/lib/FileManager.js +13 -5
  26. package/dist/lib/HeapAnalyzer.d.ts +1 -1
  27. package/dist/lib/HeapAnalyzer.js +1 -1
  28. package/dist/lib/HeapParser.d.ts +1 -1
  29. package/dist/lib/HeapParser.js +1 -1
  30. package/dist/lib/InternalValueSetter.d.ts +1 -1
  31. package/dist/lib/InternalValueSetter.js +1 -1
  32. package/dist/lib/NodeHeap.d.ts +1 -1
  33. package/dist/lib/NodeHeap.js +1 -1
  34. package/dist/lib/PackageInfoLoader.js +1 -1
  35. package/dist/lib/ProcessManager.d.ts +1 -1
  36. package/dist/lib/ProcessManager.js +1 -1
  37. package/dist/lib/Serializer.d.ts +1 -1
  38. package/dist/lib/Serializer.js +22 -7
  39. package/dist/lib/StringLoader.d.ts +1 -1
  40. package/dist/lib/StringLoader.js +1 -1
  41. package/dist/lib/Types.d.ts +33 -1
  42. package/dist/lib/Types.js +1 -1
  43. package/dist/lib/Utils.d.ts +3 -1
  44. package/dist/lib/Utils.js +62 -5
  45. package/dist/lib/heap-data/HeapEdge.d.ts +1 -1
  46. package/dist/lib/heap-data/HeapEdge.js +1 -1
  47. package/dist/lib/heap-data/HeapLocation.d.ts +3 -2
  48. package/dist/lib/heap-data/HeapLocation.js +8 -1
  49. package/dist/lib/heap-data/HeapNode.d.ts +1 -1
  50. package/dist/lib/heap-data/HeapNode.js +2 -2
  51. package/dist/lib/heap-data/HeapSnapshot.d.ts +1 -1
  52. package/dist/lib/heap-data/HeapSnapshot.js +1 -1
  53. package/dist/lib/heap-data/HeapStringNode.d.ts +1 -1
  54. package/dist/lib/heap-data/HeapStringNode.js +1 -1
  55. package/dist/lib/heap-data/HeapUtils.d.ts +1 -1
  56. package/dist/lib/heap-data/HeapUtils.js +1 -1
  57. package/dist/lib/heap-data/MemLabTagStore.d.ts +1 -1
  58. package/dist/lib/heap-data/MemLabTagStore.js +1 -1
  59. package/dist/lib/leak-filters/BaseLeakFilter.rule.d.ts +1 -1
  60. package/dist/lib/leak-filters/BaseLeakFilter.rule.js +1 -1
  61. package/dist/lib/leak-filters/LeakFilterRuleList.d.ts +1 -1
  62. package/dist/lib/leak-filters/LeakFilterRuleList.js +1 -1
  63. package/dist/lib/leak-filters/LeakObjectFilter.d.ts +1 -1
  64. package/dist/lib/leak-filters/LeakObjectFilter.js +1 -1
  65. package/dist/lib/leak-filters/rules/FilterByExternalFilter.rule.d.ts +1 -1
  66. package/dist/lib/leak-filters/rules/FilterByExternalFilter.rule.js +1 -1
  67. package/dist/lib/leak-filters/rules/FilterDetachedDOMElement.rule.d.ts +1 -1
  68. package/dist/lib/leak-filters/rules/FilterDetachedDOMElement.rule.js +1 -1
  69. package/dist/lib/leak-filters/rules/FilterHermesNode.rule.d.ts +1 -1
  70. package/dist/lib/leak-filters/rules/FilterHermesNode.rule.js +1 -1
  71. package/dist/lib/leak-filters/rules/FilterOverSizedNodeAsLeak.rule.d.ts +1 -1
  72. package/dist/lib/leak-filters/rules/FilterOverSizedNodeAsLeak.rule.js +1 -1
  73. package/dist/lib/leak-filters/rules/FilterStackTraceFrame.rule.d.ts +1 -1
  74. package/dist/lib/leak-filters/rules/FilterStackTraceFrame.rule.js +1 -1
  75. package/dist/lib/leak-filters/rules/FilterTrivialNode.rule.d.ts +1 -1
  76. package/dist/lib/leak-filters/rules/FilterTrivialNode.rule.js +1 -1
  77. package/dist/lib/leak-filters/rules/FilterUnmountedFiberNode.rule.d.ts +1 -1
  78. package/dist/lib/leak-filters/rules/FilterUnmountedFiberNode.rule.js +1 -1
  79. package/dist/logger/LeakClusterLogger.d.ts +1 -1
  80. package/dist/logger/LeakClusterLogger.js +1 -1
  81. package/dist/logger/LeakTraceDetailsLogger.d.ts +1 -1
  82. package/dist/logger/LeakTraceDetailsLogger.js +1 -1
  83. package/dist/modes/BaseMode.d.ts +1 -1
  84. package/dist/modes/BaseMode.js +1 -1
  85. package/dist/modes/InteractionTestMode.d.ts +1 -1
  86. package/dist/modes/InteractionTestMode.js +1 -1
  87. package/dist/modes/MeasureMode.d.ts +1 -1
  88. package/dist/modes/MeasureMode.js +1 -1
  89. package/dist/modes/RunningModes.d.ts +1 -1
  90. package/dist/modes/RunningModes.js +1 -1
  91. package/dist/paths/TraceFinder.d.ts +1 -1
  92. package/dist/paths/TraceFinder.js +1 -1
  93. package/dist/trace-cluster/ClusterUtils.d.ts +16 -2
  94. package/dist/trace-cluster/ClusterUtils.js +43 -1
  95. package/dist/trace-cluster/ClusterUtilsHelper.d.ts +1 -1
  96. package/dist/trace-cluster/ClusterUtilsHelper.js +1 -1
  97. package/dist/trace-cluster/ClusteringHeuristics.d.ts +1 -1
  98. package/dist/trace-cluster/ClusteringHeuristics.js +1 -1
  99. package/dist/trace-cluster/EvalutationMetric.d.ts +1 -1
  100. package/dist/trace-cluster/EvalutationMetric.js +1 -1
  101. package/dist/trace-cluster/MultiIterationSeqClustering.d.ts +21 -0
  102. package/dist/trace-cluster/MultiIterationSeqClustering.js +112 -0
  103. package/dist/trace-cluster/SequentialClustering.d.ts +1 -1
  104. package/dist/trace-cluster/SequentialClustering.js +1 -1
  105. package/dist/trace-cluster/TraceBucket.d.ts +1 -1
  106. package/dist/trace-cluster/TraceBucket.js +4 -4
  107. package/dist/trace-cluster/TraceElement.d.ts +1 -1
  108. package/dist/trace-cluster/TraceElement.js +1 -1
  109. package/dist/trace-cluster/strategies/MLTraceSimilarityStrategy.d.ts +1 -1
  110. package/dist/trace-cluster/strategies/MLTraceSimilarityStrategy.js +1 -1
  111. package/dist/trace-cluster/strategies/TraceAsClusterStrategy.d.ts +1 -1
  112. package/dist/trace-cluster/strategies/TraceAsClusterStrategy.js +1 -1
  113. package/dist/trace-cluster/strategies/TraceSimilarityStrategy.d.ts +1 -1
  114. package/dist/trace-cluster/strategies/TraceSimilarityStrategy.js +1 -1
  115. package/dist/trace-cluster/strategies/machine-learning/DistanceMatrix.d.ts +1 -1
  116. package/dist/trace-cluster/strategies/machine-learning/DistanceMatrix.js +1 -1
  117. package/dist/trace-cluster/strategies/machine-learning/HAC.d.ts +1 -1
  118. package/dist/trace-cluster/strategies/machine-learning/HAC.js +1 -1
  119. package/dist/trace-cluster/strategies/machine-learning/Ngram.d.ts +1 -1
  120. package/dist/trace-cluster/strategies/machine-learning/Ngram.js +1 -1
  121. package/dist/trace-cluster/strategies/machine-learning/TfidfVectorizer.d.ts +1 -1
  122. package/dist/trace-cluster/strategies/machine-learning/TfidfVectorizer.js +1 -1
  123. package/package.json +4 -4
package/README.md CHANGED
@@ -3,5 +3,5 @@
3
3
  This is the memlab core library. It contains V8/Hermes heap snapshot parser, core algorithms, leak trace clustering, utilities, and config.
4
4
 
5
5
  ## Online Resources
6
- * [Official Website and Demo](https://facebookincubator.github.io/memlab)
7
- * [Documentation](https://facebookincubator.github.io/memlab/docs/intro)
6
+ * [Official Website and Demo](https://facebook.github.io/memlab)
7
+ * [Documentation](https://facebook.github.io/memlab/docs/intro)
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  export {};
11
11
  //# sourceMappingURL=HeapParser.test.d.ts.map
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
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); }); }
@@ -39,7 +39,7 @@ test('Capture inserted object', () => __awaiter(void 0, void 0, void 0, function
39
39
  const heap = yield (0, NodeHeap_1.takeNodeMinimalHeap)();
40
40
  expect(heap.hasObjectWithClassName('TestObject')).toBe(true);
41
41
  }), timeout);
42
- test('Does not capture transcient object', () => __awaiter(void 0, void 0, void 0, function* () {
42
+ test('Does not capture transient object', () => __awaiter(void 0, void 0, void 0, function* () {
43
43
  class TestObject {
44
44
  constructor() {
45
45
  this.arr1 = [1, 2, 3];
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  export {};
11
11
  //# sourceMappingURL=NodeHeap.test.d.ts.map
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
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); }); }
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  export {};
11
11
  //# sourceMappingURL=StringNode.test.d.ts.map
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
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); }); }
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  import type { AnyValue } from '../../../lib/Types';
11
11
  declare global {
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
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); }); }
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  export {};
11
11
  //# sourceMappingURL=utils.test.d.ts.map
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
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/index.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  /** @internal */
11
11
  export declare function registerPackage(): Promise<void>;
@@ -50,5 +50,9 @@ export * from './lib/PackageInfoLoader';
50
50
  /** @internal */
51
51
  export { default as SequentialClustering } from './trace-cluster/SequentialClustering';
52
52
  /** @internal */
53
+ export { default as MultiIterationSeqClustering } from './trace-cluster/MultiIterationSeqClustering';
54
+ /** @internal */
53
55
  export { default as TraceFinder } from './paths/TraceFinder';
56
+ /** @internal */
57
+ export * from './trace-cluster/ClusterUtils';
54
58
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
10
10
  */
11
11
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
12
  if (k2 === undefined) k2 = k;
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
36
  };
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.TraceFinder = exports.SequentialClustering = exports.EvaluationMetric = exports.NormalizedTrace = exports.leakClusterLogger = exports.ProcessManager = exports.modes = exports.constant = exports.analysis = exports.browserInfo = exports.serializer = exports.fileManager = exports.utils = exports.BaseOption = exports.info = exports.config = exports.registerPackage = void 0;
38
+ exports.TraceFinder = exports.MultiIterationSeqClustering = exports.SequentialClustering = exports.EvaluationMetric = exports.NormalizedTrace = exports.leakClusterLogger = exports.ProcessManager = exports.modes = exports.constant = exports.analysis = exports.browserInfo = exports.serializer = exports.fileManager = exports.utils = exports.BaseOption = exports.info = exports.config = exports.registerPackage = void 0;
39
39
  const path_1 = __importDefault(require("path"));
40
40
  const PackageInfoLoader_1 = require("./lib/PackageInfoLoader");
41
41
  /** @internal */
@@ -101,5 +101,10 @@ __exportStar(require("./lib/PackageInfoLoader"), exports);
101
101
  var SequentialClustering_1 = require("./trace-cluster/SequentialClustering");
102
102
  Object.defineProperty(exports, "SequentialClustering", { enumerable: true, get: function () { return __importDefault(SequentialClustering_1).default; } });
103
103
  /** @internal */
104
+ var MultiIterationSeqClustering_1 = require("./trace-cluster/MultiIterationSeqClustering");
105
+ Object.defineProperty(exports, "MultiIterationSeqClustering", { enumerable: true, get: function () { return __importDefault(MultiIterationSeqClustering_1).default; } });
106
+ /** @internal */
104
107
  var TraceFinder_1 = require("./paths/TraceFinder");
105
108
  Object.defineProperty(exports, "TraceFinder", { enumerable: true, get: function () { return __importDefault(TraceFinder_1).default; } });
109
+ /** @internal */
110
+ __exportStar(require("./trace-cluster/ClusterUtils"), exports);
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  import type { ParsedArgs } from 'minimist';
11
11
  import type { AnyRecord } from './Types';
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
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); }); }
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  import type { ConsoleMessage, Dialog, LaunchOptions, Page } from 'puppeteer';
11
11
  import type { IBrowserInfo } from './Types';
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
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); }); }
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  import type { LaunchOptions, Permission } from 'puppeteer';
11
11
  import type { AnyFunction, AnyValue, IClusterStrategy, IRunningMode, IScenario, Nullable, Optional, QuickExperiment, ILeakFilter, IPackageInfo } from './Types';
@@ -52,6 +52,7 @@ export declare class MemLabConfig {
52
52
  _isFullRun: boolean;
53
53
  _scenario: Optional<IScenario>;
54
54
  _isHeadfulBrowser: boolean;
55
+ _disableWebSecurity: boolean;
55
56
  _browser: string;
56
57
  snapshotHasDetachedness: boolean;
57
58
  specifiedEngine: boolean;
@@ -69,6 +70,7 @@ export declare class MemLabConfig {
69
70
  dataBaseDir: string;
70
71
  userDataDir: string;
71
72
  curDataDir: string;
73
+ webSourceDir: string;
72
74
  runMetaFile: string;
73
75
  snapshotSequenceFile: string;
74
76
  exploreResultFile: string;
@@ -186,15 +188,20 @@ export declare class MemLabConfig {
186
188
  mlClusteringLinkageMaxDistance: number;
187
189
  mlMaxDF: number;
188
190
  isSequentialClustering: boolean;
191
+ isMultiIterationSeqClustering: boolean;
189
192
  seqClusteringSplitCount: number;
193
+ multiIterSeqClusteringIteration: number;
194
+ multiIterSeqClusteringSampleSize: number;
190
195
  seqClusteringIsRandomChunks: boolean;
196
+ instrumentJS: boolean;
197
+ interceptScript: boolean;
191
198
  constructor(options?: ConfigOption);
192
199
  private initInternalConfigs;
193
200
  private init;
194
201
  getAdditionalConfigInContinuousTest(_app: string, _interaction: string): string[];
195
202
  private static instance;
196
203
  static getInstance(): MemLabConfig;
197
- static resetConfigWithTranscientDir(): MemLabConfig;
204
+ static resetConfigWithTransientDir(): MemLabConfig;
198
205
  private haltOrThrow;
199
206
  setTarget(app: string, tab: string): void;
200
207
  set scenario(scenario: Optional<IScenario>);
@@ -205,6 +212,8 @@ export declare class MemLabConfig {
205
212
  get browser(): string;
206
213
  set isHeadfulBrowser(isHeadful: boolean);
207
214
  get isHeadfulBrowser(): boolean;
215
+ set disableWebSecurity(disable: boolean);
216
+ get disableWebSecurity(): boolean;
208
217
  get browserBinaryPath(): string;
209
218
  set reportLeaksInTimers(shouldReport: boolean);
210
219
  get reportLeaksInTimers(): boolean;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
10
10
  */
11
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -55,6 +55,7 @@ class MemLabConfig {
55
55
  this._timerNodes = ['Pending activities'];
56
56
  this._timerEdges = [];
57
57
  this._isHeadfulBrowser = false;
58
+ this._disableWebSecurity = false;
58
59
  this.targetApp = Constant_1.default.unset;
59
60
  this.targetTab = Constant_1.default.unset;
60
61
  this.analysisMode = Constant_1.default.unset;
@@ -115,6 +116,10 @@ class MemLabConfig {
115
116
  this.snapshotHasDetachedness = false;
116
117
  // by default running in regular mode
117
118
  this.runningMode = RunningModes_1.default.get('regular', this);
119
+ // intercept and log JavaScript Code in browser
120
+ this.interceptScript = false;
121
+ // rewrite JavaScript Code in browser
122
+ this.instrumentJS = false;
118
123
  // external heap snapshot paths, if enabled
119
124
  this.externalSnapshotFilePaths = [];
120
125
  // mute the console output, if enabled
@@ -136,8 +141,15 @@ class MemLabConfig {
136
141
  this.mlMaxDF = 1;
137
142
  // if true, evaluating results with sequential clustering
138
143
  this.isSequentialClustering = false;
144
+ // if true, evaluating results with sequential
145
+ // clustering with multiple iterations
146
+ this.isMultiIterationSeqClustering = false;
139
147
  // split the sample leak traces into 4 smaller ones by default.
140
148
  this.seqClusteringSplitCount = 4;
149
+ // the number of iterations for multi-iteration sequential clustering
150
+ this.multiIterSeqClusteringIteration = 1;
151
+ // the number of trace samples to retain from each cluster
152
+ this.multiIterSeqClusteringSampleSize = Infinity;
141
153
  // if true, split dataset into trunks
142
154
  // with random order for sequential clustering
143
155
  this.seqClusteringIsRandomChunks = false;
@@ -322,9 +334,9 @@ class MemLabConfig {
322
334
  }
323
335
  return MemLabConfig.instance;
324
336
  }
325
- static resetConfigWithTranscientDir() {
337
+ static resetConfigWithTransientDir() {
326
338
  const config = MemLabConfig.getInstance();
327
- FileManager_1.default.initDirs(config, { transcient: true });
339
+ FileManager_1.default.initDirs(config, { transient: true });
328
340
  return config;
329
341
  }
330
342
  haltOrThrow(msg,
@@ -393,6 +405,27 @@ class MemLabConfig {
393
405
  get isHeadfulBrowser() {
394
406
  return this._isHeadfulBrowser;
395
407
  }
408
+ set disableWebSecurity(disable) {
409
+ this._disableWebSecurity = disable;
410
+ const args = this.puppeteerConfig.args;
411
+ const flag = '--disable-web-security';
412
+ const index = args.indexOf(flag);
413
+ if (disable) {
414
+ // add the flag
415
+ if (index < 0) {
416
+ args.push(flag);
417
+ }
418
+ }
419
+ else {
420
+ // remove the flag
421
+ if (index >= 0) {
422
+ args.splice(index, 1);
423
+ }
424
+ }
425
+ }
426
+ get disableWebSecurity() {
427
+ return this._disableWebSecurity;
428
+ }
396
429
  get browserBinaryPath() {
397
430
  return path_1.default.join(this.browserDir, this.browser);
398
431
  }
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  import { Chalk } from 'chalk';
11
11
  import type { MemLabConfig } from './Config';
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  'use strict';
11
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  declare const constants: {
11
11
  isFB: boolean;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const InternalValueSetter_1 = require("./InternalValueSetter");
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  import type { MemLabConfig } from './Config';
11
11
  import type { AnyValue, Optional } from './Types';
@@ -13,13 +13,13 @@ import type { AnyValue, Optional } from './Types';
13
13
  export declare type FileOption = {
14
14
  workDir?: Optional<string>;
15
15
  clear?: boolean;
16
- transcient?: boolean;
16
+ transient?: boolean;
17
17
  };
18
18
  /** @internal */
19
19
  export declare class FileManager {
20
20
  getDefaultWorkDir(): string;
21
21
  generateTmpHeapDir(): string;
22
- private static transcientInstanceIdx;
22
+ private static transientInstanceIdx;
23
23
  getWorkDir(options?: FileOption): string;
24
24
  getChromeBinaryZipFile(): string;
25
25
  getChromeBinaryTimeStampFile(): string;
@@ -30,6 +30,8 @@ export declare class FileManager {
30
30
  getClusterSampleDataDir(): string;
31
31
  getUserDataDir(options: FileOption): string;
32
32
  getCurDataDir(options: FileOption): string;
33
+ getWebSourceDir(options?: FileOption): string;
34
+ getWebSourceMetaFile(options?: FileOption): string;
33
35
  getPersistDataDir(options: FileOption): string;
34
36
  getLoggerOutDir(options?: FileOption): string;
35
37
  getTraceClustersDir(options?: FileOption): string;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
10
10
  */
11
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -52,9 +52,9 @@ class FileManager {
52
52
  if (options.workDir) {
53
53
  return path_1.default.resolve(options.workDir);
54
54
  }
55
- // transcient options supercedes other the CLI options
56
- if (options.transcient) {
57
- const idx = ++FileManager.transcientInstanceIdx;
55
+ // transient options supercedes other the CLI options
56
+ if (options.transient) {
57
+ const idx = ++FileManager.transientInstanceIdx;
58
58
  const instanceId = `${process.pid}-${Date.now()}-${idx}`;
59
59
  const workDir = path_1.default.join(this.getTmpDir(), `memlab-${instanceId}`);
60
60
  return path_1.default.resolve(workDir);
@@ -92,6 +92,12 @@ class FileManager {
92
92
  getCurDataDir(options) {
93
93
  return path_1.default.join(this.getDataBaseDir(options), 'cur');
94
94
  }
95
+ getWebSourceDir(options = {}) {
96
+ return path_1.default.join(this.getCurDataDir(options), 'code');
97
+ }
98
+ getWebSourceMetaFile(options = {}) {
99
+ return path_1.default.join(this.getWebSourceDir(options), 'files.json');
100
+ }
95
101
  getPersistDataDir(options) {
96
102
  return path_1.default.join(this.getDataBaseDir(options), 'persist');
97
103
  }
@@ -205,6 +211,7 @@ class FileManager {
205
211
  if (!fs_extra_1.default.existsSync(curDataDir)) {
206
212
  return;
207
213
  }
214
+ this.emptyDirIfExists(this.getWebSourceDir(options));
208
215
  const dataSuffix = ['.heapsnapshot', '.json', '.png'];
209
216
  const files = fs_extra_1.default.readdirSync(curDataDir);
210
217
  for (const file of files) {
@@ -286,6 +293,7 @@ class FileManager {
286
293
  config.userDataDir = joinAndProcessDir(options, this.getUserDataDir(options));
287
294
  const outDir = joinAndProcessDir(options, this.getDataOutDir(options));
288
295
  config.curDataDir = joinAndProcessDir(options, this.getCurDataDir(options));
296
+ config.webSourceDir = joinAndProcessDir(options, this.getWebSourceDir(options));
289
297
  config.dataBuilderDataDir = joinAndProcessDir(options, config.dataBaseDir, 'dataBuilder');
290
298
  config.persistentDataDir = joinAndProcessDir(options, this.getPersistDataDir(options));
291
299
  config.consoleLogFile = path_1.default.join(config.curDataDir, 'console-log.txt');
@@ -320,5 +328,5 @@ class FileManager {
320
328
  }
321
329
  }
322
330
  exports.FileManager = FileManager;
323
- FileManager.transcientInstanceIdx = 0;
331
+ FileManager.transientInstanceIdx = 0;
324
332
  exports.default = new FileManager();
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  import type { E2EStepInfo, HeapNodeIdSet, IHeapNode, IHeapSnapshot, IMemoryAnalystOptions, IMemoryAnalystSnapshotDiff, LeakTracePathItem, Optional, IOveralLeakInfo, TraceCluster, ISerializedInfo } from './Types';
11
11
  import TraceFinder from '../paths/TraceFinder';
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  'use strict';
11
11
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @format
8
8
  * @lightSyntaxTransform
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
10
10
  */
11
11
  import type { IHeapSnapshot } from './Types';
12
12
  declare function getNodeIdsFromFile(file: string, _options?: {}): Promise<Set<number>>;
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @format
8
8
  * @lightSyntaxTransform
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
10
10
  */
11
11
  'use strict';
12
12
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  /** @internal */
11
11
  export declare abstract class InternalValueSetter<T> {
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
10
10
  */
11
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  import type { IHeapSnapshot } from './Types';
11
11
  /**
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
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); }); }
@@ -20,7 +20,7 @@ exports.PackageInfoLoader = void 0;
20
20
  * LICENSE file in the root directory of this source tree.
21
21
  *
22
22
  * @format
23
- * @oncall ws_labs
23
+ * @oncall web_perf_infra
24
24
  */
25
25
  const fs_extra_1 = __importDefault(require("fs-extra"));
26
26
  const path_1 = __importDefault(require("path"));
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  import type { Command, Optional } from './Types';
11
11
  declare type Options = {
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  * @format
9
- * @oncall ws_labs
9
+ * @oncall web_perf_infra
10
10
  */
11
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @oncall ws_labs
8
+ * @oncall web_perf_infra
9
9
  */
10
10
  import { E2EStepInfo, HeapNodeIdSet, IHeapEdge, IHeapNode, IHeapSnapshot, ISerializedInfo, LeakTracePathItem, Nullable } from './Types';
11
11
  declare type JSONifyArgs = {