lighthouse 12.0.0-dev.20240610 → 12.0.0-dev.20240612
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/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +2 -2
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +2 -2
- package/core/audits/byte-efficiency/render-blocking-resources.d.ts +3 -3
- package/core/audits/byte-efficiency/render-blocking-resources.js +4 -4
- package/core/audits/dobetterweb/uses-http2.d.ts +2 -2
- package/core/audits/dobetterweb/uses-http2.js +2 -2
- package/core/audits/long-tasks.d.ts +7 -6
- package/core/audits/long-tasks.js +5 -4
- package/core/audits/prioritize-lcp-image.d.ts +1 -1
- package/core/computed/document-urls.js +3 -2
- package/core/computed/load-simulator.d.ts +4 -4
- package/core/computed/load-simulator.js +3 -3
- package/core/computed/main-resource.js +3 -2
- package/core/computed/metrics/lantern-first-contentful-paint.d.ts +4 -4
- package/core/computed/metrics/lantern-first-contentful-paint.js +3 -3
- package/core/computed/metrics/lantern-interactive.d.ts +4 -4
- package/core/computed/metrics/lantern-interactive.js +3 -3
- package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +4 -4
- package/core/computed/metrics/lantern-largest-contentful-paint.js +3 -3
- package/core/computed/metrics/lantern-max-potential-fid.d.ts +4 -4
- package/core/computed/metrics/lantern-max-potential-fid.js +3 -3
- package/core/computed/metrics/lantern-metric.d.ts +4 -3
- package/core/computed/metrics/lantern-metric.js +4 -4
- package/core/computed/metrics/lantern-speed-index.d.ts +4 -4
- package/core/computed/metrics/lantern-speed-index.js +3 -3
- package/core/computed/metrics/lantern-total-blocking-time.d.ts +4 -4
- package/core/computed/metrics/lantern-total-blocking-time.js +3 -3
- package/core/computed/metrics/total-blocking-time.js +3 -1
- package/core/computed/network-analysis.js +2 -2
- package/core/computed/page-dependency-graph.d.ts +2 -2
- package/core/computed/page-dependency-graph.js +6 -6
- package/core/computed/processed-navigation.d.ts +1 -1
- package/core/computed/tbt-impact-tasks.js +4 -2
- package/core/config/constants.d.ts +28 -53
- package/core/config/constants.js +2 -43
- package/core/lib/asset-saver.js +2 -2
- package/core/lib/lantern/{base-node.d.ts → BaseNode.d.ts} +7 -9
- package/core/lib/lantern/{base-node.js → BaseNode.js} +6 -6
- package/core/lib/lantern/BaseNode.test.js +385 -0
- package/core/lib/lantern/CpuNode.d.ts +43 -0
- package/core/lib/lantern/{cpu-node.js → CpuNode.js} +8 -9
- package/core/lib/lantern/{lantern-error.d.ts → LanternError.d.ts} +1 -1
- package/core/lib/lantern/{metric.d.ts → Metric.d.ts} +17 -17
- package/core/lib/lantern/{metric.js → Metric.js} +10 -12
- package/core/lib/lantern/{network-node.d.ts → NetworkNode.d.ts} +4 -5
- package/core/lib/lantern/{network-node.js → NetworkNode.js} +4 -5
- package/core/lib/lantern/{page-dependency-graph.d.ts → PageDependencyGraph.d.ts} +22 -11
- package/core/lib/lantern/{page-dependency-graph.js → PageDependencyGraph.js} +56 -22
- package/core/lib/lantern/PageDependencyGraph.test.js +654 -0
- package/core/lib/lantern/{tbt-utils.d.ts → TBTUtils.d.ts} +1 -1
- package/core/lib/lantern/TBTUtils.test.d.ts +2 -0
- package/core/lib/lantern/TBTUtils.test.js +130 -0
- package/core/lib/lantern/{trace-engine-computation-data.d.ts → TraceEngineComputationData.d.ts} +7 -7
- package/core/lib/lantern/{trace-engine-computation-data.js → TraceEngineComputationData.js} +18 -16
- package/core/lib/lantern/lantern.d.ts +19 -7
- package/core/lib/lantern/lantern.js +21 -1
- package/core/lib/lantern/metrics/{first-contentful-paint.d.ts → FirstContentfulPaint.d.ts} +11 -11
- package/core/lib/lantern/metrics/{first-contentful-paint.js → FirstContentfulPaint.js} +8 -10
- package/core/lib/lantern/metrics/FirstContentfulPaint.test.js +54 -0
- package/core/lib/lantern/metrics/Interactive.d.ts +20 -0
- package/core/lib/lantern/metrics/{interactive.js → Interactive.js} +14 -17
- package/core/lib/lantern/metrics/Interactive.test.js +56 -0
- package/core/lib/lantern/metrics/LargestContentfulPaint.d.ts +19 -0
- package/core/lib/lantern/metrics/{largest-contentful-paint.js → LargestContentfulPaint.js} +12 -15
- package/core/lib/lantern/metrics/LargestContentfulPaint.test.js +42 -0
- package/core/lib/lantern/metrics/MaxPotentialFID.d.ts +24 -0
- package/core/lib/lantern/metrics/{max-potential-fid.js → MaxPotentialFID.js} +12 -13
- package/core/lib/lantern/metrics/MetricTestUtils.d.ts +19 -0
- package/core/lib/lantern/metrics/MetricTestUtils.js +48 -0
- package/core/lib/lantern/metrics/{speed-index.d.ts → SpeedIndex.d.ts} +7 -13
- package/core/lib/lantern/metrics/{speed-index.js → SpeedIndex.js} +12 -14
- package/core/lib/lantern/metrics/SpeedIndex.test.js +83 -0
- package/core/lib/lantern/metrics/TotalBlockingTime.d.ts +25 -0
- package/core/lib/lantern/metrics/{total-blocking-time.js → TotalBlockingTime.js} +13 -16
- package/core/lib/lantern/metrics/__snapshots__/first-contentful-paint-test.js.snap +11 -0
- package/core/lib/lantern/metrics/__snapshots__/interactive-test.js.snap +17 -0
- package/core/lib/lantern/metrics/metrics.d.ts +9 -0
- package/core/lib/lantern/metrics/metrics.js +16 -0
- package/core/lib/lantern/{simulator/connection-pool.d.ts → simulation/ConnectionPool.d.ts} +5 -5
- package/core/lib/lantern/{simulator/connection-pool.js → simulation/ConnectionPool.js} +3 -3
- package/core/lib/lantern/simulation/ConnectionPool.test.js +195 -0
- package/core/lib/lantern/simulation/Constants.d.ts +52 -0
- package/core/lib/lantern/simulation/Constants.js +48 -0
- package/core/lib/lantern/{simulator/dns-cache.d.ts → simulation/DNSCache.d.ts} +2 -2
- package/core/lib/lantern/{simulator/dns-cache.js → simulation/DNSCache.js} +1 -1
- package/core/lib/lantern/simulation/DNSCache.test.js +72 -0
- package/core/lib/lantern/{simulator/network-analyzer.d.ts → simulation/NetworkAnalyzer.d.ts} +8 -8
- package/core/lib/lantern/{simulator/network-analyzer.js → simulation/NetworkAnalyzer.js} +3 -3
- package/core/lib/lantern/simulation/NetworkAnalyzer.test.js +475 -0
- package/core/lib/lantern/{simulator/simulator-timing-map.d.ts → simulation/SimulationTimingMap.d.ts} +7 -7
- package/core/lib/lantern/{simulator/simulator-timing-map.js → simulation/SimulationTimingMap.js} +5 -6
- package/core/lib/lantern/{simulator/simulator.d.ts → simulation/Simulator.d.ts} +13 -15
- package/core/lib/lantern/{simulator/simulator.js → simulation/Simulator.js} +29 -30
- package/core/lib/lantern/simulation/Simulator.test.js +434 -0
- package/core/lib/lantern/simulation/TCPConnection.test.d.ts +2 -0
- package/core/lib/lantern/simulation/TCPConnection.test.js +374 -0
- package/core/lib/lantern/{simulator/tcp-connection.d.ts → simulation/TcpConnection.d.ts} +2 -2
- package/core/lib/lantern/{simulator/tcp-connection.js → simulation/TcpConnection.js} +1 -1
- package/core/lib/lantern/simulation/simulation.d.ts +21 -0
- package/core/lib/lantern/simulation/simulation.js +28 -0
- package/core/lib/lantern/types/lantern.d.ts +81 -9
- package/core/lib/lantern-trace-saver.d.ts +4 -4
- package/core/lib/lantern-trace-saver.js +3 -3
- package/core/lib/navigation-error.js +3 -3
- package/core/lib/network-recorder.js +2 -2
- package/core/lib/network-request.d.ts +1 -1
- package/core/lib/network-request.js +1 -1
- package/package.json +5 -5
- package/tsconfig.json +10 -8
- package/types/artifacts.d.ts +3 -10
- package/types/gatherer.d.ts +1 -1
- package/core/lib/lantern/cpu-node.d.ts +0 -44
- package/core/lib/lantern/metrics/interactive.d.ts +0 -26
- package/core/lib/lantern/metrics/largest-contentful-paint.d.ts +0 -19
- package/core/lib/lantern/metrics/max-potential-fid.d.ts +0 -30
- package/core/lib/lantern/metrics/total-blocking-time.d.ts +0 -31
- /package/core/lib/lantern/{lantern-error.js → LanternError.js} +0 -0
- /package/core/lib/lantern/{tbt-utils.js → TBTUtils.js} +0 -0
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
|
-
import {NetworkAnalyzer} from '../lib/lantern/simulator/network-analyzer.js';
|
|
9
9
|
import {NetworkRecords} from './network-records.js';
|
|
10
10
|
|
|
11
11
|
class NetworkAnalysis {
|
|
@@ -16,7 +16,7 @@ class NetworkAnalysis {
|
|
|
16
16
|
*/
|
|
17
17
|
static async compute_(devtoolsLog, context) {
|
|
18
18
|
const records = await NetworkRecords.request(devtoolsLog, context);
|
|
19
|
-
return NetworkAnalyzer.analyze(records);
|
|
19
|
+
return Lantern.Simulation.NetworkAnalyzer.analyze(records);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { PageDependencyGraphComputed as PageDependencyGraph };
|
|
2
|
-
export type Node = import('../lib/lantern/
|
|
2
|
+
export type Node = import('../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>;
|
|
3
3
|
declare const PageDependencyGraphComputed: typeof PageDependencyGraph & {
|
|
4
4
|
request: (dependencies: {
|
|
5
5
|
trace: LH.Trace;
|
|
@@ -11,7 +11,7 @@ declare const PageDependencyGraphComputed: typeof PageDependencyGraph & {
|
|
|
11
11
|
}>) => Promise<Node>;
|
|
12
12
|
};
|
|
13
13
|
import { NetworkRequest } from '../lib/network-request.js';
|
|
14
|
-
/** @typedef {import('../lib/lantern/
|
|
14
|
+
/** @typedef {import('../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
15
15
|
declare class PageDependencyGraph {
|
|
16
16
|
/**
|
|
17
17
|
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, URL: LH.Artifacts['URL'], fromTrace?: boolean}} data
|
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
|
-
import {PageDependencyGraph as LanternPageDependencyGraph} from '../lib/lantern/page-dependency-graph.js';
|
|
9
9
|
import {NetworkRequest} from '../lib/network-request.js';
|
|
10
10
|
import {ProcessedTrace} from './processed-trace.js';
|
|
11
11
|
import {NetworkRecords} from './network-records.js';
|
|
12
12
|
import {TraceEngineResult} from './trace-engine-result.js';
|
|
13
|
-
import * as TraceEngineComputationData from '../lib/lantern/trace-engine-computation-data.js';
|
|
14
13
|
|
|
15
|
-
/** @typedef {import('../lib/lantern/
|
|
14
|
+
/** @typedef {import('../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
16
15
|
|
|
17
16
|
class PageDependencyGraph {
|
|
18
17
|
/**
|
|
@@ -30,14 +29,15 @@ class PageDependencyGraph {
|
|
|
30
29
|
if (data.fromTrace) {
|
|
31
30
|
const traceEngineResult = await TraceEngineResult.request({trace}, context);
|
|
32
31
|
const traceEngineData = traceEngineResult.data;
|
|
33
|
-
const requests =
|
|
32
|
+
const requests =
|
|
33
|
+
Lantern.TraceEngineComputationData.createNetworkRequests(trace, traceEngineData);
|
|
34
34
|
const graph =
|
|
35
|
-
TraceEngineComputationData.createGraph(requests, trace, traceEngineData, URL);
|
|
35
|
+
Lantern.TraceEngineComputationData.createGraph(requests, trace, traceEngineData, URL);
|
|
36
36
|
return graph;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const lanternRequests = networkRecords.map(NetworkRequest.asLanternNetworkRequest);
|
|
40
|
-
return
|
|
40
|
+
return Lantern.PageDependencyGraph.createGraph(mainThreadEvents, lanternRequests, URL);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ProcessedNavigationComputed as ProcessedNavigation };
|
|
2
2
|
declare const ProcessedNavigationComputed: typeof ProcessedNavigation & {
|
|
3
|
-
request: (dependencies: import("../index.js").
|
|
3
|
+
request: (dependencies: import("../index.js").Trace | import("../index.js").Artifacts.ProcessedTrace, context: import("../../types/utility-types.js").default.ImmutableObject<{
|
|
4
4
|
computedCache: Map<string, import("../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
5
5
|
}>) => Promise<import("../index.js").Artifacts.ProcessedNavigation>;
|
|
6
6
|
};
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
9
|
import {MainThreadTasks} from './main-thread-tasks.js';
|
|
9
10
|
import {FirstContentfulPaint} from './metrics/first-contentful-paint.js';
|
|
10
11
|
import {Interactive} from './metrics/interactive.js';
|
|
11
12
|
import {TotalBlockingTime} from './metrics/total-blocking-time.js';
|
|
12
13
|
import {ProcessedTrace} from './processed-trace.js';
|
|
13
|
-
|
|
14
|
+
|
|
15
|
+
const {calculateTbtImpactForEvent} = Lantern.TBTUtils;
|
|
14
16
|
|
|
15
17
|
class TBTImpactTasks {
|
|
16
18
|
/**
|
|
@@ -132,7 +134,7 @@ class TBTImpactTasks {
|
|
|
132
134
|
/** @type {Map<LH.Artifacts.TaskNode, {start: number, end: number, duration: number}>} */
|
|
133
135
|
const topLevelTaskToEvent = new Map();
|
|
134
136
|
|
|
135
|
-
/** @type {Map<
|
|
137
|
+
/** @type {Map<Lantern.TraceEvent, LH.Artifacts.TaskNode>} */
|
|
136
138
|
const traceEventToTask = new Map();
|
|
137
139
|
for (const task of tasks) {
|
|
138
140
|
traceEventToTask.set(task.event, task);
|
|
@@ -1,43 +1,31 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const throughputKbps_2: number;
|
|
30
|
-
export { throughputKbps_2 as throughputKbps };
|
|
31
|
-
const cpuSlowdownMultiplier_2: number;
|
|
32
|
-
export { cpuSlowdownMultiplier_2 as cpuSlowdownMultiplier };
|
|
33
|
-
const requestLatencyMs_2: number;
|
|
34
|
-
export { requestLatencyMs_2 as requestLatencyMs };
|
|
35
|
-
const downloadThroughputKbps_2: number;
|
|
36
|
-
export { downloadThroughputKbps_2 as downloadThroughputKbps };
|
|
37
|
-
const uploadThroughputKbps_2: number;
|
|
38
|
-
export { uploadThroughputKbps_2 as uploadThroughputKbps };
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
export const throttling: {
|
|
2
|
+
DEVTOOLS_RTT_ADJUSTMENT_FACTOR: number;
|
|
3
|
+
DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR: number;
|
|
4
|
+
mobileSlow4G: {
|
|
5
|
+
rttMs: number;
|
|
6
|
+
throughputKbps: number;
|
|
7
|
+
requestLatencyMs: number;
|
|
8
|
+
downloadThroughputKbps: number;
|
|
9
|
+
uploadThroughputKbps: number;
|
|
10
|
+
cpuSlowdownMultiplier: number;
|
|
11
|
+
};
|
|
12
|
+
mobileRegular3G: {
|
|
13
|
+
rttMs: number;
|
|
14
|
+
throughputKbps: number;
|
|
15
|
+
requestLatencyMs: number;
|
|
16
|
+
downloadThroughputKbps: number;
|
|
17
|
+
uploadThroughputKbps: number;
|
|
18
|
+
cpuSlowdownMultiplier: number;
|
|
19
|
+
};
|
|
20
|
+
desktopDense4G: {
|
|
21
|
+
rttMs: number;
|
|
22
|
+
throughputKbps: number;
|
|
23
|
+
cpuSlowdownMultiplier: number;
|
|
24
|
+
requestLatencyMs: number;
|
|
25
|
+
downloadThroughputKbps: number;
|
|
26
|
+
uploadThroughputKbps: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
41
29
|
export namespace screenEmulationMetrics {
|
|
42
30
|
export { MOTOGPOWER_EMULATION_METRICS as mobile };
|
|
43
31
|
export { DESKTOP_EMULATION_METRICS as desktop };
|
|
@@ -54,19 +42,6 @@ export namespace nonSimulatedSettingsOverrides {
|
|
|
54
42
|
const networkQuietThresholdMs: number;
|
|
55
43
|
const cpuQuietThresholdMs: number;
|
|
56
44
|
}
|
|
57
|
-
/**
|
|
58
|
-
* @license
|
|
59
|
-
* Copyright 2018 Google LLC
|
|
60
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
61
|
-
*/
|
|
62
|
-
/**
|
|
63
|
-
* Adjustments needed for DevTools network throttling to simulate
|
|
64
|
-
* more realistic network conditions.
|
|
65
|
-
* @see https://crbug.com/721112
|
|
66
|
-
* @see https://docs.google.com/document/d/10lfVdS1iDWCRKQXPfbxEn4Or99D64mvNlugP1AQuFlE/edit
|
|
67
|
-
*/
|
|
68
|
-
declare const DEVTOOLS_RTT_ADJUSTMENT_FACTOR: 3.75;
|
|
69
|
-
declare const DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR: 0.9;
|
|
70
45
|
/**
|
|
71
46
|
* @type {Required<LH.SharedFlagsSettings['screenEmulation']>}
|
|
72
47
|
*/
|
package/core/config/constants.js
CHANGED
|
@@ -4,50 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
* Adjustments needed for DevTools network throttling to simulate
|
|
9
|
-
* more realistic network conditions.
|
|
10
|
-
* @see https://crbug.com/721112
|
|
11
|
-
* @see https://docs.google.com/document/d/10lfVdS1iDWCRKQXPfbxEn4Or99D64mvNlugP1AQuFlE/edit
|
|
12
|
-
*/
|
|
13
|
-
const DEVTOOLS_RTT_ADJUSTMENT_FACTOR = 3.75;
|
|
14
|
-
const DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR = 0.9;
|
|
7
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
15
8
|
|
|
16
|
-
const throttling =
|
|
17
|
-
DEVTOOLS_RTT_ADJUSTMENT_FACTOR,
|
|
18
|
-
DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,
|
|
19
|
-
// These values align with WebPageTest's definition of "Fast 3G"
|
|
20
|
-
// But offer similar characteristics to roughly the 75th percentile of 4G connections.
|
|
21
|
-
mobileSlow4G: {
|
|
22
|
-
rttMs: 150,
|
|
23
|
-
throughputKbps: 1.6 * 1024,
|
|
24
|
-
requestLatencyMs: 150 * DEVTOOLS_RTT_ADJUSTMENT_FACTOR,
|
|
25
|
-
downloadThroughputKbps: 1.6 * 1024 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,
|
|
26
|
-
uploadThroughputKbps: 750 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,
|
|
27
|
-
cpuSlowdownMultiplier: 4,
|
|
28
|
-
},
|
|
29
|
-
// These values partially align with WebPageTest's definition of "Regular 3G".
|
|
30
|
-
// These values are meant to roughly align with Chrome UX report's 3G definition which are based
|
|
31
|
-
// on HTTP RTT of 300-1400ms and downlink throughput of <700kbps.
|
|
32
|
-
mobileRegular3G: {
|
|
33
|
-
rttMs: 300,
|
|
34
|
-
throughputKbps: 700,
|
|
35
|
-
requestLatencyMs: 300 * DEVTOOLS_RTT_ADJUSTMENT_FACTOR,
|
|
36
|
-
downloadThroughputKbps: 700 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,
|
|
37
|
-
uploadThroughputKbps: 700 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,
|
|
38
|
-
cpuSlowdownMultiplier: 4,
|
|
39
|
-
},
|
|
40
|
-
// Using a "broadband" connection type
|
|
41
|
-
// Corresponds to "Dense 4G 25th percentile" in https://docs.google.com/document/d/1Ft1Bnq9-t4jK5egLSOc28IL4TvR-Tt0se_1faTA4KTY/edit#heading=h.bb7nfy2x9e5v
|
|
42
|
-
desktopDense4G: {
|
|
43
|
-
rttMs: 40,
|
|
44
|
-
throughputKbps: 10 * 1024,
|
|
45
|
-
cpuSlowdownMultiplier: 1,
|
|
46
|
-
requestLatencyMs: 0, // 0 means unset
|
|
47
|
-
downloadThroughputKbps: 0,
|
|
48
|
-
uploadThroughputKbps: 0,
|
|
49
|
-
},
|
|
50
|
-
};
|
|
9
|
+
const throttling = Lantern.Simulation.Constants.throttling;
|
|
51
10
|
|
|
52
11
|
/**
|
|
53
12
|
* @type {Required<LH.SharedFlagsSettings['screenEmulation']>}
|
package/core/lib/asset-saver.js
CHANGED
|
@@ -12,7 +12,7 @@ import {createGzip, gunzipSync} from 'zlib';
|
|
|
12
12
|
|
|
13
13
|
import log from 'lighthouse-logger';
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import * as Lantern from './lantern/lantern.js';
|
|
16
16
|
import lanternTraceSaver from './lantern-trace-saver.js';
|
|
17
17
|
import {MetricTraceEvents} from './traces/metric-trace-events.js';
|
|
18
18
|
import {NetworkAnalysis} from '../computed/network-analysis.js';
|
|
@@ -449,7 +449,7 @@ function saveDevtoolsLog(devtoolsLog, devtoolLogFilename, options = {}) {
|
|
|
449
449
|
async function saveLanternDebugTraces(pathWithBasename) {
|
|
450
450
|
if (!process.env.LANTERN_DEBUG) return;
|
|
451
451
|
|
|
452
|
-
for (const [label, nodeTimings] of Simulator.ALL_NODE_TIMINGS) {
|
|
452
|
+
for (const [label, nodeTimings] of Lantern.Simulation.Simulator.ALL_NODE_TIMINGS) {
|
|
453
453
|
if (lanternTraceSaver.simulationNamesToIgnore.includes(label)) continue;
|
|
454
454
|
|
|
455
455
|
const traceFilename = `${pathWithBasename}-${label}${traceSuffix}`;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A union of all types derived from BaseNode, allowing type check discrimination
|
|
3
3
|
* based on `node.type`. If a new node type is created, it should be added here.
|
|
4
4
|
*/
|
|
5
|
-
export type Node<T = any> = import('./
|
|
5
|
+
export type Node<T = any> = import('./CpuNode.js').CPUNode<T> | import('./NetworkNode.js').NetworkNode<T>;
|
|
6
6
|
/**
|
|
7
7
|
* @license
|
|
8
8
|
* Copyright 2017 Google LLC
|
|
@@ -12,7 +12,7 @@ export type Node<T = any> = import('./cpu-node.js').CPUNode<T> | import('./netwo
|
|
|
12
12
|
* A union of all types derived from BaseNode, allowing type check discrimination
|
|
13
13
|
* based on `node.type`. If a new node type is created, it should be added here.
|
|
14
14
|
* @template [T=any]
|
|
15
|
-
* @typedef {import('./
|
|
15
|
+
* @typedef {import('./CpuNode.js').CPUNode<T> | import('./NetworkNode.js').NetworkNode<T>} Node
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
18
|
* @fileoverview This class encapsulates logic for handling resources and tasks used to model the
|
|
@@ -30,6 +30,10 @@ export type Node<T = any> = import('./cpu-node.js').CPUNode<T> | import('./netwo
|
|
|
30
30
|
* @template [T=any]
|
|
31
31
|
*/
|
|
32
32
|
export class BaseNode<T = any> {
|
|
33
|
+
static TYPES: {
|
|
34
|
+
NETWORK: 'network';
|
|
35
|
+
CPU: 'cpu';
|
|
36
|
+
};
|
|
33
37
|
/**
|
|
34
38
|
* Returns whether the given node has a cycle in its dependent graph by performing a DFS.
|
|
35
39
|
* @param {Node} node
|
|
@@ -156,10 +160,4 @@ export class BaseNode<T = any> {
|
|
|
156
160
|
*/
|
|
157
161
|
canDependOn(node: Node): boolean;
|
|
158
162
|
}
|
|
159
|
-
|
|
160
|
-
namespace TYPES {
|
|
161
|
-
const NETWORK: 'network';
|
|
162
|
-
const CPU: 'cpu';
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
//# sourceMappingURL=base-node.d.ts.map
|
|
163
|
+
//# sourceMappingURL=BaseNode.d.ts.map
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* A union of all types derived from BaseNode, allowing type check discrimination
|
|
9
9
|
* based on `node.type`. If a new node type is created, it should be added here.
|
|
10
10
|
* @template [T=any]
|
|
11
|
-
* @typedef {import('./
|
|
11
|
+
* @typedef {import('./CpuNode.js').CPUNode<T> | import('./NetworkNode.js').NetworkNode<T>} Node
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
* @template [T=any]
|
|
29
29
|
*/
|
|
30
30
|
class BaseNode {
|
|
31
|
+
static TYPES = /** @type {{NETWORK: 'network', CPU: 'cpu'}} */({
|
|
32
|
+
NETWORK: 'network',
|
|
33
|
+
CPU: 'cpu',
|
|
34
|
+
});
|
|
35
|
+
|
|
31
36
|
/**
|
|
32
37
|
* @param {string} id
|
|
33
38
|
*/
|
|
@@ -361,9 +366,4 @@ class BaseNode {
|
|
|
361
366
|
}
|
|
362
367
|
}
|
|
363
368
|
|
|
364
|
-
BaseNode.TYPES = /** @type {{NETWORK: 'network', CPU: 'cpu'}} */({
|
|
365
|
-
NETWORK: 'network',
|
|
366
|
-
CPU: 'cpu',
|
|
367
|
-
});
|
|
368
|
-
|
|
369
369
|
export {BaseNode};
|