@memlab/core 1.1.6 → 1.1.10
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 +8 -2
- package/dist/lib/Config.js +23 -12
- 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 +9 -1
- package/dist/lib/HeapAnalyzer.js +51 -9
- 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 +35 -12
- package/dist/lib/NodeHeap.js +55 -24
- package/dist/lib/PackageInfoLoader.js +1 -1
- 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 +1 -1
- package/dist/lib/StringLoader.d.ts +2 -2
- package/dist/lib/StringLoader.js +2 -2
- package/dist/lib/Types.d.ts +51 -33
- package/dist/lib/Types.js +1 -1
- package/dist/lib/Utils.d.ts +3 -1
- package/dist/lib/Utils.js +71 -33
- 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 +58 -40
- 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 +11 -3
- 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 +1 -1
- package/dist/trace-cluster/strategies/MLTraceSimilarityStrategy.js +2 -2
- 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 +1 -1
- package/dist/trace-cluster/strategies/machine-learning/DistanceMatrix.js +1 -1
- package/dist/trace-cluster/strategies/machine-learning/HAC.d.ts +2 -2
- package/dist/trace-cluster/strategies/machine-learning/HAC.js +5 -7
- package/dist/trace-cluster/strategies/machine-learning/Ngram.d.ts +1 -1
- package/dist/trace-cluster/strategies/machine-learning/Ngram.js +1 -1
- package/dist/trace-cluster/strategies/machine-learning/TfidfVectorizer.d.ts +1 -1
- package/dist/trace-cluster/strategies/machine-learning/TfidfVectorizer.js +7 -3
- package/package.json +1 -1
|
@@ -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 {
|
|
@@ -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 BaseMode from './BaseMode';
|
|
11
11
|
import type { Page } from 'puppeteer';
|
|
@@ -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 { Config, IRunningMode } from '../lib/Types';
|
|
11
11
|
declare const _default: {
|
|
@@ -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 { AnyOptions, HeapNodeIdSet, IHeapEdge, IHeapNode, IHeapSnapshot, LeakTracePathItem, Nullable, Optional, Predicator } from '../lib/Types';
|
|
11
11
|
declare class TraceFinder {
|
|
@@ -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 };
|
|
@@ -89,15 +89,17 @@ class TraceFinder {
|
|
|
89
89
|
let nodesToVisitLength = 0;
|
|
90
90
|
const node = snapshot.nodes.get(ROOT_NODE_INDEX);
|
|
91
91
|
for (const edge of node.references) {
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
const toNode = edge.toNode;
|
|
93
|
+
const type = edge.type;
|
|
94
|
+
if (type === 'element') {
|
|
95
|
+
if (Utils_1.default.isDocumentDOMTreesRoot(toNode)) {
|
|
94
96
|
continue;
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
|
-
else if (
|
|
99
|
+
else if (type === 'shortcut') {
|
|
98
100
|
continue;
|
|
99
101
|
}
|
|
100
|
-
const childNodeIndex =
|
|
102
|
+
const childNodeIndex = toNode.nodeIndex;
|
|
101
103
|
nodesToVisit[nodesToVisitLength++] = childNodeIndex;
|
|
102
104
|
flags[childNodeIndex] |= flag;
|
|
103
105
|
}
|
|
@@ -303,11 +305,11 @@ class TraceFinder {
|
|
|
303
305
|
let newDominatorIndex = emptySlot;
|
|
304
306
|
let isOrphanNode = true;
|
|
305
307
|
const node = nodes.get(nodeIndex);
|
|
306
|
-
|
|
308
|
+
node.forEachReferrer((edge) => {
|
|
307
309
|
const referrerEdgeType = edge.type;
|
|
308
310
|
const referrerNodeIndex = edge.fromNode.nodeIndex;
|
|
309
311
|
if (!Utils_1.default.isEssentialEdge(referrerNodeIndex, referrerEdgeType, ROOT_NODE_INDEX)) {
|
|
310
|
-
|
|
312
|
+
return;
|
|
311
313
|
}
|
|
312
314
|
isOrphanNode = false;
|
|
313
315
|
const referrerNodeFlag = flags[referrerNodeIndex] & flag;
|
|
@@ -317,10 +319,10 @@ class TraceFinder {
|
|
|
317
319
|
if (referrerNodeIndex !== ROOT_NODE_INDEX &&
|
|
318
320
|
nodeFlag &&
|
|
319
321
|
!referrerNodeFlag) {
|
|
320
|
-
|
|
322
|
+
return;
|
|
321
323
|
}
|
|
322
324
|
if (!this.shouldTraverseEdge(edge)) {
|
|
323
|
-
|
|
325
|
+
return;
|
|
324
326
|
}
|
|
325
327
|
let referrerPostOrderIndex = nodeIndex2PostOrderIndex[referrerNodeIndex];
|
|
326
328
|
if (dominators[referrerPostOrderIndex] !== emptySlot) {
|
|
@@ -339,10 +341,10 @@ class TraceFinder {
|
|
|
339
341
|
}
|
|
340
342
|
// no need to check any further if reaching the root node
|
|
341
343
|
if (newDominatorIndex === rootPostOrderedIndex) {
|
|
342
|
-
|
|
344
|
+
return { stop: true };
|
|
343
345
|
}
|
|
344
346
|
}
|
|
345
|
-
}
|
|
347
|
+
});
|
|
346
348
|
// set root node as the dominator of orphan nodes
|
|
347
349
|
if (isOrphanNode) {
|
|
348
350
|
newDominatorIndex = rootPostOrderedIndex;
|
|
@@ -384,13 +386,20 @@ class TraceFinder {
|
|
|
384
386
|
return retainedSizes;
|
|
385
387
|
}
|
|
386
388
|
shouldIgnoreEdgeInTraceFinding(edge) {
|
|
387
|
-
|
|
389
|
+
const fromNode = edge.fromNode;
|
|
390
|
+
const toNode = edge.toNode;
|
|
391
|
+
const isDetachedNode = Utils_1.default.isDetachedDOMNode(toNode);
|
|
392
|
+
if (Config_1.default.hideBrowserLeak &&
|
|
393
|
+
Utils_1.default.isBlinkRootNode(fromNode) &&
|
|
394
|
+
isDetachedNode) {
|
|
395
|
+
return true;
|
|
396
|
+
}
|
|
397
|
+
if (!Config_1.default.reportLeaksInTimers &&
|
|
398
|
+
Utils_1.default.isPendingActivityNode(fromNode) &&
|
|
399
|
+
isDetachedNode) {
|
|
388
400
|
return true;
|
|
389
401
|
}
|
|
390
|
-
return
|
|
391
|
-
(Utils_1.default.isBlinkRootNode(edge.fromNode) ||
|
|
392
|
-
Utils_1.default.isPendingActivityNode(edge.fromNode)) &&
|
|
393
|
-
Utils_1.default.isDetachedDOMNode(edge.toNode));
|
|
402
|
+
return false;
|
|
394
403
|
}
|
|
395
404
|
shouldTraverseEdge(edge, options = {}) {
|
|
396
405
|
if (this.isBlockListedEdge(edge)) {
|
|
@@ -400,31 +409,33 @@ class TraceFinder {
|
|
|
400
409
|
}
|
|
401
410
|
// remove edges that are already part of reported leaked paths
|
|
402
411
|
isBlockListedEdge(edge) {
|
|
403
|
-
|
|
404
|
-
return false;
|
|
405
|
-
}
|
|
406
|
-
const isStrName = typeof edge.name_or_index === 'string';
|
|
412
|
+
const nameOrIndex = edge.name_or_index;
|
|
407
413
|
if (!Config_1.default.traverseDevToolsConsole &&
|
|
408
414
|
edge.type === 'internal' &&
|
|
409
|
-
|
|
410
|
-
|
|
415
|
+
typeof nameOrIndex === 'string' &&
|
|
416
|
+
nameOrIndex.indexOf('DevTools console') >= 0) {
|
|
417
|
+
return true;
|
|
418
|
+
}
|
|
419
|
+
if (Config_1.default.edgeNameBlockList.has(String(nameOrIndex))) {
|
|
420
|
+
return true;
|
|
421
|
+
}
|
|
422
|
+
if (Config_1.default.nodeNameBlockList.has(edge.toNode.name)) {
|
|
411
423
|
return true;
|
|
412
424
|
}
|
|
413
|
-
if (Config_1.default.
|
|
425
|
+
if (Config_1.default.nodeNameBlockList.has(edge.fromNode.name)) {
|
|
414
426
|
return true;
|
|
415
427
|
}
|
|
416
428
|
return false;
|
|
417
429
|
}
|
|
418
430
|
isLessPreferableEdge(edge) {
|
|
419
|
-
|
|
420
|
-
|
|
431
|
+
// pending activities -> DOM element is less preferrable
|
|
432
|
+
if (Utils_1.default.isPendingActivityNode(edge.fromNode) &&
|
|
433
|
+
Utils_1.default.isDOMNodeIncomplete(edge.toNode)) {
|
|
434
|
+
return true;
|
|
421
435
|
}
|
|
422
436
|
return Config_1.default.edgeNameGreyList.has(String(edge.name_or_index));
|
|
423
437
|
}
|
|
424
438
|
isLessPreferableNode(node) {
|
|
425
|
-
if (!node) {
|
|
426
|
-
return false;
|
|
427
|
-
}
|
|
428
439
|
return Config_1.default.nodeNameGreyList.has(node.name);
|
|
429
440
|
}
|
|
430
441
|
// each edge is indexed by fromNode's ID, toNode's ID, edge name, and edge type
|
|
@@ -434,16 +445,21 @@ class TraceFinder {
|
|
|
434
445
|
return `${fromNode.id}|${edge.name_or_index}|${edge.type}|${toNode.id}`;
|
|
435
446
|
}
|
|
436
447
|
calculateAllNodesRetainedSizes(snapshot) {
|
|
437
|
-
Console_1.default.overwrite('calculating dominators and retained sizes
|
|
448
|
+
Console_1.default.overwrite('calculating dominators and retained sizes .');
|
|
438
449
|
// step 1: build post order index
|
|
439
450
|
const flags = new Uint32Array(snapshot.nodes.length);
|
|
451
|
+
Console_1.default.overwrite('calculating dominators and retained sizes ..');
|
|
440
452
|
this.flagReachableNodesFromWindow(snapshot, flags, PAGE_OBJECT_FLAG);
|
|
453
|
+
Console_1.default.overwrite('calculating dominators and retained sizes ...');
|
|
441
454
|
const postOrderInfo = this.buildPostOrderIndex(snapshot, flags);
|
|
442
455
|
// step 2: build dominator relations
|
|
456
|
+
Console_1.default.overwrite('calculating dominators and retained sizes .');
|
|
443
457
|
const dominatorInfo = this.calculateDominatorNodesFromPostOrder(snapshot.nodes, snapshot.edges, postOrderInfo, flags);
|
|
444
458
|
// step 3: calculate retained sizes
|
|
459
|
+
Console_1.default.overwrite('calculating dominators and retained sizes ..');
|
|
445
460
|
const retainedSizes = this.calculateRetainedSizesFromDominatorNodes(snapshot.nodes, dominatorInfo, postOrderInfo);
|
|
446
461
|
// step 4: assign retained sizes and dominators to nodes
|
|
462
|
+
Console_1.default.overwrite('calculating dominators and retained sizes ...');
|
|
447
463
|
for (let i = 0; i < retainedSizes.length; i++) {
|
|
448
464
|
const node = snapshot.nodes.get(i);
|
|
449
465
|
node.retainedSize = retainedSizes[i];
|
|
@@ -473,8 +489,9 @@ class TraceFinder {
|
|
|
473
489
|
const node = curQueue.pop();
|
|
474
490
|
visited[node.nodeIndex] = 1;
|
|
475
491
|
for (const edge of node.references) {
|
|
492
|
+
const toNode = edge.toNode;
|
|
476
493
|
// skip nodes that already have a parent
|
|
477
|
-
if (
|
|
494
|
+
if (toNode.hasPathEdge) {
|
|
478
495
|
continue;
|
|
479
496
|
}
|
|
480
497
|
if (!this.shouldTraverseEdge(edge, traverseOption)) {
|
|
@@ -491,31 +508,32 @@ class TraceFinder {
|
|
|
491
508
|
}
|
|
492
509
|
// postpone traversing edges and nodes that are less preferable
|
|
493
510
|
if (this.isLessPreferableEdge(edge) ||
|
|
494
|
-
this.isLessPreferableNode(
|
|
511
|
+
this.isLessPreferableNode(toNode)) {
|
|
495
512
|
postponeQueue.push(edge);
|
|
496
513
|
}
|
|
497
514
|
else {
|
|
498
|
-
|
|
499
|
-
nextQueue.push(
|
|
515
|
+
toNode.pathEdge = edge;
|
|
516
|
+
nextQueue.push(toNode);
|
|
500
517
|
}
|
|
501
|
-
queued[
|
|
518
|
+
queued[toNode.nodeIndex] = 1;
|
|
502
519
|
}
|
|
503
520
|
}
|
|
504
521
|
// if no other preferable traces available
|
|
505
522
|
// traverse the postpone queue
|
|
506
523
|
while (nextQueue.length === 0 && postponeQueue.length > 0) {
|
|
507
524
|
const edge = postponeQueue.pop();
|
|
508
|
-
|
|
525
|
+
const toNode = edge.toNode;
|
|
526
|
+
if (toNode.hasPathEdge) {
|
|
509
527
|
continue;
|
|
510
528
|
}
|
|
511
|
-
|
|
512
|
-
nextQueue.push(
|
|
529
|
+
toNode.pathEdge = edge;
|
|
530
|
+
nextQueue.push(toNode);
|
|
513
531
|
}
|
|
514
532
|
// if no other preferable traces available
|
|
515
533
|
// consider the low priority root nodes
|
|
516
534
|
while (nextQueue.length === 0 && lowPriRootLists.length > 0) {
|
|
517
535
|
const root = lowPriRootLists.pop();
|
|
518
|
-
if (root.
|
|
536
|
+
if (root.hasPathEdge) {
|
|
519
537
|
continue;
|
|
520
538
|
}
|
|
521
539
|
nextQueue.push(root);
|
|
@@ -524,11 +542,11 @@ class TraceFinder {
|
|
|
524
542
|
}
|
|
525
543
|
}
|
|
526
544
|
getPathToGCRoots(_snapshot, node) {
|
|
527
|
-
if (!node || !node.
|
|
545
|
+
if (!node || !node.hasPathEdge) {
|
|
528
546
|
return null;
|
|
529
547
|
}
|
|
530
548
|
let path = { node };
|
|
531
|
-
while (node && node.
|
|
549
|
+
while (node && node.hasPathEdge) {
|
|
532
550
|
const edge = node.pathEdge;
|
|
533
551
|
path = { node: edge.fromNode, edge, next: path };
|
|
534
552
|
node = edge.fromNode;
|
|
@@ -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
|
declare const _default: {
|
|
11
11
|
isSimilarTrace: (t1: import("..").LeakTrace, t2: import("..").LeakTrace) => boolean;
|
|
@@ -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 { AnyValue, LeakTraceElement, LeakTrace } from '../lib/Types';
|
|
11
11
|
declare type NameWeightMapType = Map<string | RegExp | number, number>;
|
|
@@ -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.debugTraceElementSimilarityStats = exports.debugLog = void 0;
|
|
@@ -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 };
|