devtools-tracing 1.1.1 → 1.2.1
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/index.d.ts +4 -0
- package/dist/index.js +28854 -0
- package/package.json +11 -8
- package/generate.ts +0 -649
- package/index.ts +0 -17
- package/lib/extension-api/ExtensionAPI.d.ts +0 -357
- package/lib/front_end/core/common/App.ts +0 -7
- package/lib/front_end/core/common/AppProvider.ts +0 -32
- package/lib/front_end/core/common/Base64.ts +0 -47
- package/lib/front_end/core/common/CharacterIdMap.ts +0 -30
- package/lib/front_end/core/common/Color.ts +0 -2506
- package/lib/front_end/core/common/ColorConverter.ts +0 -402
- package/lib/front_end/core/common/ColorUtils.ts +0 -252
- package/lib/front_end/core/common/Console.ts +0 -114
- package/lib/front_end/core/common/Debouncer.ts +0 -15
- package/lib/front_end/core/common/EventTarget.ts +0 -52
- package/lib/front_end/core/common/Gzip.ts +0 -74
- package/lib/front_end/core/common/JavaScriptMetaData.ts +0 -29
- package/lib/front_end/core/common/Lazy.ts +0 -31
- package/lib/front_end/core/common/Linkifier.ts +0 -55
- package/lib/front_end/core/common/MapWithDefault.ts +0 -26
- package/lib/front_end/core/common/Mutex.ts +0 -55
- package/lib/front_end/core/common/Object.ts +0 -145
- package/lib/front_end/core/common/ParsedURL.ts +0 -554
- package/lib/front_end/core/common/Progress.ts +0 -180
- package/lib/front_end/core/common/QueryParamHandler.ts +0 -7
- package/lib/front_end/core/common/ResolverBase.ts +0 -85
- package/lib/front_end/core/common/ResourceType.ts +0 -588
- package/lib/front_end/core/common/ReturnToPanel.ts +0 -17
- package/lib/front_end/core/common/Revealer.ts +0 -192
- package/lib/front_end/core/common/Runnable.ts +0 -41
- package/lib/front_end/core/common/SegmentedRange.ts +0 -87
- package/lib/front_end/core/common/SettingRegistration.ts +0 -339
- package/lib/front_end/core/common/Settings.ts +0 -1497
- package/lib/front_end/core/common/SimpleHistoryManager.ts +0 -124
- package/lib/front_end/core/common/StringOutputStream.ts +0 -26
- package/lib/front_end/core/common/TextDictionary.ts +0 -48
- package/lib/front_end/core/common/Throttler.ts +0 -99
- package/lib/front_end/core/common/Trie.ts +0 -152
- package/lib/front_end/core/common/Worker.ts +0 -60
- package/lib/front_end/core/common/common.ts +0 -81
- package/lib/front_end/core/host/AidaClient.ts +0 -733
- package/lib/front_end/core/host/GdpClient.ts +0 -316
- package/lib/front_end/core/host/InspectorFrontendHost.ts +0 -648
- package/lib/front_end/core/host/InspectorFrontendHostAPI.ts +0 -551
- package/lib/front_end/core/host/Platform.ts +0 -76
- package/lib/front_end/core/host/ResourceLoader.ts +0 -282
- package/lib/front_end/core/host/UserMetrics.ts +0 -1230
- package/lib/front_end/core/host/host.ts +0 -23
- package/lib/front_end/core/i18n/ByteUtilities.ts +0 -82
- package/lib/front_end/core/i18n/DevToolsLocale.ts +0 -87
- package/lib/front_end/core/i18n/NumberFormatter.ts +0 -82
- package/lib/front_end/core/i18n/i18n.ts +0 -17
- package/lib/front_end/core/i18n/i18nImpl.ts +0 -204
- package/lib/front_end/core/i18n/i18nTypes.ts +0 -10
- package/lib/front_end/core/i18n/locales.js +0 -14
- package/lib/front_end/core/i18n/time-utilities.ts +0 -174
- package/lib/front_end/core/platform/ArrayUtilities.ts +0 -271
- package/lib/front_end/core/platform/Brand.ts +0 -23
- package/lib/front_end/core/platform/Constructor.ts +0 -10
- package/lib/front_end/core/platform/DOMUtilities.ts +0 -138
- package/lib/front_end/core/platform/DateUtilities.ts +0 -15
- package/lib/front_end/core/platform/DevToolsPath.ts +0 -53
- package/lib/front_end/core/platform/KeyboardUtilities.ts +0 -38
- package/lib/front_end/core/platform/MapUtilities.ts +0 -95
- package/lib/front_end/core/platform/MimeType.ts +0 -175
- package/lib/front_end/core/platform/NumberUtilities.ts +0 -80
- package/lib/front_end/core/platform/StringUtilities.ts +0 -588
- package/lib/front_end/core/platform/Timing.ts +0 -17
- package/lib/front_end/core/platform/TypedArrayUtilities.ts +0 -189
- package/lib/front_end/core/platform/TypescriptUtilities.ts +0 -86
- package/lib/front_end/core/platform/UIString.ts +0 -39
- package/lib/front_end/core/platform/UserVisibleError.ts +0 -28
- package/lib/front_end/core/platform/platform.ts +0 -45
- package/lib/front_end/core/protocol_client/ConnectionTransport.ts +0 -26
- package/lib/front_end/core/protocol_client/InspectorBackend.ts +0 -1050
- package/lib/front_end/core/protocol_client/NodeURL.ts +0 -42
- package/lib/front_end/core/protocol_client/protocol_client.ts +0 -13
- package/lib/front_end/core/root/Runtime.ts +0 -609
- package/lib/front_end/core/root/root.ts +0 -6
- package/lib/front_end/core/sdk/AccessibilityModel.ts +0 -353
- package/lib/front_end/core/sdk/AnimationModel.ts +0 -1041
- package/lib/front_end/core/sdk/AutofillModel.ts +0 -184
- package/lib/front_end/core/sdk/CPUProfilerModel.ts +0 -148
- package/lib/front_end/core/sdk/CPUThrottlingManager.ts +0 -282
- package/lib/front_end/core/sdk/CSSContainerQuery.ts +0 -139
- package/lib/front_end/core/sdk/CSSFontFace.ts +0 -40
- package/lib/front_end/core/sdk/CSSLayer.ts +0 -30
- package/lib/front_end/core/sdk/CSSMatchedStyles.ts +0 -1646
- package/lib/front_end/core/sdk/CSSMedia.ts +0 -121
- package/lib/front_end/core/sdk/CSSMetadata.ts +0 -1647
- package/lib/front_end/core/sdk/CSSModel.ts +0 -1128
- package/lib/front_end/core/sdk/CSSProperty.ts +0 -384
- package/lib/front_end/core/sdk/CSSPropertyParser.ts +0 -681
- package/lib/front_end/core/sdk/CSSPropertyParserMatchers.ts +0 -1395
- package/lib/front_end/core/sdk/CSSQuery.ts +0 -72
- package/lib/front_end/core/sdk/CSSRule.ts +0 -465
- package/lib/front_end/core/sdk/CSSScope.ts +0 -30
- package/lib/front_end/core/sdk/CSSStartingStyle.ts +0 -29
- package/lib/front_end/core/sdk/CSSStyleDeclaration.ts +0 -313
- package/lib/front_end/core/sdk/CSSStyleSheetHeader.ts +0 -196
- package/lib/front_end/core/sdk/CSSSupports.ts +0 -33
- package/lib/front_end/core/sdk/CategorizedBreakpoint.ts +0 -64
- package/lib/front_end/core/sdk/ChildTargetManager.ts +0 -314
- package/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +0 -62
- package/lib/front_end/core/sdk/Connections.ts +0 -293
- package/lib/front_end/core/sdk/ConsoleModel.ts +0 -808
- package/lib/front_end/core/sdk/ConsoleModelTypes.ts +0 -15
- package/lib/front_end/core/sdk/Cookie.ts +0 -319
- package/lib/front_end/core/sdk/CookieModel.ts +0 -239
- package/lib/front_end/core/sdk/CookieParser.ts +0 -185
- package/lib/front_end/core/sdk/DOMDebuggerModel.ts +0 -787
- package/lib/front_end/core/sdk/DOMModel.ts +0 -1961
- package/lib/front_end/core/sdk/DebuggerModel.ts +0 -1605
- package/lib/front_end/core/sdk/EmulationModel.ts +0 -648
- package/lib/front_end/core/sdk/EnhancedTracesParser.ts +0 -515
- package/lib/front_end/core/sdk/EventBreakpointsModel.ts +0 -183
- package/lib/front_end/core/sdk/FrameAssociated.ts +0 -11
- package/lib/front_end/core/sdk/FrameManager.ts +0 -259
- package/lib/front_end/core/sdk/HeapProfilerModel.ts +0 -225
- package/lib/front_end/core/sdk/HttpReasonPhraseStrings.ts +0 -77
- package/lib/front_end/core/sdk/IOModel.ts +0 -91
- package/lib/front_end/core/sdk/IsolateManager.ts +0 -257
- package/lib/front_end/core/sdk/IssuesModel.ts +0 -70
- package/lib/front_end/core/sdk/LayerTreeBase.ts +0 -169
- package/lib/front_end/core/sdk/LogModel.ts +0 -56
- package/lib/front_end/core/sdk/NetworkManager.ts +0 -2823
- package/lib/front_end/core/sdk/NetworkRequest.ts +0 -2253
- package/lib/front_end/core/sdk/OverlayColorGenerator.ts +0 -52
- package/lib/front_end/core/sdk/OverlayModel.ts +0 -1011
- package/lib/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -522
- package/lib/front_end/core/sdk/PageLoad.ts +0 -35
- package/lib/front_end/core/sdk/PageResourceLoader.ts +0 -435
- package/lib/front_end/core/sdk/PaintProfiler.ts +0 -110
- package/lib/front_end/core/sdk/PerformanceMetricsModel.ts +0 -84
- package/lib/front_end/core/sdk/PreloadingModel.ts +0 -863
- package/lib/front_end/core/sdk/RehydratingConnection.ts +0 -386
- package/lib/front_end/core/sdk/RehydratingObject.ts +0 -66
- package/lib/front_end/core/sdk/RemoteObject.ts +0 -1160
- package/lib/front_end/core/sdk/Resource.ts +0 -232
- package/lib/front_end/core/sdk/ResourceTreeModel.ts +0 -1160
- package/lib/front_end/core/sdk/RuntimeModel.ts +0 -732
- package/lib/front_end/core/sdk/SDKModel.ts +0 -65
- package/lib/front_end/core/sdk/ScopeTreeCache.ts +0 -45
- package/lib/front_end/core/sdk/ScreenCaptureModel.ts +0 -255
- package/lib/front_end/core/sdk/Script.ts +0 -534
- package/lib/front_end/core/sdk/SecurityOriginManager.ts +0 -76
- package/lib/front_end/core/sdk/ServerSentEvents.ts +0 -80
- package/lib/front_end/core/sdk/ServerSentEventsProtocol.ts +0 -122
- package/lib/front_end/core/sdk/ServerTiming.ts +0 -260
- package/lib/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -377
- package/lib/front_end/core/sdk/ServiceWorkerManager.ts +0 -605
- package/lib/front_end/core/sdk/SourceMap.ts +0 -867
- package/lib/front_end/core/sdk/SourceMapCache.ts +0 -54
- package/lib/front_end/core/sdk/SourceMapFunctionRanges.ts +0 -156
- package/lib/front_end/core/sdk/SourceMapManager.ts +0 -239
- package/lib/front_end/core/sdk/SourceMapScopeChainEntry.ts +0 -189
- package/lib/front_end/core/sdk/SourceMapScopesInfo.ts +0 -508
- package/lib/front_end/core/sdk/StorageBucketsModel.ts +0 -204
- package/lib/front_end/core/sdk/StorageKeyManager.ts +0 -98
- package/lib/front_end/core/sdk/Target.ts +0 -332
- package/lib/front_end/core/sdk/TargetManager.ts +0 -453
- package/lib/front_end/core/sdk/TraceObject.ts +0 -61
- package/lib/front_end/core/sdk/WebAuthnModel.ts +0 -104
- package/lib/front_end/core/sdk/sdk.ts +0 -174
- package/lib/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -59
- package/lib/front_end/generated/InspectorBackendCommands.js +0 -1617
- package/lib/front_end/generated/SupportedCSSProperties.js +0 -7512
- package/lib/front_end/generated/protocol-proxy-api.d.ts +0 -5022
- package/lib/front_end/generated/protocol.ts +0 -22014
- package/lib/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -318
- package/lib/front_end/models/bindings/CompilerScriptMapping.ts +0 -536
- package/lib/front_end/models/bindings/ContentProviderBasedProject.ts +0 -187
- package/lib/front_end/models/bindings/DebuggerLanguagePlugins.ts +0 -1197
- package/lib/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -733
- package/lib/front_end/models/bindings/DefaultScriptMapping.ts +0 -141
- package/lib/front_end/models/bindings/FileUtils.ts +0 -228
- package/lib/front_end/models/bindings/LiveLocation.ts +0 -81
- package/lib/front_end/models/bindings/NetworkProject.ts +0 -157
- package/lib/front_end/models/bindings/PresentationConsoleMessageHelper.ts +0 -312
- package/lib/front_end/models/bindings/ResourceMapping.ts +0 -539
- package/lib/front_end/models/bindings/ResourceScriptMapping.ts +0 -491
- package/lib/front_end/models/bindings/ResourceUtils.ts +0 -103
- package/lib/front_end/models/bindings/SASSSourceMapping.ts +0 -222
- package/lib/front_end/models/bindings/StylesSourceMapping.ts +0 -316
- package/lib/front_end/models/bindings/TempFile.ts +0 -67
- package/lib/front_end/models/bindings/bindings.ts +0 -39
- package/lib/front_end/models/cpu_profile/CPUProfileDataModel.ts +0 -571
- package/lib/front_end/models/cpu_profile/ProfileTreeModel.ts +0 -103
- package/lib/front_end/models/cpu_profile/cpu_profile.ts +0 -11
- package/lib/front_end/models/formatter/FormatterWorkerPool.ts +0 -219
- package/lib/front_end/models/formatter/ScriptFormatter.ts +0 -112
- package/lib/front_end/models/formatter/formatter.ts +0 -8
- package/lib/front_end/models/source_map_scopes/NamesResolver.ts +0 -765
- package/lib/front_end/models/source_map_scopes/ScopeChainModel.ts +0 -84
- package/lib/front_end/models/source_map_scopes/source_map_scopes.ts +0 -11
- package/lib/front_end/models/stack_trace/StackTrace.ts +0 -53
- package/lib/front_end/models/stack_trace/StackTraceImpl.ts +0 -85
- package/lib/front_end/models/stack_trace/StackTraceModel.ts +0 -128
- package/lib/front_end/models/stack_trace/Trie.ts +0 -163
- package/lib/front_end/models/stack_trace/stack_trace.ts +0 -9
- package/lib/front_end/models/stack_trace/stack_trace_impl.ts +0 -13
- package/lib/front_end/models/text_utils/CodeMirrorUtils.ts +0 -37
- package/lib/front_end/models/text_utils/ContentData.ts +0 -199
- package/lib/front_end/models/text_utils/ContentProvider.ts +0 -68
- package/lib/front_end/models/text_utils/StaticContentProvider.ts +0 -49
- package/lib/front_end/models/text_utils/StreamingContentData.ts +0 -108
- package/lib/front_end/models/text_utils/Text.ts +0 -90
- package/lib/front_end/models/text_utils/TextCursor.ts +0 -44
- package/lib/front_end/models/text_utils/TextRange.ts +0 -266
- package/lib/front_end/models/text_utils/TextUtils.ts +0 -401
- package/lib/front_end/models/text_utils/WasmDisassembly.ts +0 -87
- package/lib/front_end/models/text_utils/text_utils.ts +0 -27
- package/lib/front_end/models/trace/EntityMapper.ts +0 -141
- package/lib/front_end/models/trace/EventsSerializer.ts +0 -101
- package/lib/front_end/models/trace/LanternComputationData.ts +0 -438
- package/lib/front_end/models/trace/ModelImpl.ts +0 -236
- package/lib/front_end/models/trace/Name.ts +0 -136
- package/lib/front_end/models/trace/Processor.ts +0 -652
- package/lib/front_end/models/trace/Styles.ts +0 -1138
- package/lib/front_end/models/trace/extras/FilmStrip.ts +0 -78
- package/lib/front_end/models/trace/extras/MainThreadActivity.ts +0 -86
- package/lib/front_end/models/trace/extras/ScriptDuplication.ts +0 -236
- package/lib/front_end/models/trace/extras/StackTraceForEvent.ts +0 -203
- package/lib/front_end/models/trace/extras/ThirdParties.ts +0 -164
- package/lib/front_end/models/trace/extras/TraceFilter.ts +0 -62
- package/lib/front_end/models/trace/extras/TraceTree.ts +0 -701
- package/lib/front_end/models/trace/extras/extras.ts +0 -11
- package/lib/front_end/models/trace/handlers/AnimationFramesHandler.ts +0 -128
- package/lib/front_end/models/trace/handlers/AnimationHandler.ts +0 -36
- package/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +0 -239
- package/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +0 -183
- package/lib/front_end/models/trace/handlers/DOMStatsHandler.ts +0 -31
- package/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +0 -306
- package/lib/front_end/models/trace/handlers/FlowsHandler.ts +0 -175
- package/lib/front_end/models/trace/handlers/FramesHandler.ts +0 -571
- package/lib/front_end/models/trace/handlers/GPUHandler.ts +0 -50
- package/lib/front_end/models/trace/handlers/ImagePaintingHandler.ts +0 -183
- package/lib/front_end/models/trace/handlers/InitiatorsHandler.ts +0 -193
- package/lib/front_end/models/trace/handlers/InvalidationsHandler.ts +0 -168
- package/lib/front_end/models/trace/handlers/LargestImagePaintHandler.ts +0 -109
- package/lib/front_end/models/trace/handlers/LargestTextPaintHandler.ts +0 -35
- package/lib/front_end/models/trace/handlers/LayerTreeHandler.ts +0 -123
- package/lib/front_end/models/trace/handlers/LayoutShiftsHandler.ts +0 -573
- package/lib/front_end/models/trace/handlers/MemoryHandler.ts +0 -31
- package/lib/front_end/models/trace/handlers/MetaHandler.ts +0 -525
- package/lib/front_end/models/trace/handlers/ModelHandlers.ts +0 -34
- package/lib/front_end/models/trace/handlers/NetworkRequestsHandler.ts +0 -672
- package/lib/front_end/models/trace/handlers/PageFramesHandler.ts +0 -52
- package/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +0 -460
- package/lib/front_end/models/trace/handlers/RendererHandler.ts +0 -428
- package/lib/front_end/models/trace/handlers/SamplesHandler.ts +0 -271
- package/lib/front_end/models/trace/handlers/ScreenshotsHandler.ts +0 -122
- package/lib/front_end/models/trace/handlers/ScriptsHandler.ts +0 -336
- package/lib/front_end/models/trace/handlers/SelectorStatsHandler.ts +0 -110
- package/lib/front_end/models/trace/handlers/Threads.ts +0 -139
- package/lib/front_end/models/trace/handlers/UserInteractionsHandler.ts +0 -400
- package/lib/front_end/models/trace/handlers/UserTimingsHandler.ts +0 -233
- package/lib/front_end/models/trace/handlers/WarningsHandler.ts +0 -162
- package/lib/front_end/models/trace/handlers/WorkersHandler.ts +0 -45
- package/lib/front_end/models/trace/handlers/handlers.ts +0 -8
- package/lib/front_end/models/trace/handlers/helpers.ts +0 -196
- package/lib/front_end/models/trace/handlers/types.ts +0 -75
- package/lib/front_end/models/trace/helpers/Extensions.ts +0 -54
- package/lib/front_end/models/trace/helpers/Network.ts +0 -129
- package/lib/front_end/models/trace/helpers/SamplesIntegrator.ts +0 -544
- package/lib/front_end/models/trace/helpers/SyntheticEvents.ts +0 -87
- package/lib/front_end/models/trace/helpers/Timing.ts +0 -248
- package/lib/front_end/models/trace/helpers/Trace.ts +0 -928
- package/lib/front_end/models/trace/helpers/TreeHelpers.ts +0 -320
- package/lib/front_end/models/trace/helpers/helpers.ts +0 -11
- package/lib/front_end/models/trace/insights/CLSCulprits.ts +0 -668
- package/lib/front_end/models/trace/insights/Cache.ts +0 -269
- package/lib/front_end/models/trace/insights/Common.ts +0 -453
- package/lib/front_end/models/trace/insights/DOMSize.ts +0 -223
- package/lib/front_end/models/trace/insights/DocumentLatency.ts +0 -319
- package/lib/front_end/models/trace/insights/DuplicatedJavaScript.ts +0 -126
- package/lib/front_end/models/trace/insights/FontDisplay.ts +0 -119
- package/lib/front_end/models/trace/insights/ForcedReflow.ts +0 -220
- package/lib/front_end/models/trace/insights/INPBreakdown.ts +0 -171
- package/lib/front_end/models/trace/insights/ImageDelivery.ts +0 -348
- package/lib/front_end/models/trace/insights/LCPBreakdown.ts +0 -268
- package/lib/front_end/models/trace/insights/LCPDiscovery.ts +0 -237
- package/lib/front_end/models/trace/insights/LegacyJavaScript.ts +0 -138
- package/lib/front_end/models/trace/insights/Models.ts +0 -22
- package/lib/front_end/models/trace/insights/ModernHTTP.ts +0 -257
- package/lib/front_end/models/trace/insights/NetworkDependencyTree.ts +0 -726
- package/lib/front_end/models/trace/insights/RenderBlocking.ts +0 -257
- package/lib/front_end/models/trace/insights/SlowCSSSelector.ts +0 -175
- package/lib/front_end/models/trace/insights/Statistics.ts +0 -101
- package/lib/front_end/models/trace/insights/ThirdParties.ts +0 -130
- package/lib/front_end/models/trace/insights/Viewport.ts +0 -138
- package/lib/front_end/models/trace/insights/insights.ts +0 -10
- package/lib/front_end/models/trace/insights/types.ts +0 -157
- package/lib/front_end/models/trace/lantern/core/LanternError.ts +0 -7
- package/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +0 -619
- package/lib/front_end/models/trace/lantern/core/core.ts +0 -6
- package/lib/front_end/models/trace/lantern/graph/BaseNode.ts +0 -345
- package/lib/front_end/models/trace/lantern/graph/CPUNode.ts +0 -80
- package/lib/front_end/models/trace/lantern/graph/NetworkNode.ts +0 -101
- package/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +0 -636
- package/lib/front_end/models/trace/lantern/graph/graph.ts +0 -8
- package/lib/front_end/models/trace/lantern/lantern.ts +0 -17
- package/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts +0 -187
- package/lib/front_end/models/trace/lantern/metrics/Interactive.ts +0 -88
- package/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +0 -92
- package/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.ts +0 -72
- package/lib/front_end/models/trace/lantern/metrics/Metric.ts +0 -126
- package/lib/front_end/models/trace/lantern/metrics/SpeedIndex.ts +0 -126
- package/lib/front_end/models/trace/lantern/metrics/TBTUtils.ts +0 -82
- package/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +0 -112
- package/lib/front_end/models/trace/lantern/metrics/metrics.ts +0 -12
- package/lib/front_end/models/trace/lantern/simulation/ConnectionPool.ts +0 -150
- package/lib/front_end/models/trace/lantern/simulation/Constants.ts +0 -46
- package/lib/front_end/models/trace/lantern/simulation/DNSCache.ts +0 -61
- package/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.ts +0 -196
- package/lib/front_end/models/trace/lantern/simulation/Simulator.ts +0 -556
- package/lib/front_end/models/trace/lantern/simulation/TCPConnection.ts +0 -192
- package/lib/front_end/models/trace/lantern/simulation/simulation.ts +0 -10
- package/lib/front_end/models/trace/lantern/types/Lantern.ts +0 -220
- package/lib/front_end/models/trace/lantern/types/types.ts +0 -5
- package/lib/front_end/models/trace/trace.ts +0 -33
- package/lib/front_end/models/trace/types/Configuration.ts +0 -110
- package/lib/front_end/models/trace/types/Extensions.ts +0 -136
- package/lib/front_end/models/trace/types/File.ts +0 -281
- package/lib/front_end/models/trace/types/Overlays.ts +0 -138
- package/lib/front_end/models/trace/types/Timing.ts +0 -30
- package/lib/front_end/models/trace/types/TraceEvents.ts +0 -3277
- package/lib/front_end/models/trace/types/types.ts +0 -10
- package/lib/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +0 -240
- package/lib/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +0 -5
- package/lib/front_end/models/workspace/FileManager.ts +0 -97
- package/lib/front_end/models/workspace/IgnoreListManager.ts +0 -628
- package/lib/front_end/models/workspace/SearchConfig.ts +0 -149
- package/lib/front_end/models/workspace/UISourceCode.ts +0 -698
- package/lib/front_end/models/workspace/WorkspaceImpl.ts +0 -339
- package/lib/front_end/models/workspace/workspace.ts +0 -17
- package/lib/front_end/panels/timeline/TimelineUIUtils.ts +0 -1029
- package/lib/front_end/panels/timeline/extensions/ExtensionUI.ts +0 -49
- package/lib/front_end/panels/timeline/extensions/extensions.ts +0 -9
- package/lib/front_end/third_party/codemirror.next/LICENSE +0 -21
- package/lib/front_end/third_party/codemirror.next/README.chromium +0 -30
- package/lib/front_end/third_party/codemirror.next/bundle-tsconfig.json +0 -24
- package/lib/front_end/third_party/codemirror.next/bundle.ts +0 -135
- package/lib/front_end/third_party/codemirror.next/chunk/angular.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/angular.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/cpp.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/cpp.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/css.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/html.js +0 -4
- package/lib/front_end/third_party/codemirror.next/chunk/java.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/java.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/javascript.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/legacy.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/legacy.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/less.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/less.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/markdown.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/markdown.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/php.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/php.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/python.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/python.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/sass.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/sass.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/svelte.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/svelte.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/vue.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/vue.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/wast.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/wast.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/xml.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/xml.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/codemirror.next.d.ts +0 -8057
- package/lib/front_end/third_party/codemirror.next/codemirror.next.js +0 -2
- package/lib/front_end/third_party/codemirror.next/codemirror.next.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/package.json +0 -43
- package/lib/front_end/third_party/codemirror.next/rebuild.sh +0 -6
- package/lib/front_end/third_party/codemirror.next/rollup.config.mjs +0 -49
- package/lib/front_end/third_party/i18n/LICENSE +0 -202
- package/lib/front_end/third_party/i18n/README.chromium +0 -15
- package/lib/front_end/third_party/i18n/i18n-impl.ts +0 -61
- package/lib/front_end/third_party/i18n/i18n.ts +0 -11
- package/lib/front_end/third_party/i18n/localized-string-set.ts +0 -129
- package/lib/front_end/third_party/intl-messageformat/LICENSE +0 -33
- package/lib/front_end/third_party/intl-messageformat/README.chromium +0 -24
- package/lib/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +0 -16
- package/lib/front_end/third_party/intl-messageformat/intl-messageformat.ts +0 -6
- package/lib/front_end/third_party/intl-messageformat/package/LICENSE.md +0 -33
- package/lib/front_end/third_party/intl-messageformat/package/README.md +0 -3
- package/lib/front_end/third_party/intl-messageformat/package/index.d.ts +0 -6
- package/lib/front_end/third_party/intl-messageformat/package/index.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/index.js +0 -13
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.d.ts +0 -5
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js +0 -1710
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.iife.js +0 -1815
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts +0 -6
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.js +0 -10
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts +0 -34
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.js +0 -229
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts +0 -28
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.js +0 -48
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts +0 -34
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.js +0 -179
- package/lib/front_end/third_party/intl-messageformat/package/package.json +0 -42
- package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts +0 -34
- package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/src/core.js +0 -230
- package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts +0 -28
- package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/src/error.js +0 -51
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts +0 -34
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.js +0 -182
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts +0 -79
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts +0 -15
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/parser.d.ts +0 -153
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/types.d.ts +0 -139
- package/lib/front_end/third_party/legacy-javascript/LICENSE +0 -202
- package/lib/front_end/third_party/legacy-javascript/README.chromium +0 -13
- package/lib/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +0 -8
- package/lib/front_end/third_party/legacy-javascript/legacy-javascript.ts +0 -3
- package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.d.ts +0 -18
- package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +0 -943
- package/lib/front_end/third_party/legacy-javascript/package.json +0 -8
- package/lib/front_end/third_party/legacy-javascript/rebuild.sh +0 -9
- package/lib/front_end/third_party/source-map-scopes-codec/LICENSE +0 -26
- package/lib/front_end/third_party/source-map-scopes-codec/README.chromium +0 -31
- package/lib/front_end/third_party/source-map-scopes-codec/package/CONTRIBUTING.md +0 -33
- package/lib/front_end/third_party/source-map-scopes-codec/package/LICENSE +0 -26
- package/lib/front_end/third_party/source-map-scopes-codec/package/README.md +0 -64
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +0 -62
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +0 -37
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +0 -29
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +0 -8
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +0 -6
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/deno.json +0 -21
- package/lib/front_end/third_party/source-map-scopes-codec/package/package.json +0 -14
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js +0 -196
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +0 -262
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js +0 -235
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +0 -359
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js +0 -39
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +0 -53
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +0 -438
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +0 -539
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js +0 -23
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +0 -35
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +0 -257
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +0 -348
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js +0 -8
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +0 -20
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +0 -8
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes.d.ts +0 -184
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js +0 -9
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.ts +0 -12
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js +0 -82
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.ts +0 -99
- package/lib/front_end/third_party/source-map-scopes-codec/source-map-scopes-codec.ts +0 -5
- package/lib/front_end/third_party/third-party-web/LICENSE +0 -20
- package/lib/front_end/third_party/third-party-web/README.chromium +0 -13
- package/lib/front_end/third_party/third-party-web/lib/nostats-subset.d.ts +0 -2
- package/lib/front_end/third_party/third-party-web/lib/nostats-subset.js +0 -149
- package/lib/front_end/third_party/third-party-web/package/LICENSE +0 -20
- package/lib/front_end/third_party/third-party-web/package/README.md +0 -929
- package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +0 -1
- package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +0 -1
- package/lib/front_end/third_party/third-party-web/package/dist/entities-nostats.json +0 -1
- package/lib/front_end/third_party/third-party-web/package/dist/entities.json +0 -1
- package/lib/front_end/third_party/third-party-web/package/facades.md +0 -46
- package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.js +0 -1
- package/lib/front_end/third_party/third-party-web/package/httparchive-subset.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/httparchive-subset.js +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/__snapshots__/index.test.js.snap +0 -1006
- package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +0 -139
- package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +0 -44
- package/lib/front_end/third_party/third-party-web/package/lib/entities.test.js +0 -27
- package/lib/front_end/third_party/third-party-web/package/lib/index.d.ts +0 -34
- package/lib/front_end/third_party/third-party-web/package/lib/index.js +0 -3
- package/lib/front_end/third_party/third-party-web/package/lib/index.test.js +0 -246
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/faqs.partial.md +0 -36
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/goals.partial.md +0 -9
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/methodology.partial.md +0 -5
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/template.md +0 -151
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-02-01.md +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-03-01.md +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-06.md +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-13.md +0 -14
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2021-01-01.md +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2024-07-01.md +0 -3
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.js +0 -3
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.js +0 -3
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.js +0 -3
- package/lib/front_end/third_party/third-party-web/package/nostats-subset.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/nostats-subset.js +0 -1
- package/lib/front_end/third_party/third-party-web/package/package.json +0 -46
- package/lib/front_end/third_party/third-party-web/package.json +0 -8
- package/lib/front_end/third_party/third-party-web/rebuild.sh +0 -13
- package/lib/front_end/third_party/third-party-web/third-party-web-tsconfig.json +0 -8
- package/lib/front_end/third_party/third-party-web/third-party-web.ts +0 -3
- package/lib/front_end/ui/legacy/theme_support/ThemeSupport.ts +0 -222
- package/lib/front_end/ui/legacy/theme_support/theme_support.ts +0 -5
- package/patches/chrome-devtools-frontend+1.0.1533544.patch +0 -1716
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as Graph from '../graph/graph.js';
|
|
6
|
-
import type * as Types from '../types/types.js';
|
|
7
|
-
|
|
8
|
-
import {Metric, type MetricCoefficients} from './Metric.js';
|
|
9
|
-
|
|
10
|
-
interface FirstPaintBasedGraphOpts<T> {
|
|
11
|
-
/**
|
|
12
|
-
* The timestamp used to filter out tasks that occurred after our paint of interest.
|
|
13
|
-
* Typically this is First Contentful Paint or First Meaningful Paint.
|
|
14
|
-
*/
|
|
15
|
-
cutoffTimestamp: number;
|
|
16
|
-
/**
|
|
17
|
-
* The function that determines which resources should be considered *possibly*
|
|
18
|
-
* render-blocking.
|
|
19
|
-
*/
|
|
20
|
-
treatNodeAsRenderBlocking: (node: Graph.NetworkNode<T>) => boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The function that determines which CPU nodes should also be included in our
|
|
23
|
-
* blocking node IDs set, beyond what getRenderBlockingNodeData() already includes.
|
|
24
|
-
*/
|
|
25
|
-
additionalCpuNodesToTreatAsRenderBlocking?: (node: Graph.CPUNode) => boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
class FirstContentfulPaint extends Metric {
|
|
29
|
-
static override get coefficients(): MetricCoefficients {
|
|
30
|
-
return {
|
|
31
|
-
intercept: 0,
|
|
32
|
-
optimistic: 0.5,
|
|
33
|
-
pessimistic: 0.5,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Computes the set of URLs that *appeared* to be render-blocking based on our filter,
|
|
39
|
-
* *but definitely were not* render-blocking based on the timing of their EvaluateScript task.
|
|
40
|
-
* It also computes the set of corresponding CPU node ids that were needed for the paint at the
|
|
41
|
-
* given timestamp.
|
|
42
|
-
*/
|
|
43
|
-
static getRenderBlockingNodeData<T = unknown>(
|
|
44
|
-
graph: Graph.Node,
|
|
45
|
-
{cutoffTimestamp, treatNodeAsRenderBlocking, additionalCpuNodesToTreatAsRenderBlocking}:
|
|
46
|
-
FirstPaintBasedGraphOpts<T>,
|
|
47
|
-
): {definitelyNotRenderBlockingScriptUrls: Set<string>, renderBlockingCpuNodeIds: Set<string>} {
|
|
48
|
-
/** A map of blocking script URLs to the earliest EvaluateScript task node that executed them. */
|
|
49
|
-
const scriptUrlToNodeMap = new Map<string, Graph.CPUNode>();
|
|
50
|
-
|
|
51
|
-
const cpuNodes: Graph.CPUNode[] = [];
|
|
52
|
-
graph.traverse(node => {
|
|
53
|
-
if (node.type === Graph.BaseNode.types.CPU) {
|
|
54
|
-
// A task is *possibly* render blocking if it *started* before cutoffTimestamp.
|
|
55
|
-
// We use startTime here because the paint event can be *inside* the task that was render blocking.
|
|
56
|
-
if (node.startTime <= cutoffTimestamp) {
|
|
57
|
-
cpuNodes.push(node);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Build our script URL map to find the earliest EvaluateScript task node.
|
|
61
|
-
const scriptUrls = node.getEvaluateScriptURLs();
|
|
62
|
-
for (const url of scriptUrls) {
|
|
63
|
-
// Use the earliest CPU node we find.
|
|
64
|
-
const existing = scriptUrlToNodeMap.get(url) || node;
|
|
65
|
-
scriptUrlToNodeMap.set(url, node.startTime < existing.startTime ? node : existing);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
cpuNodes.sort((a, b) => a.startTime - b.startTime);
|
|
71
|
-
|
|
72
|
-
// A script is *possibly* render blocking if it finished loading before cutoffTimestamp.
|
|
73
|
-
const possiblyRenderBlockingScriptUrls = Metric.getScriptUrls(graph, node => {
|
|
74
|
-
// The optimistic LCP treatNodeAsRenderBlocking fn wants to exclude some images in the graph,
|
|
75
|
-
// but here it only receives scripts to evaluate. It's a no-op in this case, but it will
|
|
76
|
-
// matter below in the getFirstPaintBasedGraph clone operation.
|
|
77
|
-
return node.endTime <= cutoffTimestamp && treatNodeAsRenderBlocking(node);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// A script is *definitely not* render blocking if its EvaluateScript task started after cutoffTimestamp.
|
|
81
|
-
const definitelyNotRenderBlockingScriptUrls = new Set<string>();
|
|
82
|
-
const renderBlockingCpuNodeIds = new Set<string>();
|
|
83
|
-
for (const url of possiblyRenderBlockingScriptUrls) {
|
|
84
|
-
// Lookup the CPU node that had the earliest EvaluateScript for this URL.
|
|
85
|
-
const cpuNodeForUrl = scriptUrlToNodeMap.get(url);
|
|
86
|
-
|
|
87
|
-
// If we can't find it at all, we can't conclude anything, so just skip it.
|
|
88
|
-
if (!cpuNodeForUrl) {
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// If we found it and it was in our `cpuNodes` set that means it finished before cutoffTimestamp, so it really is render-blocking.
|
|
93
|
-
if (cpuNodes.includes(cpuNodeForUrl)) {
|
|
94
|
-
renderBlockingCpuNodeIds.add(cpuNodeForUrl.id);
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// We couldn't find the evaluate script in the set of CPU nodes that ran before our paint, so
|
|
99
|
-
// it must not have been necessary for the paint.
|
|
100
|
-
definitelyNotRenderBlockingScriptUrls.add(url);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// The first layout, first paint, and first ParseHTML are almost always necessary for first paint,
|
|
104
|
-
// so we always include those CPU nodes.
|
|
105
|
-
const firstLayout = cpuNodes.find(node => node.didPerformLayout());
|
|
106
|
-
if (firstLayout) {
|
|
107
|
-
renderBlockingCpuNodeIds.add(firstLayout.id);
|
|
108
|
-
}
|
|
109
|
-
const firstPaint = cpuNodes.find(node => node.childEvents.some(e => e.name === 'Paint'));
|
|
110
|
-
if (firstPaint) {
|
|
111
|
-
renderBlockingCpuNodeIds.add(firstPaint.id);
|
|
112
|
-
}
|
|
113
|
-
const firstParse = cpuNodes.find(node => node.childEvents.some(e => e.name === 'ParseHTML'));
|
|
114
|
-
if (firstParse) {
|
|
115
|
-
renderBlockingCpuNodeIds.add(firstParse.id);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// If a CPU filter was passed in, we also want to include those extra nodes.
|
|
119
|
-
if (additionalCpuNodesToTreatAsRenderBlocking) {
|
|
120
|
-
cpuNodes.filter(additionalCpuNodesToTreatAsRenderBlocking).forEach(node => renderBlockingCpuNodeIds.add(node.id));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
definitelyNotRenderBlockingScriptUrls,
|
|
125
|
-
renderBlockingCpuNodeIds,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Computes the graph required for the first paint of interest.
|
|
131
|
-
*/
|
|
132
|
-
static getFirstPaintBasedGraph<T>(
|
|
133
|
-
dependencyGraph: Graph.Node,
|
|
134
|
-
{cutoffTimestamp, treatNodeAsRenderBlocking, additionalCpuNodesToTreatAsRenderBlocking}:
|
|
135
|
-
FirstPaintBasedGraphOpts<T>,
|
|
136
|
-
): Graph.Node<T> {
|
|
137
|
-
const rbData = this.getRenderBlockingNodeData(dependencyGraph, {
|
|
138
|
-
cutoffTimestamp,
|
|
139
|
-
treatNodeAsRenderBlocking,
|
|
140
|
-
additionalCpuNodesToTreatAsRenderBlocking,
|
|
141
|
-
});
|
|
142
|
-
const {definitelyNotRenderBlockingScriptUrls, renderBlockingCpuNodeIds} = rbData;
|
|
143
|
-
|
|
144
|
-
return dependencyGraph.cloneWithRelationships(node => {
|
|
145
|
-
if (node.type === Graph.BaseNode.types.NETWORK) {
|
|
146
|
-
// Exclude all nodes that ended after cutoffTimestamp (except for the main document which we always consider necessary)
|
|
147
|
-
// endTime is negative if request does not finish, make sure startTime isn't after cutoffTimestamp in this case.
|
|
148
|
-
const endedAfterPaint = node.endTime > cutoffTimestamp || node.startTime > cutoffTimestamp;
|
|
149
|
-
if (endedAfterPaint && !node.isMainDocument()) {
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const url = node.request.url;
|
|
154
|
-
// If the URL definitely wasn't render-blocking then we filter it out.
|
|
155
|
-
if (definitelyNotRenderBlockingScriptUrls.has(url)) {
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Lastly, build up the FCP graph of all nodes we consider render blocking
|
|
160
|
-
return treatNodeAsRenderBlocking(node);
|
|
161
|
-
}
|
|
162
|
-
// If it's a CPU node, just check if it was blocking.
|
|
163
|
-
return renderBlockingCpuNodeIds.has(node.id);
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
static override getOptimisticGraph<T>(
|
|
168
|
-
dependencyGraph: Graph.Node<T>, processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node<T> {
|
|
169
|
-
return this.getFirstPaintBasedGraph(dependencyGraph, {
|
|
170
|
-
cutoffTimestamp: processedNavigation.timestamps.firstContentfulPaint,
|
|
171
|
-
// In the optimistic graph we exclude resources that appeared to be render blocking but were
|
|
172
|
-
// initiated by a script. While they typically have a very high importance and tend to have a
|
|
173
|
-
// significant impact on the page's content, these resources don't technically block rendering.
|
|
174
|
-
treatNodeAsRenderBlocking: node => node.hasRenderBlockingPriority() && node.initiatorType !== 'script',
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
static override getPessimisticGraph<T>(
|
|
179
|
-
dependencyGraph: Graph.Node<T>, processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node<T> {
|
|
180
|
-
return this.getFirstPaintBasedGraph(dependencyGraph, {
|
|
181
|
-
cutoffTimestamp: processedNavigation.timestamps.firstContentfulPaint,
|
|
182
|
-
treatNodeAsRenderBlocking: node => node.hasRenderBlockingPriority(),
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export {FirstContentfulPaint};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as Core from '../core/core.js';
|
|
6
|
-
import * as Graph from '../graph/graph.js';
|
|
7
|
-
import type * as Simulation from '../simulation/simulation.js';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
type Extras,
|
|
11
|
-
Metric,
|
|
12
|
-
type MetricCoefficients,
|
|
13
|
-
type MetricComputationDataInput,
|
|
14
|
-
type MetricResult,
|
|
15
|
-
} from './Metric.js';
|
|
16
|
-
|
|
17
|
-
// Any CPU task of 20 ms or more will end up being a critical long task on mobile
|
|
18
|
-
const CRITICAL_LONG_TASK_THRESHOLD = 20;
|
|
19
|
-
|
|
20
|
-
class Interactive extends Metric {
|
|
21
|
-
static override get coefficients(): MetricCoefficients {
|
|
22
|
-
return {
|
|
23
|
-
intercept: 0,
|
|
24
|
-
optimistic: 0.45,
|
|
25
|
-
pessimistic: 0.55,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static override getOptimisticGraph<T>(dependencyGraph: Graph.Node<T>): Graph.Node<T> {
|
|
30
|
-
// Adjust the critical long task threshold for microseconds
|
|
31
|
-
const minimumCpuTaskDuration = CRITICAL_LONG_TASK_THRESHOLD * 1000;
|
|
32
|
-
|
|
33
|
-
return dependencyGraph.cloneWithRelationships(node => {
|
|
34
|
-
// Include everything that might be a long task
|
|
35
|
-
if (node.type === Graph.BaseNode.types.CPU) {
|
|
36
|
-
return node.duration > minimumCpuTaskDuration;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Include all scripts and high priority requests, exclude all images
|
|
40
|
-
const isImage = node.request.resourceType === 'Image';
|
|
41
|
-
const isScript = node.request.resourceType === 'Script';
|
|
42
|
-
return (!isImage && (isScript || node.request.priority === 'High' || node.request.priority === 'VeryHigh'));
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
static override getPessimisticGraph<T>(dependencyGraph: Graph.Node<T>): Graph.Node<T> {
|
|
47
|
-
return dependencyGraph;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
static override getEstimateFromSimulation(simulationResult: Simulation.Result, extras: Extras): Simulation.Result {
|
|
51
|
-
if (!extras.lcpResult) {
|
|
52
|
-
throw new Core.LanternError('missing lcpResult');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const lastTaskAt = Interactive.getLastLongTaskEndTime(simulationResult.nodeTimings);
|
|
56
|
-
const minimumTime = extras.optimistic ? extras.lcpResult.optimisticEstimate.timeInMs :
|
|
57
|
-
extras.lcpResult.pessimisticEstimate.timeInMs;
|
|
58
|
-
return {
|
|
59
|
-
timeInMs: Math.max(minimumTime, lastTaskAt),
|
|
60
|
-
nodeTimings: simulationResult.nodeTimings,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
static override compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult {
|
|
65
|
-
const lcpResult = extras?.lcpResult;
|
|
66
|
-
if (!lcpResult) {
|
|
67
|
-
throw new Core.LanternError('LCP is required to calculate the Interactive metric');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const metricResult = super.compute(data, extras);
|
|
71
|
-
metricResult.timing = Math.max(metricResult.timing, lcpResult.timing);
|
|
72
|
-
return metricResult;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
static getLastLongTaskEndTime(nodeTimings: Simulation.Result['nodeTimings'], duration = 50): number {
|
|
76
|
-
return Array.from(nodeTimings.entries())
|
|
77
|
-
.filter(([node, timing]) => {
|
|
78
|
-
if (node.type !== Graph.BaseNode.types.CPU) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
return timing.duration > duration;
|
|
82
|
-
})
|
|
83
|
-
.map(([_, timing]) => timing.endTime)
|
|
84
|
-
.reduce((max, x) => Math.max(max || 0, x || 0), 0);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export {Interactive};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as Core from '../core/core.js';
|
|
6
|
-
import type * as Graph from '../graph/graph.js';
|
|
7
|
-
import type * as Simulation from '../simulation/simulation.js';
|
|
8
|
-
import type * as Types from '../types/types.js';
|
|
9
|
-
|
|
10
|
-
import {FirstContentfulPaint} from './FirstContentfulPaint.js';
|
|
11
|
-
import {
|
|
12
|
-
type Extras,
|
|
13
|
-
Metric,
|
|
14
|
-
type MetricCoefficients,
|
|
15
|
-
type MetricComputationDataInput,
|
|
16
|
-
type MetricResult,
|
|
17
|
-
} from './Metric.js';
|
|
18
|
-
|
|
19
|
-
class LargestContentfulPaint extends Metric {
|
|
20
|
-
static override get coefficients(): MetricCoefficients {
|
|
21
|
-
return {
|
|
22
|
-
intercept: 0,
|
|
23
|
-
optimistic: 0.5,
|
|
24
|
-
pessimistic: 0.5,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Low priority image nodes are usually offscreen and very unlikely to be the
|
|
30
|
-
* resource that is required for LCP. Our LCP graphs include everything except for these images.
|
|
31
|
-
*/
|
|
32
|
-
static isNotLowPriorityImageNode(node: Graph.Node): boolean {
|
|
33
|
-
if (node.type !== 'network') {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
const isImage = node.request.resourceType === 'Image';
|
|
37
|
-
const isLowPriority = node.request.priority === 'Low' || node.request.priority === 'VeryLow';
|
|
38
|
-
return !isImage || !isLowPriority;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
static override getOptimisticGraph(
|
|
42
|
-
dependencyGraph: Graph.Node, processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node {
|
|
43
|
-
const lcp = processedNavigation.timestamps.largestContentfulPaint;
|
|
44
|
-
if (!lcp) {
|
|
45
|
-
throw new Core.LanternError('NO_LCP');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return FirstContentfulPaint.getFirstPaintBasedGraph(dependencyGraph, {
|
|
49
|
-
cutoffTimestamp: lcp,
|
|
50
|
-
treatNodeAsRenderBlocking: LargestContentfulPaint.isNotLowPriorityImageNode,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
static override getPessimisticGraph(
|
|
55
|
-
dependencyGraph: Graph.Node, processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node {
|
|
56
|
-
const lcp = processedNavigation.timestamps.largestContentfulPaint;
|
|
57
|
-
if (!lcp) {
|
|
58
|
-
throw new Core.LanternError('NO_LCP');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return FirstContentfulPaint.getFirstPaintBasedGraph(dependencyGraph, {
|
|
62
|
-
cutoffTimestamp: lcp,
|
|
63
|
-
treatNodeAsRenderBlocking: _ => true,
|
|
64
|
-
// For pessimistic LCP we'll include *all* layout nodes
|
|
65
|
-
additionalCpuNodesToTreatAsRenderBlocking: node => node.didPerformLayout(),
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
static override getEstimateFromSimulation(simulationResult: Simulation.Result): Simulation.Result {
|
|
70
|
-
const nodeTimesNotOffscreenImages = Array.from(simulationResult.nodeTimings.entries())
|
|
71
|
-
.filter(entry => LargestContentfulPaint.isNotLowPriorityImageNode(entry[0]))
|
|
72
|
-
.map(entry => entry[1].endTime);
|
|
73
|
-
|
|
74
|
-
return {
|
|
75
|
-
timeInMs: Math.max(...nodeTimesNotOffscreenImages),
|
|
76
|
-
nodeTimings: simulationResult.nodeTimings,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
static override compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult {
|
|
81
|
-
const fcpResult = extras?.fcpResult;
|
|
82
|
-
if (!fcpResult) {
|
|
83
|
-
throw new Core.LanternError('FCP is required to calculate the LCP metric');
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const metricResult = super.compute(data, extras);
|
|
87
|
-
metricResult.timing = Math.max(metricResult.timing, fcpResult.timing);
|
|
88
|
-
return metricResult;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export {LargestContentfulPaint};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as Core from '../core/core.js';
|
|
6
|
-
import * as Graph from '../graph/graph.js';
|
|
7
|
-
import type * as Simulation from '../simulation/simulation.js';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
type Extras,
|
|
11
|
-
Metric,
|
|
12
|
-
type MetricCoefficients,
|
|
13
|
-
type MetricComputationDataInput,
|
|
14
|
-
type MetricResult,
|
|
15
|
-
} from './Metric.js';
|
|
16
|
-
|
|
17
|
-
class MaxPotentialFID extends Metric {
|
|
18
|
-
static override get coefficients(): MetricCoefficients {
|
|
19
|
-
return {
|
|
20
|
-
intercept: 0,
|
|
21
|
-
optimistic: 0.5,
|
|
22
|
-
pessimistic: 0.5,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static override getOptimisticGraph(dependencyGraph: Graph.Node): Graph.Node {
|
|
27
|
-
return dependencyGraph;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static override getPessimisticGraph(dependencyGraph: Graph.Node): Graph.Node {
|
|
31
|
-
return dependencyGraph;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static override getEstimateFromSimulation(simulation: Simulation.Result, extras: Extras): Simulation.Result {
|
|
35
|
-
if (!extras.fcpResult) {
|
|
36
|
-
throw new Core.LanternError('missing fcpResult');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Intentionally use the opposite FCP estimate, a more pessimistic FCP means that more tasks
|
|
40
|
-
// are excluded from the FID computation, so a higher FCP means lower FID for same work.
|
|
41
|
-
const fcpTimeInMs = extras.optimistic ? extras.fcpResult.pessimisticEstimate.timeInMs :
|
|
42
|
-
extras.fcpResult.optimisticEstimate.timeInMs;
|
|
43
|
-
|
|
44
|
-
const timings = MaxPotentialFID.getTimingsAfterFCP(
|
|
45
|
-
simulation.nodeTimings,
|
|
46
|
-
fcpTimeInMs,
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
timeInMs: Math.max(...timings.map(timing => timing.duration), 16),
|
|
51
|
-
nodeTimings: simulation.nodeTimings,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
static override compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult {
|
|
56
|
-
const fcpResult = extras?.fcpResult;
|
|
57
|
-
if (!fcpResult) {
|
|
58
|
-
throw new Core.LanternError('FCP is required to calculate the Max Potential FID metric');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return super.compute(data, extras);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
static getTimingsAfterFCP(nodeTimings: Simulation.Result['nodeTimings'], fcpTimeInMs: number):
|
|
65
|
-
Array<{duration: number}> {
|
|
66
|
-
return Array.from(nodeTimings.entries())
|
|
67
|
-
.filter(([node, timing]) => node.type === Graph.BaseNode.types.CPU && timing.endTime > fcpTimeInMs)
|
|
68
|
-
.map(([_, timing]) => timing);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export {MaxPotentialFID};
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as Core from '../core/core.js';
|
|
6
|
-
import * as Graph from '../graph/graph.js';
|
|
7
|
-
import type * as Simulation from '../simulation/simulation.js';
|
|
8
|
-
import type * as Types from '../types/types.js';
|
|
9
|
-
|
|
10
|
-
export interface MetricComputationDataInput {
|
|
11
|
-
simulator: Simulation.Simulator;
|
|
12
|
-
graph: Graph.Node<unknown>;
|
|
13
|
-
processedNavigation: Types.Simulation.ProcessedNavigation;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface MetricCoefficients {
|
|
17
|
-
intercept: number;
|
|
18
|
-
optimistic: number;
|
|
19
|
-
pessimistic: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface MetricResult<T = Types.AnyNetworkObject> {
|
|
23
|
-
timing: number;
|
|
24
|
-
timestamp?: never;
|
|
25
|
-
optimisticEstimate: Simulation.Result<T>;
|
|
26
|
-
pessimisticEstimate: Simulation.Result<T>;
|
|
27
|
-
optimisticGraph: Graph.Node<T>;
|
|
28
|
-
pessimisticGraph: Graph.Node;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface Extras {
|
|
32
|
-
optimistic: boolean;
|
|
33
|
-
fcpResult?: MetricResult;
|
|
34
|
-
lcpResult?: MetricResult;
|
|
35
|
-
interactiveResult?: MetricResult;
|
|
36
|
-
observedSpeedIndex?: number;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
class Metric {
|
|
40
|
-
static getScriptUrls(dependencyGraph: Graph.Node, treatNodeAsRenderBlocking?: (node: Graph.NetworkNode) => boolean):
|
|
41
|
-
Set<string> {
|
|
42
|
-
const scriptUrls = new Set<string>();
|
|
43
|
-
|
|
44
|
-
dependencyGraph.traverse(node => {
|
|
45
|
-
if (node.type !== Graph.BaseNode.types.NETWORK) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (node.request.resourceType !== 'Script') {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (treatNodeAsRenderBlocking?.(node)) {
|
|
52
|
-
scriptUrls.add(node.request.url);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
return scriptUrls;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
static get coefficients(): MetricCoefficients {
|
|
60
|
-
throw new Core.LanternError('coefficients unimplemented!');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Returns the coefficients, scaled by the throttling settings if needed by the metric.
|
|
65
|
-
* Some lantern metrics (speed-index) use components in their estimate that are not
|
|
66
|
-
* from the simulator. In this case, we need to adjust the coefficients as the target throttling
|
|
67
|
-
* settings change.
|
|
68
|
-
*/
|
|
69
|
-
static getScaledCoefficients(_rttMs: number): MetricCoefficients {
|
|
70
|
-
return this.coefficients;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
static getOptimisticGraph(_dependencyGraph: Graph.Node, _processedNavigation: Types.Simulation.ProcessedNavigation):
|
|
74
|
-
Graph.Node {
|
|
75
|
-
throw new Core.LanternError('Optimistic graph unimplemented!');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
static getPessimisticGraph(_dependencyGraph: Graph.Node, _processedNavigation: Types.Simulation.ProcessedNavigation):
|
|
79
|
-
Graph.Node {
|
|
80
|
-
throw new Core.LanternError('Pessmistic graph unimplemented!');
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
static getEstimateFromSimulation(simulationResult: Simulation.Result, _extras: Extras): Simulation.Result {
|
|
84
|
-
return simulationResult;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
static compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult {
|
|
88
|
-
const {simulator, graph, processedNavigation} = data;
|
|
89
|
-
|
|
90
|
-
const metricName = this.name.replace('Lantern', '');
|
|
91
|
-
const optimisticGraph = this.getOptimisticGraph(graph, processedNavigation);
|
|
92
|
-
const pessimisticGraph = this.getPessimisticGraph(graph, processedNavigation);
|
|
93
|
-
|
|
94
|
-
let simulateOptions = {label: `optimistic${metricName}`};
|
|
95
|
-
const optimisticSimulation = simulator.simulate(optimisticGraph, simulateOptions);
|
|
96
|
-
|
|
97
|
-
simulateOptions = {label: `pessimistic${metricName}`};
|
|
98
|
-
const pessimisticSimulation = simulator.simulate(pessimisticGraph, simulateOptions);
|
|
99
|
-
|
|
100
|
-
const optimisticEstimate = this.getEstimateFromSimulation(
|
|
101
|
-
optimisticSimulation,
|
|
102
|
-
{...extras, optimistic: true},
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
const pessimisticEstimate = this.getEstimateFromSimulation(
|
|
106
|
-
pessimisticSimulation,
|
|
107
|
-
{...extras, optimistic: false},
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
const coefficients = this.getScaledCoefficients(simulator.rtt);
|
|
111
|
-
// Estimates under 1s don't really follow the normal curve fit, minimize the impact of the intercept
|
|
112
|
-
const interceptMultiplier = coefficients.intercept > 0 ? Math.min(1, optimisticEstimate.timeInMs / 1000) : 1;
|
|
113
|
-
const timing = coefficients.intercept * interceptMultiplier +
|
|
114
|
-
coefficients.optimistic * optimisticEstimate.timeInMs + coefficients.pessimistic * pessimisticEstimate.timeInMs;
|
|
115
|
-
|
|
116
|
-
return {
|
|
117
|
-
timing,
|
|
118
|
-
optimisticEstimate,
|
|
119
|
-
pessimisticEstimate,
|
|
120
|
-
optimisticGraph,
|
|
121
|
-
pessimisticGraph,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export {Metric};
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as Core from '../core/core.js';
|
|
6
|
-
import * as Graph from '../graph/graph.js';
|
|
7
|
-
import type * as Simulation from '../simulation/simulation.js';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
type Extras,
|
|
11
|
-
Metric,
|
|
12
|
-
type MetricCoefficients,
|
|
13
|
-
type MetricComputationDataInput,
|
|
14
|
-
type MetricResult,
|
|
15
|
-
} from './Metric.js';
|
|
16
|
-
|
|
17
|
-
const mobileSlow4GRtt = 150;
|
|
18
|
-
|
|
19
|
-
class SpeedIndex extends Metric {
|
|
20
|
-
static override get coefficients(): MetricCoefficients {
|
|
21
|
-
return {
|
|
22
|
-
// Note that the optimistic estimate is based on the real observed speed index rather than a
|
|
23
|
-
// real lantern graph (and the final estimate will be Math.max(FCP, Speed Index)).
|
|
24
|
-
intercept: 0,
|
|
25
|
-
optimistic: 1.4,
|
|
26
|
-
pessimistic: 0.4,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static override getScaledCoefficients(rttMs: number): MetricCoefficients {
|
|
31
|
-
// We want to scale our default coefficients based on the speed of the connection.
|
|
32
|
-
// We will linearly interpolate coefficients for the passed-in rttMs based on two pre-determined points:
|
|
33
|
-
// 1. Baseline point of 30 ms RTT where Speed Index should be a ~50/50 blend of optimistic/pessimistic.
|
|
34
|
-
// 30 ms was based on a typical home WiFi connection's actual RTT.
|
|
35
|
-
// Coefficients here follow from the fact that the optimistic estimate should be very close
|
|
36
|
-
// to reality at this connection speed and the pessimistic estimate compensates for minor
|
|
37
|
-
// connection speed differences.
|
|
38
|
-
// 2. Default throttled point of 150 ms RTT where the default coefficients have been determined to be most accurate.
|
|
39
|
-
// Coefficients here were determined through thorough analysis and linear regression on the
|
|
40
|
-
// lantern test data set. See core/scripts/test-lantern.sh for more detail.
|
|
41
|
-
// While the coefficients haven't been analyzed at the interpolated points, it's our current best effort.
|
|
42
|
-
const defaultCoefficients = this.coefficients;
|
|
43
|
-
const defaultRttExcess = mobileSlow4GRtt - 30;
|
|
44
|
-
const multiplier = Math.max((rttMs - 30) / defaultRttExcess, 0);
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
intercept: defaultCoefficients.intercept * multiplier,
|
|
48
|
-
optimistic: 0.5 + (defaultCoefficients.optimistic - 0.5) * multiplier,
|
|
49
|
-
pessimistic: 0.5 + (defaultCoefficients.pessimistic - 0.5) * multiplier,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
static override getOptimisticGraph(dependencyGraph: Graph.Node): Graph.Node {
|
|
54
|
-
return dependencyGraph;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
static override getPessimisticGraph(dependencyGraph: Graph.Node): Graph.Node {
|
|
58
|
-
return dependencyGraph;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
static override getEstimateFromSimulation(simulationResult: Simulation.Result, extras: Extras): Simulation.Result {
|
|
62
|
-
if (!extras.fcpResult) {
|
|
63
|
-
throw new Core.LanternError('missing fcpResult');
|
|
64
|
-
}
|
|
65
|
-
if (extras.observedSpeedIndex === undefined) {
|
|
66
|
-
throw new Core.LanternError('missing observedSpeedIndex');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const fcpTimeInMs = extras.fcpResult.pessimisticEstimate.timeInMs;
|
|
70
|
-
const estimate = extras.optimistic ?
|
|
71
|
-
extras.observedSpeedIndex :
|
|
72
|
-
SpeedIndex.computeLayoutBasedSpeedIndex(simulationResult.nodeTimings, fcpTimeInMs);
|
|
73
|
-
return {
|
|
74
|
-
timeInMs: estimate,
|
|
75
|
-
nodeTimings: simulationResult.nodeTimings,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
static override compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult {
|
|
80
|
-
const fcpResult = extras?.fcpResult;
|
|
81
|
-
if (!fcpResult) {
|
|
82
|
-
throw new Core.LanternError('FCP is required to calculate the SpeedIndex metric');
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const metricResult = super.compute(data, extras);
|
|
86
|
-
metricResult.timing = Math.max(metricResult.timing, fcpResult.timing);
|
|
87
|
-
return metricResult;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Approximate speed index using layout events from the simulated node timings.
|
|
92
|
-
* The layout-based speed index is the weighted average of the endTime of CPU nodes that contained
|
|
93
|
-
* a 'Layout' task. log(duration) is used as the weight to stand for "significance" to the page.
|
|
94
|
-
*
|
|
95
|
-
* If no layout events can be found or the endTime of a CPU task is too early, FCP is used instead.
|
|
96
|
-
*
|
|
97
|
-
* This approach was determined after evaluating the accuracy/complexity tradeoff of many
|
|
98
|
-
* different methods. Read more in the evaluation doc.
|
|
99
|
-
*
|
|
100
|
-
* @see https://docs.google.com/document/d/1qJWXwxoyVLVadezIp_Tgdk867G3tDNkkVRvUJSH3K1E/edit#
|
|
101
|
-
*/
|
|
102
|
-
static computeLayoutBasedSpeedIndex(nodeTimings: Simulation.Result['nodeTimings'], fcpTimeInMs: number): number {
|
|
103
|
-
const layoutWeights: Array<{time: number, weight: number}> = [];
|
|
104
|
-
for (const [node, timing] of nodeTimings.entries()) {
|
|
105
|
-
if (node.type !== Graph.BaseNode.types.CPU) {
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (node.childEvents.some(x => x.name === 'Layout')) {
|
|
110
|
-
const timingWeight = Math.max(Math.log2(timing.endTime - timing.startTime), 0);
|
|
111
|
-
layoutWeights.push({time: timing.endTime, weight: timingWeight});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const totalWeightedTime =
|
|
116
|
-
layoutWeights.map(evt => evt.weight * Math.max(evt.time, fcpTimeInMs)).reduce((a, b) => a + b, 0);
|
|
117
|
-
const totalWeight = layoutWeights.map(evt => evt.weight).reduce((a, b) => a + b, 0);
|
|
118
|
-
|
|
119
|
-
if (!totalWeight) {
|
|
120
|
-
return fcpTimeInMs;
|
|
121
|
-
}
|
|
122
|
-
return totalWeightedTime / totalWeight;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export {SpeedIndex};
|