@memlab/core 1.1.5 → 1.1.9
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/__tests__/parser/HeapParser.test.d.ts +1 -1
- package/dist/__tests__/parser/HeapParser.test.js +3 -3
- package/dist/__tests__/parser/NodeHeap.test.d.ts +1 -1
- package/dist/__tests__/parser/NodeHeap.test.js +6 -6
- package/dist/__tests__/parser/StringNode.test.d.ts +1 -1
- package/dist/__tests__/parser/StringNode.test.js +2 -2
- package/dist/__tests__/parser/traverse/HeapNodeTraverse.test.d.ts +1 -1
- package/dist/__tests__/parser/traverse/HeapNodeTraverse.test.js +3 -3
- package/dist/__tests__/utils/utils.test.d.ts +1 -1
- package/dist/__tests__/utils/utils.test.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6 -3
- package/dist/lib/BaseOption.d.ts +1 -1
- package/dist/lib/BaseOption.js +1 -1
- package/dist/lib/BrowserInfo.d.ts +1 -1
- package/dist/lib/BrowserInfo.js +1 -1
- package/dist/lib/Config.d.ts +11 -2
- package/dist/lib/Config.js +25 -5
- package/dist/lib/Console.d.ts +1 -1
- package/dist/lib/Console.js +1 -1
- package/dist/lib/Constant.d.ts +1 -1
- package/dist/lib/Constant.js +1 -1
- package/dist/lib/FileManager.d.ts +1 -1
- package/dist/lib/FileManager.js +5 -3
- package/dist/lib/HeapAnalyzer.d.ts +1 -1
- package/dist/lib/HeapAnalyzer.js +26 -10
- package/dist/lib/HeapParser.d.ts +2 -2
- package/dist/lib/HeapParser.js +2 -2
- package/dist/lib/InternalValueSetter.d.ts +1 -1
- package/dist/lib/InternalValueSetter.js +1 -1
- package/dist/lib/NodeHeap.d.ts +53 -10
- package/dist/lib/NodeHeap.js +73 -22
- package/dist/lib/PackageInfoLoader.js +2 -2
- package/dist/lib/ProcessManager.d.ts +1 -1
- package/dist/lib/ProcessManager.js +1 -1
- package/dist/lib/Serializer.d.ts +1 -1
- package/dist/lib/Serializer.js +49 -26
- package/dist/lib/StringLoader.d.ts +2 -2
- package/dist/lib/StringLoader.js +2 -2
- package/dist/lib/Types.d.ts +111 -36
- package/dist/lib/Types.js +1 -1
- package/dist/lib/Utils.d.ts +1 -1
- package/dist/lib/Utils.js +55 -31
- package/dist/lib/heap-data/HeapEdge.d.ts +2 -2
- package/dist/lib/heap-data/HeapEdge.js +2 -2
- package/dist/lib/heap-data/HeapLocation.d.ts +2 -2
- package/dist/lib/heap-data/HeapLocation.js +2 -2
- package/dist/lib/heap-data/HeapNode.d.ts +3 -2
- package/dist/lib/heap-data/HeapNode.js +6 -2
- package/dist/lib/heap-data/HeapSnapshot.d.ts +3 -2
- package/dist/lib/heap-data/HeapSnapshot.js +6 -33
- package/dist/lib/heap-data/HeapStringNode.d.ts +2 -2
- package/dist/lib/heap-data/HeapStringNode.js +4 -2
- package/dist/lib/heap-data/HeapUtils.d.ts +2 -2
- package/dist/lib/heap-data/HeapUtils.js +2 -2
- package/dist/lib/heap-data/MemLabTagStore.d.ts +23 -0
- package/dist/lib/heap-data/MemLabTagStore.js +110 -0
- package/dist/lib/leak-filters/BaseLeakFilter.rule.d.ts +1 -1
- package/dist/lib/leak-filters/BaseLeakFilter.rule.js +1 -1
- package/dist/lib/leak-filters/LeakFilterRuleList.d.ts +1 -1
- package/dist/lib/leak-filters/LeakFilterRuleList.js +1 -1
- package/dist/lib/leak-filters/LeakObjectFilter.d.ts +1 -1
- package/dist/lib/leak-filters/LeakObjectFilter.js +1 -1
- package/dist/lib/leak-filters/rules/FilterByExternalFilter.rule.d.ts +1 -1
- package/dist/lib/leak-filters/rules/FilterByExternalFilter.rule.js +1 -1
- package/dist/lib/leak-filters/rules/FilterDetachedDOMElement.rule.d.ts +1 -1
- package/dist/lib/leak-filters/rules/FilterDetachedDOMElement.rule.js +1 -1
- package/dist/lib/leak-filters/rules/FilterHermesNode.rule.d.ts +1 -1
- package/dist/lib/leak-filters/rules/FilterHermesNode.rule.js +1 -1
- package/dist/lib/leak-filters/rules/FilterOverSizedNodeAsLeak.rule.d.ts +1 -1
- package/dist/lib/leak-filters/rules/FilterOverSizedNodeAsLeak.rule.js +1 -1
- package/dist/lib/leak-filters/rules/FilterStackTraceFrame.rule.d.ts +1 -1
- package/dist/lib/leak-filters/rules/FilterStackTraceFrame.rule.js +1 -1
- package/dist/lib/leak-filters/rules/FilterTrivialNode.rule.d.ts +1 -1
- package/dist/lib/leak-filters/rules/FilterTrivialNode.rule.js +1 -1
- package/dist/lib/leak-filters/rules/FilterUnmountedFiberNode.rule.d.ts +1 -1
- package/dist/lib/leak-filters/rules/FilterUnmountedFiberNode.rule.js +1 -1
- package/dist/logger/LeakClusterLogger.d.ts +1 -1
- package/dist/logger/LeakClusterLogger.js +1 -1
- package/dist/logger/LeakTraceDetailsLogger.d.ts +1 -1
- package/dist/logger/LeakTraceDetailsLogger.js +1 -1
- package/dist/modes/BaseMode.d.ts +1 -1
- package/dist/modes/BaseMode.js +1 -1
- package/dist/modes/InteractionTestMode.d.ts +1 -1
- package/dist/modes/InteractionTestMode.js +1 -1
- package/dist/modes/MeasureMode.d.ts +1 -1
- package/dist/modes/MeasureMode.js +1 -1
- package/dist/modes/RunningModes.d.ts +1 -1
- package/dist/modes/RunningModes.js +1 -1
- package/dist/paths/TraceFinder.d.ts +1 -1
- package/dist/paths/TraceFinder.js +41 -42
- package/dist/trace-cluster/ClusterUtils.d.ts +1 -1
- package/dist/trace-cluster/ClusterUtils.js +1 -1
- package/dist/trace-cluster/ClusterUtilsHelper.d.ts +1 -1
- package/dist/trace-cluster/ClusterUtilsHelper.js +1 -1
- package/dist/trace-cluster/ClusteringHeuristics.d.ts +1 -1
- package/dist/trace-cluster/ClusteringHeuristics.js +1 -1
- package/dist/trace-cluster/EvalutationMetric.d.ts +1 -1
- package/dist/trace-cluster/EvalutationMetric.js +1 -1
- package/dist/trace-cluster/SequentialClustering.d.ts +17 -0
- package/dist/trace-cluster/SequentialClustering.js +47 -0
- package/dist/trace-cluster/TraceBucket.d.ts +2 -1
- package/dist/trace-cluster/TraceBucket.js +10 -2
- package/dist/trace-cluster/TraceElement.d.ts +3 -1
- package/dist/trace-cluster/TraceElement.js +7 -1
- package/dist/trace-cluster/strategies/MLTraceSimilarityStrategy.d.ts +15 -0
- package/dist/trace-cluster/strategies/MLTraceSimilarityStrategy.js +61 -0
- package/dist/trace-cluster/strategies/TraceAsClusterStrategy.d.ts +1 -1
- package/dist/trace-cluster/strategies/TraceAsClusterStrategy.js +1 -1
- package/dist/trace-cluster/strategies/TraceSimilarityStrategy.d.ts +1 -1
- package/dist/trace-cluster/strategies/TraceSimilarityStrategy.js +1 -1
- package/dist/trace-cluster/strategies/machine-learning/DistanceMatrix.d.ts +11 -0
- package/dist/trace-cluster/strategies/machine-learning/DistanceMatrix.js +54 -0
- package/dist/trace-cluster/strategies/machine-learning/HAC.d.ts +17 -0
- package/dist/trace-cluster/strategies/machine-learning/HAC.js +122 -0
- package/dist/trace-cluster/strategies/machine-learning/Ngram.d.ts +11 -0
- package/dist/trace-cluster/strategies/machine-learning/Ngram.js +22 -0
- package/dist/trace-cluster/strategies/machine-learning/TfidfVectorizer.d.ts +38 -0
- package/dist/trace-cluster/strategies/machine-learning/TfidfVectorizer.js +144 -0
- package/package.json +1 -1
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
|
-
* @lightSyntaxTransform
|
|
9
7
|
* @format
|
|
8
|
+
* @lightSyntaxTransform
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
import type { IHeapLocation } from '../Types';
|
|
12
12
|
import type HeapSnapshot from './HeapSnapshot';
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
|
-
* @lightSyntaxTransform
|
|
9
7
|
* @format
|
|
8
|
+
* @lightSyntaxTransform
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
|
-
* @lightSyntaxTransform
|
|
9
7
|
* @format
|
|
8
|
+
* @lightSyntaxTransform
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
import type { IHeapNode, IHeapEdge, Nullable, EdgeIterationCallback, Predicator, IHeapStringNode } from '../Types';
|
|
12
12
|
import type HeapSnapshot from './HeapSnapshot';
|
|
@@ -36,6 +36,7 @@ export default class HeapNode implements IHeapNode {
|
|
|
36
36
|
findReferrers(predicate: Predicator<IHeapEdge>): IHeapEdge[];
|
|
37
37
|
get referrers(): HeapEdge[];
|
|
38
38
|
forEachReferrer(callback: EdgeIterationCallback): void;
|
|
39
|
+
get hasPathEdge(): boolean;
|
|
39
40
|
get pathEdge(): Nullable<HeapEdge>;
|
|
40
41
|
set pathEdge(edge: Nullable<HeapEdge>);
|
|
41
42
|
get nodeIndex(): number;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
|
-
* @lightSyntaxTransform
|
|
9
7
|
* @format
|
|
8
|
+
* @lightSyntaxTransform
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
@@ -189,6 +189,10 @@ class HeapNode {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
+
get hasPathEdge() {
|
|
193
|
+
const heapSnapshot = this.heapSnapshot;
|
|
194
|
+
return heapSnapshot._nodeIdxHasPathEdge[this.idx] !== 0;
|
|
195
|
+
}
|
|
192
196
|
get pathEdge() {
|
|
193
197
|
const heapSnapshot = this.heapSnapshot;
|
|
194
198
|
if (heapSnapshot._nodeIdxHasPathEdge[this.idx] === 0) {
|
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
|
-
* @lightSyntaxTransform
|
|
9
7
|
* @format
|
|
8
|
+
* @lightSyntaxTransform
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
import type { IHeapNode, IHeapNodes, IHeapEdges, IHeapSnapshot, HeapNodeTypes, HeapEdgeTypes, HeapSnapshotMeta, RawHeapSnapshot, NumericDictionary, Nullable } from '../Types';
|
|
12
12
|
import HeapNode from './HeapNode';
|
|
13
13
|
export default class HeapSnapshot implements IHeapSnapshot {
|
|
14
14
|
snapshot: RawHeapSnapshot;
|
|
15
|
+
isProcessed: boolean;
|
|
15
16
|
nodes: IHeapNodes;
|
|
16
17
|
_nodeCount: number;
|
|
17
18
|
edges: IHeapEdges;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
|
-
* @lightSyntaxTransform
|
|
9
7
|
* @format
|
|
8
|
+
* @lightSyntaxTransform
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
@@ -18,11 +18,13 @@ const Console_1 = __importDefault(require("../Console"));
|
|
|
18
18
|
const HeapNode_1 = __importDefault(require("./HeapNode"));
|
|
19
19
|
const HeapEdge_1 = __importDefault(require("./HeapEdge"));
|
|
20
20
|
const HeapUtils_1 = require("./HeapUtils");
|
|
21
|
+
const MemLabTagStore_1 = __importDefault(require("./MemLabTagStore"));
|
|
21
22
|
const EMPTY_UINT8_ARRAY = new Uint8Array(0);
|
|
22
23
|
const EMPTY_UINT32_ARRAY = new Uint32Array(0);
|
|
23
24
|
class HeapSnapshot {
|
|
24
25
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25
26
|
constructor(snapshot, _options = {}) {
|
|
27
|
+
this.isProcessed = false;
|
|
26
28
|
this._nodeCount = -1;
|
|
27
29
|
this._edgeCount = -1;
|
|
28
30
|
this._nodeId2NodeIdx = {};
|
|
@@ -98,7 +100,7 @@ class HeapSnapshot {
|
|
|
98
100
|
forEachTraceable(cb) {
|
|
99
101
|
for (let i = 0; i < this.length; i++) {
|
|
100
102
|
const node = this.get(i);
|
|
101
|
-
if (!node.
|
|
103
|
+
if (!node.hasPathEdge) {
|
|
102
104
|
continue;
|
|
103
105
|
}
|
|
104
106
|
const ret = cb(node, i);
|
|
@@ -158,36 +160,7 @@ class HeapSnapshot {
|
|
|
158
160
|
return detected;
|
|
159
161
|
}
|
|
160
162
|
hasObjectWithTag(tag) {
|
|
161
|
-
|
|
162
|
-
let tagStore = null;
|
|
163
|
-
this.nodes.forEach((node) => {
|
|
164
|
-
if (node.name === 'MemLabTaggedStore' && node.type === 'object') {
|
|
165
|
-
tagStore = node;
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
if (tagStore == null) {
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
const store = tagStore;
|
|
173
|
-
// get tagStore.taggedObjects
|
|
174
|
-
const taggedObjects = store.getReferenceNode('taggedObjects', 'property');
|
|
175
|
-
if (taggedObjects == null) {
|
|
176
|
-
return false;
|
|
177
|
-
}
|
|
178
|
-
// get taggedObjects[tag]
|
|
179
|
-
const weakSet = taggedObjects.getReferenceNode(tag, 'property');
|
|
180
|
-
if (weakSet == null) {
|
|
181
|
-
return false;
|
|
182
|
-
}
|
|
183
|
-
// get weakSet.table
|
|
184
|
-
const table = weakSet.getReferenceNode('table');
|
|
185
|
-
if (table == null) {
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
// check if the table has any weak reference to any object
|
|
189
|
-
const ref = table.findAnyReference((edge) => edge.type === 'weak' && edge.toNode.name !== 'system / Oddball');
|
|
190
|
-
return ref != null;
|
|
163
|
+
return MemLabTagStore_1.default.hasObjectWithTag(this, tag);
|
|
191
164
|
}
|
|
192
165
|
getNodeById(id) {
|
|
193
166
|
if (!(id in this._nodeId2NodeIdx)) {
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
|
-
* @lightSyntaxTransform
|
|
9
7
|
* @format
|
|
8
|
+
* @lightSyntaxTransform
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
import type { IHeapStringNode } from '../Types';
|
|
12
12
|
import type HeapSnapshot from './HeapSnapshot';
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
|
-
* @lightSyntaxTransform
|
|
9
7
|
* @format
|
|
8
|
+
* @lightSyntaxTransform
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
@@ -35,6 +35,8 @@ class HeapStringNode extends HeapNode_1.default {
|
|
|
35
35
|
if (parentNode == null) {
|
|
36
36
|
throw (0, HeapUtils_1.throwError)(new Error('broken sliced string'));
|
|
37
37
|
}
|
|
38
|
+
// sliced string in heap snapshot doesn't include
|
|
39
|
+
// the start index and the end index, so this may be inaccurate
|
|
38
40
|
return parentNode.stringValue;
|
|
39
41
|
}
|
|
40
42
|
return this.name;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
|
-
* @lightSyntaxTransform
|
|
9
7
|
* @format
|
|
8
|
+
* @lightSyntaxTransform
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
export declare const NodeDetachState: {
|
|
12
12
|
Unknown: number;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
|
-
* @lightSyntaxTransform
|
|
9
7
|
* @format
|
|
8
|
+
* @lightSyntaxTransform
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { AnyValue, IHeapSnapshot } from '../Types';
|
|
11
|
+
declare type AnyObject = Record<AnyValue, AnyValue>;
|
|
12
|
+
/** @internal */
|
|
13
|
+
export default class MemLabTaggedStore {
|
|
14
|
+
taggedObjects: Record<string, WeakSet<AnyObject>>;
|
|
15
|
+
private constructor();
|
|
16
|
+
private static instance;
|
|
17
|
+
readonly id: string;
|
|
18
|
+
static getInstance(): MemLabTaggedStore;
|
|
19
|
+
static tagObject<T extends object>(o: T, tag: string): void;
|
|
20
|
+
static hasObjectWithTag(heap: IHeapSnapshot, tag: string): boolean;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=MemLabTagStore.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
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const __1 = require("../..");
|
|
13
|
+
let uindex = 1;
|
|
14
|
+
function getUniqueID() {
|
|
15
|
+
const randId = `${Math.random()}`;
|
|
16
|
+
return `${process.pid}-${Date.now()}-${randId}-${uindex++}`;
|
|
17
|
+
}
|
|
18
|
+
/** @internal */
|
|
19
|
+
class MemLabTaggedStore {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.id = getUniqueID();
|
|
22
|
+
this.taggedObjects = Object.create(null);
|
|
23
|
+
}
|
|
24
|
+
// make sure it's a singleton
|
|
25
|
+
static getInstance() {
|
|
26
|
+
if (!MemLabTaggedStore.instance) {
|
|
27
|
+
MemLabTaggedStore.instance = new MemLabTaggedStore();
|
|
28
|
+
}
|
|
29
|
+
return MemLabTaggedStore.instance;
|
|
30
|
+
}
|
|
31
|
+
// tag an object with a mark
|
|
32
|
+
static tagObject(o, tag) {
|
|
33
|
+
const store = MemLabTaggedStore.getInstance();
|
|
34
|
+
if (!store.taggedObjects[tag]) {
|
|
35
|
+
store.taggedObjects[tag] = new WeakSet();
|
|
36
|
+
}
|
|
37
|
+
store.taggedObjects[tag].add(o);
|
|
38
|
+
}
|
|
39
|
+
// check if any object in the heap snapshot has the mark
|
|
40
|
+
// tagged by this MemLabTaggedStore in this execution context
|
|
41
|
+
static hasObjectWithTag(heap, tag) {
|
|
42
|
+
const curContextTagStoreID = MemLabTaggedStore.getInstance().id;
|
|
43
|
+
let tagStore = null;
|
|
44
|
+
// get all MemLabTaggedStore instances in the heap snapshot
|
|
45
|
+
const stores = [];
|
|
46
|
+
heap.nodes.forEach((node) => {
|
|
47
|
+
if (node.name === 'MemLabTaggedStore' && node.type === 'object') {
|
|
48
|
+
stores.push(node);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
// if no tag store found
|
|
52
|
+
if (stores.length === 0) {
|
|
53
|
+
return false;
|
|
54
|
+
// if there is only one store found
|
|
55
|
+
}
|
|
56
|
+
else if (stores.length === 1) {
|
|
57
|
+
tagStore = stores[0];
|
|
58
|
+
// if there are multiple MemLabTagStore instances
|
|
59
|
+
// found in the heap snapshot
|
|
60
|
+
}
|
|
61
|
+
else if (stores.length > 1) {
|
|
62
|
+
stores.forEach((node) => {
|
|
63
|
+
// in case multiple instances of MemLabTaggedStore exists
|
|
64
|
+
// in the heap snapshot, we need to make sure that the
|
|
65
|
+
// tag store is the one matching the current execution context
|
|
66
|
+
let storeID = '';
|
|
67
|
+
// match tag store id
|
|
68
|
+
node.forEachReference(edge => {
|
|
69
|
+
var _a, _b;
|
|
70
|
+
if (edge.name_or_index === 'id' && edge.toNode.isString) {
|
|
71
|
+
storeID = (_b = (_a = edge.toNode.toStringNode()) === null || _a === void 0 ? void 0 : _a.stringValue) !== null && _b !== void 0 ? _b : '';
|
|
72
|
+
return { stop: true };
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
if (curContextTagStoreID === storeID) {
|
|
76
|
+
tagStore = node;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
if (tagStore == null) {
|
|
80
|
+
throw __1.utils.haltOrThrow('Multiple MemLabTagStore instances found in heap snapshot ' +
|
|
81
|
+
'when checking object tags, please make sure only one memlab ' +
|
|
82
|
+
'instance is running at a time and double check that memlab is ' +
|
|
83
|
+
'not running in Jest concurrent mode.');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (tagStore == null) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const store = tagStore;
|
|
90
|
+
// get tagStore.taggedObjects
|
|
91
|
+
const taggedObjects = store.getReferenceNode('taggedObjects', 'property');
|
|
92
|
+
if (taggedObjects == null) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
// get taggedObjects[tag]
|
|
96
|
+
const weakSet = taggedObjects.getReferenceNode(tag, 'property');
|
|
97
|
+
if (weakSet == null) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
// get weakSet.table
|
|
101
|
+
const table = weakSet.getReferenceNode('table');
|
|
102
|
+
if (table == null) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
// check if the table has any weak reference to any object
|
|
106
|
+
const ref = table.findAnyReference((edge) => edge.type === 'weak' && edge.toNode.name !== 'system / Oddball');
|
|
107
|
+
return ref != null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.default = MemLabTaggedStore;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { MemLabConfig } from '../Config';
|
|
11
11
|
import type { HeapNodeIdSet, IHeapNode, IHeapSnapshot } from '../Types';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.LeakDecision = void 0;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import { ILeakObjectFilterRule } from './BaseLeakFilter.rule';
|
|
11
11
|
declare const _default: ILeakObjectFilterRule[];
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { MemLabConfig } from '../Config';
|
|
11
11
|
import type { HeapNodeIdSet, IHeapNode, IHeapSnapshot } from '../Types';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { MemLabConfig } from '../../Config';
|
|
11
11
|
import type { HeapNodeIdSet, IHeapNode, IHeapSnapshot } from '../../Types';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.FilterByExternalFilterRule = void 0;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { MemLabConfig } from '../../Config';
|
|
11
11
|
import type { IHeapNode } from '../../Types';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { MemLabConfig } from '../../Config';
|
|
11
11
|
import type { IHeapNode } from '../../Types';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { MemLabConfig } from '../../Config';
|
|
11
11
|
import type { IHeapNode } from '../../Types';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.FilterOverSizedNodeAsLeakRule = void 0;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { MemLabConfig } from '../../Config';
|
|
11
11
|
import type { IHeapNode } from '../../Types';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { MemLabConfig } from '../../Config';
|
|
11
11
|
import type { IHeapNode } from '../../Types';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { MemLabConfig } from '../../Config';
|
|
11
11
|
import type { IHeapNode } from '../../Types';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import { E2EStepInfo, TraceCluster, TraceClusterDiff, TraceClusterMetaInfo } from '../lib/Types';
|
|
11
11
|
declare class LeakClusterLogger {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { IHeapSnapshot, ISerializedInfo, LeakTracePathItem, Nullable } from '../lib/Types';
|
|
11
11
|
declare class LeakTraceDetailsLogger {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
package/dist/modes/BaseMode.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import type { E2EStepInfo, Config, IE2EScenarioVisitPlan, Optional } from '../lib/Types';
|
|
11
11
|
import type { Page } from 'puppeteer';
|
package/dist/modes/BaseMode.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
|
-
* @emails oncall+ws_labs
|
|
9
8
|
* @format
|
|
9
|
+
* @oncall ws_labs
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @emails oncall+ws_labs
|
|
8
7
|
* @format
|
|
8
|
+
* @oncall ws_labs
|
|
9
9
|
*/
|
|
10
10
|
import BaseMode from './BaseMode';
|
|
11
11
|
declare class InteractionTestMode extends BaseMode {
|