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,257 +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 i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import * as Protocol from '../../../generated/protocol.js';
|
|
7
|
-
import * as Handlers from '../handlers/handlers.js';
|
|
8
|
-
import * as Helpers from '../helpers/helpers.js';
|
|
9
|
-
import type * as Lantern from '../lantern/lantern.js';
|
|
10
|
-
import type * as Types from '../types/types.js';
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
InsightCategory,
|
|
14
|
-
InsightKeys,
|
|
15
|
-
type InsightModel,
|
|
16
|
-
type InsightSetContext,
|
|
17
|
-
type InsightSetContextWithNavigation,
|
|
18
|
-
InsightWarning,
|
|
19
|
-
type LanternContext,
|
|
20
|
-
type PartialInsightModel,
|
|
21
|
-
} from './types.js';
|
|
22
|
-
|
|
23
|
-
export const UIStrings = {
|
|
24
|
-
/**
|
|
25
|
-
* @description Title of an insight that provides the user with the list of network requests that blocked and therefore slowed down the page rendering and becoming visible to the user.
|
|
26
|
-
*/
|
|
27
|
-
title: 'Render blocking requests',
|
|
28
|
-
/**
|
|
29
|
-
* @description Text to describe that there are requests blocking rendering, which may affect LCP.
|
|
30
|
-
*/
|
|
31
|
-
description: 'Requests are blocking the page\'s initial render, which may delay LCP. ' +
|
|
32
|
-
'[Deferring or inlining](https://developer.chrome.com/docs/performance/insights/render-blocking) ' +
|
|
33
|
-
'can move these network requests out of the critical path.',
|
|
34
|
-
/**
|
|
35
|
-
* @description Label to describe a network request (that happens to be render-blocking).
|
|
36
|
-
*/
|
|
37
|
-
renderBlockingRequest: 'Request',
|
|
38
|
-
/**
|
|
39
|
-
* @description Label used for a time duration.
|
|
40
|
-
*/
|
|
41
|
-
duration: 'Duration',
|
|
42
|
-
/**
|
|
43
|
-
* @description Text status indicating that no requests blocked the initial render of a navigation
|
|
44
|
-
*/
|
|
45
|
-
noRenderBlocking: 'No render blocking requests for this navigation',
|
|
46
|
-
} as const;
|
|
47
|
-
|
|
48
|
-
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/RenderBlocking.ts', UIStrings);
|
|
49
|
-
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
50
|
-
|
|
51
|
-
export function isRenderBlockingInsight(insight: InsightModel): insight is RenderBlockingInsightModel {
|
|
52
|
-
return insight.insightKey === 'RenderBlocking';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export type RenderBlockingInsightModel = InsightModel<typeof UIStrings, {
|
|
56
|
-
renderBlockingRequests: Types.Events.SyntheticNetworkRequest[],
|
|
57
|
-
requestIdToWastedMs?: Map<string, number>,
|
|
58
|
-
}>;
|
|
59
|
-
|
|
60
|
-
// Because of the way we detect blocking stylesheets, asynchronously loaded
|
|
61
|
-
// CSS with link[rel=preload] and an onload handler (see https://github.com/filamentgroup/loadCSS)
|
|
62
|
-
// can be falsely flagged as blocking. Therefore, ignore stylesheets that loaded fast enough
|
|
63
|
-
// to possibly be non-blocking (and they have minimal impact anyway).
|
|
64
|
-
const MINIMUM_WASTED_MS = 50;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Given a simulation's nodeTimings, return an object with the nodes/timing keyed by network URL
|
|
68
|
-
*/
|
|
69
|
-
function getNodesAndTimingByRequestId(nodeTimings: Lantern.Simulation.Result['nodeTimings']):
|
|
70
|
-
Map<string, {node: Lantern.Graph.Node, nodeTiming: Lantern.Types.Simulation.NodeTiming}> {
|
|
71
|
-
const requestIdToNode =
|
|
72
|
-
new Map<string, {node: Lantern.Graph.Node, nodeTiming: Lantern.Types.Simulation.NodeTiming}>();
|
|
73
|
-
|
|
74
|
-
for (const [node, nodeTiming] of nodeTimings) {
|
|
75
|
-
if (node.type !== 'network') {
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
requestIdToNode.set(node.request.requestId, {node, nodeTiming});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return requestIdToNode;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function estimateSavingsWithGraphs(deferredIds: Set<string>, lanternContext: LanternContext): Types.Timing.Milli {
|
|
86
|
-
const simulator = lanternContext.simulator;
|
|
87
|
-
const fcpGraph = lanternContext.metrics.firstContentfulPaint.optimisticGraph;
|
|
88
|
-
const {nodeTimings} = lanternContext.simulator.simulate(fcpGraph);
|
|
89
|
-
const adjustedNodeTimings = new Map(nodeTimings);
|
|
90
|
-
|
|
91
|
-
const totalChildNetworkBytes = 0;
|
|
92
|
-
const minimalFCPGraph = fcpGraph.cloneWithRelationships(node => {
|
|
93
|
-
// If a node can be deferred, exclude it from the new FCP graph
|
|
94
|
-
const canDeferRequest = deferredIds.has(node.id);
|
|
95
|
-
return !canDeferRequest;
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
if (minimalFCPGraph.type !== 'network') {
|
|
99
|
-
throw new Error('minimalFCPGraph not a NetworkNode');
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// Recalculate the "before" time based on our adjusted node timings.
|
|
103
|
-
const estimateBeforeInline = Math.max(...Array.from(
|
|
104
|
-
Array.from(adjustedNodeTimings).map(timing => timing[1].endTime),
|
|
105
|
-
));
|
|
106
|
-
|
|
107
|
-
// Add the inlined bytes to the HTML response
|
|
108
|
-
const originalTransferSize = minimalFCPGraph.request.transferSize;
|
|
109
|
-
const safeTransferSize = originalTransferSize || 0;
|
|
110
|
-
minimalFCPGraph.request.transferSize = safeTransferSize + totalChildNetworkBytes;
|
|
111
|
-
const estimateAfterInline = simulator.simulate(minimalFCPGraph).timeInMs;
|
|
112
|
-
minimalFCPGraph.request.transferSize = originalTransferSize;
|
|
113
|
-
return Math.round(Math.max(estimateBeforeInline - estimateAfterInline, 0)) as Types.Timing.Milli;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function hasImageLCP(data: Handlers.Types.HandlerData, context: InsightSetContextWithNavigation): boolean {
|
|
117
|
-
return data.LargestImagePaint.lcpRequestByNavigationId.has(context.navigationId);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function computeSavings(
|
|
121
|
-
data: Handlers.Types.HandlerData, context: InsightSetContextWithNavigation,
|
|
122
|
-
renderBlockingRequests: Types.Events.SyntheticNetworkRequest[]):
|
|
123
|
-
Pick<RenderBlockingInsightModel, 'metricSavings'|'requestIdToWastedMs'>|undefined {
|
|
124
|
-
if (!context.lantern) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const nodesAndTimingsByRequestId =
|
|
129
|
-
getNodesAndTimingByRequestId(context.lantern.metrics.firstContentfulPaint.optimisticEstimate.nodeTimings);
|
|
130
|
-
|
|
131
|
-
const metricSavings = {FCP: 0 as Types.Timing.Milli, LCP: 0 as Types.Timing.Milli};
|
|
132
|
-
const requestIdToWastedMs = new Map<string, number>();
|
|
133
|
-
const deferredNodeIds = new Set<string>();
|
|
134
|
-
for (const request of renderBlockingRequests) {
|
|
135
|
-
const nodeAndTiming = nodesAndTimingsByRequestId.get(request.args.data.requestId);
|
|
136
|
-
if (!nodeAndTiming) {
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const {node, nodeTiming} = nodeAndTiming;
|
|
141
|
-
|
|
142
|
-
// Mark this node and all its dependents as deferrable
|
|
143
|
-
node.traverse(node => deferredNodeIds.add(node.id));
|
|
144
|
-
|
|
145
|
-
// "wastedMs" is the download time of the network request, responseReceived - requestSent
|
|
146
|
-
const wastedMs = Math.round(nodeTiming.duration);
|
|
147
|
-
if (wastedMs < MINIMUM_WASTED_MS) {
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
requestIdToWastedMs.set(node.id, wastedMs);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (requestIdToWastedMs.size) {
|
|
155
|
-
metricSavings.FCP = estimateSavingsWithGraphs(deferredNodeIds, context.lantern);
|
|
156
|
-
|
|
157
|
-
// In most cases, render blocking resources only affect LCP if LCP isn't an image.
|
|
158
|
-
if (!hasImageLCP(data, context)) {
|
|
159
|
-
metricSavings.LCP = metricSavings.FCP;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return {metricSavings, requestIdToWastedMs};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function finalize(partialModel: PartialInsightModel<RenderBlockingInsightModel>): RenderBlockingInsightModel {
|
|
167
|
-
return {
|
|
168
|
-
insightKey: InsightKeys.RENDER_BLOCKING,
|
|
169
|
-
strings: UIStrings,
|
|
170
|
-
title: i18nString(UIStrings.title),
|
|
171
|
-
description: i18nString(UIStrings.description),
|
|
172
|
-
docs: 'https://developer.chrome.com/docs/performance/insights/render-blocking',
|
|
173
|
-
category: InsightCategory.LCP,
|
|
174
|
-
state: partialModel.renderBlockingRequests.length > 0 ? 'fail' : 'pass',
|
|
175
|
-
...partialModel,
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export function generateInsight(
|
|
180
|
-
data: Handlers.Types.HandlerData, context: InsightSetContext): RenderBlockingInsightModel {
|
|
181
|
-
if (!context.navigation) {
|
|
182
|
-
return finalize({
|
|
183
|
-
renderBlockingRequests: [],
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
const firstPaintTs = data.PageLoadMetrics.metricScoresByFrameId.get(context.frameId)
|
|
188
|
-
?.get(context.navigationId)
|
|
189
|
-
?.get(Handlers.ModelHandlers.PageLoadMetrics.MetricName.FP)
|
|
190
|
-
?.event?.ts;
|
|
191
|
-
if (!firstPaintTs) {
|
|
192
|
-
return finalize({
|
|
193
|
-
renderBlockingRequests: [],
|
|
194
|
-
warnings: [InsightWarning.NO_FP],
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
let renderBlockingRequests: Types.Events.SyntheticNetworkRequest[] = [];
|
|
199
|
-
for (const req of data.NetworkRequests.byTime) {
|
|
200
|
-
if (req.args.data.frame !== context.frameId) {
|
|
201
|
-
continue;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (!Helpers.Network.isSyntheticNetworkRequestEventRenderBlocking(req)) {
|
|
205
|
-
continue;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (req.args.data.syntheticData.finishTime > firstPaintTs) {
|
|
209
|
-
continue;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// If a request is marked `in_body_parser_blocking` it should only be considered render blocking if it is a
|
|
213
|
-
// high enough priority. Some requests (e.g. scripts) are not marked as high priority if they are fetched
|
|
214
|
-
// after a non-preloaded image. (See "early" definition in https://web.dev/articles/fetch-priority)
|
|
215
|
-
//
|
|
216
|
-
// There are edge cases and exceptions (e.g. priority hints) but this gives us the best approximation
|
|
217
|
-
// of render blocking resources in the document body.
|
|
218
|
-
if (req.args.data.renderBlocking === 'in_body_parser_blocking') {
|
|
219
|
-
const priority = req.args.data.priority;
|
|
220
|
-
const isScript = req.args.data.resourceType === Protocol.Network.ResourceType.Script;
|
|
221
|
-
const isBlockingScript = isScript && priority === Protocol.Network.ResourcePriority.High;
|
|
222
|
-
if (priority !== Protocol.Network.ResourcePriority.VeryHigh && !isBlockingScript) {
|
|
223
|
-
continue;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
const navigation = Helpers.Trace.getNavigationForTraceEvent(req, context.frameId, data.Meta.navigationsByFrameId);
|
|
228
|
-
if (navigation === context.navigation) {
|
|
229
|
-
renderBlockingRequests.push(req);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
const savings = computeSavings(data, context, renderBlockingRequests);
|
|
234
|
-
|
|
235
|
-
// Sort by request duration for insights.
|
|
236
|
-
renderBlockingRequests = renderBlockingRequests.sort((a, b) => {
|
|
237
|
-
return b.dur - a.dur;
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
return finalize({
|
|
241
|
-
relatedEvents: renderBlockingRequests,
|
|
242
|
-
renderBlockingRequests,
|
|
243
|
-
...savings,
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export function createOverlayForRequest(request: Types.Events.SyntheticNetworkRequest): Types.Overlays.EntryOutline {
|
|
248
|
-
return {
|
|
249
|
-
type: 'ENTRY_OUTLINE',
|
|
250
|
-
entry: request,
|
|
251
|
-
outlineReason: 'ERROR',
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
export function createOverlays(model: RenderBlockingInsightModel): Types.Overlays.Overlay[] {
|
|
256
|
-
return model.renderBlockingRequests.map(request => createOverlayForRequest(request));
|
|
257
|
-
}
|
|
@@ -1,175 +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 i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import type * as Handlers from '../handlers/handlers.js';
|
|
7
|
-
import type {SelectorStatsData} from '../handlers/SelectorStatsHandler.js';
|
|
8
|
-
import * as Helpers from '../helpers/helpers.js';
|
|
9
|
-
import {type SelectorTiming, SelectorTimingsKey} from '../types/TraceEvents.js';
|
|
10
|
-
import * as Types from '../types/types.js';
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
InsightCategory,
|
|
14
|
-
InsightKeys,
|
|
15
|
-
type InsightModel,
|
|
16
|
-
type InsightSetContext,
|
|
17
|
-
type PartialInsightModel,
|
|
18
|
-
} from './types.js';
|
|
19
|
-
|
|
20
|
-
export const UIStrings = {
|
|
21
|
-
/**
|
|
22
|
-
* @description Title of an insight that provides details about slow CSS selectors.
|
|
23
|
-
*/
|
|
24
|
-
title: 'CSS Selector costs',
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description Text to describe how to improve the performance of CSS selectors.
|
|
28
|
-
*/
|
|
29
|
-
description:
|
|
30
|
-
'If Recalculate Style costs remain high, selector optimization can reduce them. [Optimize the selectors](https://developer.chrome.com/docs/performance/insights/slow-css-selector) with both high elapsed time and high slow-path %. Simpler selectors, fewer selectors, a smaller DOM, and a shallower DOM will all reduce matching costs.',
|
|
31
|
-
/**
|
|
32
|
-
* @description Column name for count of elements that the engine attempted to match against a style rule
|
|
33
|
-
*/
|
|
34
|
-
matchAttempts: 'Match attempts',
|
|
35
|
-
/**
|
|
36
|
-
* @description Column name for count of elements that matched a style rule
|
|
37
|
-
*/
|
|
38
|
-
matchCount: 'Match count',
|
|
39
|
-
/**
|
|
40
|
-
* @description Column name for elapsed time spent computing a style rule
|
|
41
|
-
*/
|
|
42
|
-
elapsed: 'Elapsed time',
|
|
43
|
-
/**
|
|
44
|
-
* @description Column name for the selectors that took the longest amount of time/effort.
|
|
45
|
-
*/
|
|
46
|
-
topSelectors: 'Top selectors',
|
|
47
|
-
/**
|
|
48
|
-
* @description Column name for a total sum.
|
|
49
|
-
*/
|
|
50
|
-
total: 'Total',
|
|
51
|
-
/**
|
|
52
|
-
* @description Text status indicating that no CSS selector data was found.
|
|
53
|
-
*/
|
|
54
|
-
enableSelectorData:
|
|
55
|
-
'No CSS selector data was found. CSS selector stats need to be enabled in the performance panel settings.',
|
|
56
|
-
/**
|
|
57
|
-
* @description top CSS selector when ranked by elapsed time in ms
|
|
58
|
-
*/
|
|
59
|
-
topSelectorElapsedTime: 'Top selector elapsed time',
|
|
60
|
-
/**
|
|
61
|
-
* @description top CSS selector when ranked by match attempt
|
|
62
|
-
*/
|
|
63
|
-
topSelectorMatchAttempt: 'Top selector match attempt',
|
|
64
|
-
} as const;
|
|
65
|
-
|
|
66
|
-
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/SlowCSSSelector.ts', UIStrings);
|
|
67
|
-
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
68
|
-
const slowCSSSelectorThreshold = 500; // 500us threshold for slow selectors
|
|
69
|
-
|
|
70
|
-
export type SlowCSSSelectorInsightModel = InsightModel<typeof UIStrings, {
|
|
71
|
-
totalElapsedMs: Types.Timing.Milli,
|
|
72
|
-
totalMatchAttempts: number,
|
|
73
|
-
totalMatchCount: number,
|
|
74
|
-
topSelectorElapsedMs: Types.Events.SelectorTiming | null,
|
|
75
|
-
topSelectorMatchAttempts: Types.Events.SelectorTiming | null,
|
|
76
|
-
}>;
|
|
77
|
-
|
|
78
|
-
function aggregateSelectorStats(data: SelectorStatsData, context: InsightSetContext): SelectorTiming[] {
|
|
79
|
-
const selectorMap = new Map<String, SelectorTiming>();
|
|
80
|
-
|
|
81
|
-
for (const [event, value] of data.dataForRecalcStyleEvent) {
|
|
82
|
-
if (event.args.beginData?.frame !== context.frameId) {
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
if (!Helpers.Timing.eventIsInBounds(event, context.bounds)) {
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
for (const timing of value.timings) {
|
|
89
|
-
const key = timing[SelectorTimingsKey.Selector] + '_' + timing[SelectorTimingsKey.StyleSheetId];
|
|
90
|
-
const findTiming = selectorMap.get(key);
|
|
91
|
-
if (findTiming !== undefined) {
|
|
92
|
-
findTiming[SelectorTimingsKey.Elapsed] += timing[SelectorTimingsKey.Elapsed];
|
|
93
|
-
findTiming[SelectorTimingsKey.FastRejectCount] += timing[SelectorTimingsKey.FastRejectCount];
|
|
94
|
-
findTiming[SelectorTimingsKey.MatchAttempts] += timing[SelectorTimingsKey.MatchAttempts];
|
|
95
|
-
findTiming[SelectorTimingsKey.MatchCount] += timing[SelectorTimingsKey.MatchCount];
|
|
96
|
-
} else {
|
|
97
|
-
selectorMap.set(key, {...timing});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return [...selectorMap.values()];
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function finalize(partialModel: PartialInsightModel<SlowCSSSelectorInsightModel>): SlowCSSSelectorInsightModel {
|
|
106
|
-
return {
|
|
107
|
-
insightKey: InsightKeys.SLOW_CSS_SELECTOR,
|
|
108
|
-
strings: UIStrings,
|
|
109
|
-
title: i18nString(UIStrings.title),
|
|
110
|
-
description: i18nString(UIStrings.description),
|
|
111
|
-
docs: 'https://developer.chrome.com/docs/performance/insights/slow-css-selector',
|
|
112
|
-
category: InsightCategory.ALL,
|
|
113
|
-
state: partialModel.topSelectorElapsedMs && partialModel.topSelectorMatchAttempts ? 'informative' : 'pass',
|
|
114
|
-
...partialModel,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export function isSlowCSSSelectorInsight(model: InsightModel): model is SlowCSSSelectorInsightModel {
|
|
119
|
-
return model.insightKey === InsightKeys.SLOW_CSS_SELECTOR;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export function generateInsight(
|
|
123
|
-
data: Handlers.Types.HandlerData, context: InsightSetContext): SlowCSSSelectorInsightModel {
|
|
124
|
-
const selectorStatsData = data.SelectorStats;
|
|
125
|
-
|
|
126
|
-
if (!selectorStatsData) {
|
|
127
|
-
throw new Error('no selector stats data');
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const selectorTimings = aggregateSelectorStats(selectorStatsData, context);
|
|
131
|
-
|
|
132
|
-
let totalElapsedUs = 0;
|
|
133
|
-
let totalMatchAttempts = 0;
|
|
134
|
-
let totalMatchCount = 0;
|
|
135
|
-
|
|
136
|
-
selectorTimings.map(timing => {
|
|
137
|
-
totalElapsedUs += timing[SelectorTimingsKey.Elapsed];
|
|
138
|
-
totalMatchAttempts += timing[SelectorTimingsKey.MatchAttempts];
|
|
139
|
-
totalMatchCount += timing[SelectorTimingsKey.MatchCount];
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
let topSelectorElapsedMs: SelectorTiming|null = null;
|
|
143
|
-
let topSelectorMatchAttempts: SelectorTiming|null = null;
|
|
144
|
-
|
|
145
|
-
if (selectorTimings.length > 0) {
|
|
146
|
-
// find the selector with most elapsed time
|
|
147
|
-
topSelectorElapsedMs = selectorTimings.reduce((a, b) => {
|
|
148
|
-
return a[SelectorTimingsKey.Elapsed] > b[SelectorTimingsKey.Elapsed] ? a : b;
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
// check if the slowest selector is slow enough to trigger insights info
|
|
152
|
-
if (topSelectorElapsedMs && topSelectorElapsedMs[SelectorTimingsKey.Elapsed] < slowCSSSelectorThreshold) {
|
|
153
|
-
topSelectorElapsedMs = null;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// find the selector with most match attempts
|
|
157
|
-
topSelectorMatchAttempts = selectorTimings.reduce((a, b) => {
|
|
158
|
-
return a[SelectorTimingsKey.MatchAttempts] > b[SelectorTimingsKey.MatchAttempts] ? a : b;
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return finalize({
|
|
163
|
-
// TODO: should we identify RecalcStyle events as linked to this insight?
|
|
164
|
-
relatedEvents: [],
|
|
165
|
-
totalElapsedMs: Types.Timing.Milli(totalElapsedUs / 1000.0),
|
|
166
|
-
totalMatchAttempts,
|
|
167
|
-
totalMatchCount,
|
|
168
|
-
topSelectorElapsedMs,
|
|
169
|
-
topSelectorMatchAttempts,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export function createOverlays(_: SlowCSSSelectorInsightModel): Types.Overlays.Overlay[] {
|
|
174
|
-
return [];
|
|
175
|
-
}
|
|
@@ -1,101 +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
|
-
// Lifted from Lighthouse: https://github.com/GoogleChrome/lighthouse/blob/36cac182a6c637b1671c57326d7c0241633d0076/shared/statistics.js
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2017 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
// The exact double values for the max and min scores possible in each range.
|
|
14
|
-
const MIN_PASSING_SCORE = 0.90000000000000002220446049250313080847263336181640625;
|
|
15
|
-
const MAX_AVERAGE_SCORE = 0.899999999999999911182158029987476766109466552734375;
|
|
16
|
-
const MIN_AVERAGE_SCORE = 0.5;
|
|
17
|
-
const MAX_FAILING_SCORE = 0.499999999999999944488848768742172978818416595458984375;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Approximates the Gauss error function, the probability that a random variable
|
|
21
|
-
* from the standard normal distribution lies within [-x, x]. Moved from
|
|
22
|
-
* traceviewer.b.math.erf, based on Abramowitz and Stegun, formula 7.1.26.
|
|
23
|
-
*/
|
|
24
|
-
function erf(x: number): number {
|
|
25
|
-
// erf(-x) = -erf(x);
|
|
26
|
-
const sign = Math.sign(x);
|
|
27
|
-
x = Math.abs(x);
|
|
28
|
-
|
|
29
|
-
const a1 = 0.254829592;
|
|
30
|
-
const a2 = -0.284496736;
|
|
31
|
-
const a3 = 1.421413741;
|
|
32
|
-
const a4 = -1.453152027;
|
|
33
|
-
const a5 = 1.061405429;
|
|
34
|
-
const p = 0.3275911;
|
|
35
|
-
const t = 1 / (1 + p * x);
|
|
36
|
-
const y = t * (a1 + t * (a2 + t * (a3 + t * (a4 + t * a5))));
|
|
37
|
-
return sign * (1 - y * Math.exp(-x * x));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Returns the score (1 - percentile) of `value` in a log-normal distribution
|
|
42
|
-
* specified by the `median` value, at which the score will be 0.5, and a 10th
|
|
43
|
-
* percentile value, at which the score will be 0.9. The score represents the
|
|
44
|
-
* amount of the distribution greater than `value`. All values should be in the
|
|
45
|
-
* same units (e.g. milliseconds). See
|
|
46
|
-
* https://www.desmos.com/calculator/o98tbeyt1t
|
|
47
|
-
* for an interactive view of the relationship between these parameters and the
|
|
48
|
-
* typical parameterization (location and shape) of the log-normal distribution.
|
|
49
|
-
*/
|
|
50
|
-
export function getLogNormalScore({median, p10}: {median: number, p10: number}, value: number): number {
|
|
51
|
-
// Required for the log-normal distribution.
|
|
52
|
-
if (median <= 0) {
|
|
53
|
-
throw new Error('median must be greater than zero');
|
|
54
|
-
}
|
|
55
|
-
if (p10 <= 0) {
|
|
56
|
-
throw new Error('p10 must be greater than zero');
|
|
57
|
-
}
|
|
58
|
-
// Not strictly required, but if p10 > median, it flips around and becomes the p90 point.
|
|
59
|
-
if (p10 >= median) {
|
|
60
|
-
throw new Error('p10 must be less than the median');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Non-positive values aren't in the distribution, so always 1.
|
|
64
|
-
if (value <= 0) {
|
|
65
|
-
return 1;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Closest double to `erfc-1(1/5)`.
|
|
69
|
-
const INVERSE_ERFC_ONE_FIFTH = 0.9061938024368232;
|
|
70
|
-
|
|
71
|
-
// Shape (σ) is `|log(p10/median) / (sqrt(2)*erfc^-1(1/5))|` and
|
|
72
|
-
// standardizedX is `1/2 erfc(log(value/median) / (sqrt(2)*σ))`, so simplify a bit.
|
|
73
|
-
const xRatio = Math.max(Number.MIN_VALUE, value / median); // value and median are > 0, so is ratio.
|
|
74
|
-
const xLogRatio = Math.log(xRatio);
|
|
75
|
-
const p10Ratio = Math.max(Number.MIN_VALUE, p10 / median); // p10 and median are > 0, so is ratio.
|
|
76
|
-
const p10LogRatio = -Math.log(p10Ratio); // negate to keep σ positive.
|
|
77
|
-
const standardizedX = xLogRatio * INVERSE_ERFC_ONE_FIFTH / p10LogRatio;
|
|
78
|
-
const complementaryPercentile = (1 - erf(standardizedX)) / 2;
|
|
79
|
-
|
|
80
|
-
// Clamp to avoid floating-point out-of-bounds issues and keep score in expected range.
|
|
81
|
-
let score;
|
|
82
|
-
if (value <= p10) {
|
|
83
|
-
// Passing. Clamp to [0.9, 1].
|
|
84
|
-
score = Math.max(MIN_PASSING_SCORE, Math.min(1, complementaryPercentile));
|
|
85
|
-
} else if (value <= median) {
|
|
86
|
-
// Average. Clamp to [0.5, 0.9).
|
|
87
|
-
score = Math.max(MIN_AVERAGE_SCORE, Math.min(MAX_AVERAGE_SCORE, complementaryPercentile));
|
|
88
|
-
} else {
|
|
89
|
-
// Failing. Clamp to [0, 0.5).
|
|
90
|
-
score = Math.max(0, Math.min(MAX_FAILING_SCORE, complementaryPercentile));
|
|
91
|
-
}
|
|
92
|
-
return score;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Interpolates the y value at a point x on the line defined by (x0, y0) and (x1, y1)
|
|
97
|
-
*/
|
|
98
|
-
export function linearInterpolation(x0: number, y0: number, x1: number, y1: number, x: number): number {
|
|
99
|
-
const slope = (y1 - y0) / (x1 - x0);
|
|
100
|
-
return y0 + (x - x0) * slope;
|
|
101
|
-
}
|
|
@@ -1,130 +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 i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import * as ThirdPartyWeb from '../../../third_party/third-party-web/third-party-web.js';
|
|
7
|
-
import * as Extras from '../extras/extras.js';
|
|
8
|
-
import * as Handlers from '../handlers/handlers.js';
|
|
9
|
-
import type * as Types from '../types/types.js';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
InsightCategory,
|
|
13
|
-
InsightKeys,
|
|
14
|
-
type InsightModel,
|
|
15
|
-
type InsightSetContext,
|
|
16
|
-
type PartialInsightModel,
|
|
17
|
-
} from './types.js';
|
|
18
|
-
|
|
19
|
-
export const UIStrings = {
|
|
20
|
-
/** Title of an insight that provides details about the code on a web page that the user doesn't control (referred to as "third-party code"). */
|
|
21
|
-
title: '3rd parties',
|
|
22
|
-
/**
|
|
23
|
-
* @description Description of a DevTools insight that identifies the code on the page that the user doesn't control.
|
|
24
|
-
* This is displayed after a user expands the section to see more. No character length limits.
|
|
25
|
-
*/
|
|
26
|
-
description: '3rd party code can significantly impact load performance. ' +
|
|
27
|
-
'[Reduce and defer loading of 3rd party code](https://developer.chrome.com/docs/performance/insights/third-parties) to prioritize your page\'s content.',
|
|
28
|
-
/** Label for a table column that displays the name of a third-party provider. */
|
|
29
|
-
columnThirdParty: '3rd party',
|
|
30
|
-
/** Label for a column in a data table; entries will be the download size of a web resource in kilobytes. */
|
|
31
|
-
columnTransferSize: 'Transfer size',
|
|
32
|
-
/** Label for a table column that displays how much time each row spent running on the main thread, entries will be the number of milliseconds spent. */
|
|
33
|
-
columnMainThreadTime: 'Main thread time',
|
|
34
|
-
/**
|
|
35
|
-
* @description Text block indicating that no third party content was detected on the page
|
|
36
|
-
*/
|
|
37
|
-
noThirdParties: 'No third parties found',
|
|
38
|
-
} as const;
|
|
39
|
-
|
|
40
|
-
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/ThirdParties.ts', UIStrings);
|
|
41
|
-
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
42
|
-
|
|
43
|
-
export type ThirdPartiesInsightModel = InsightModel<typeof UIStrings, {
|
|
44
|
-
/** The entity for this navigation's URL. Any other entity is from a third party. */
|
|
45
|
-
entitySummaries: Extras.ThirdParties.EntitySummary[],
|
|
46
|
-
firstPartyEntity?: Extras.ThirdParties.Entity,
|
|
47
|
-
}>;
|
|
48
|
-
|
|
49
|
-
function getRelatedEvents(
|
|
50
|
-
summaries: Extras.ThirdParties.EntitySummary[],
|
|
51
|
-
firstPartyEntity: Extras.ThirdParties.Entity|undefined): Types.Events.Event[] {
|
|
52
|
-
const relatedEvents = [];
|
|
53
|
-
for (const summary of summaries) {
|
|
54
|
-
if (summary.entity !== firstPartyEntity) {
|
|
55
|
-
relatedEvents.push(...summary.relatedEvents);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return relatedEvents;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function finalize(partialModel: PartialInsightModel<ThirdPartiesInsightModel>): ThirdPartiesInsightModel {
|
|
63
|
-
return {
|
|
64
|
-
insightKey: InsightKeys.THIRD_PARTIES,
|
|
65
|
-
strings: UIStrings,
|
|
66
|
-
title: i18nString(UIStrings.title),
|
|
67
|
-
description: i18nString(UIStrings.description),
|
|
68
|
-
docs: 'https://developer.chrome.com/docs/performance/insights/third-parties',
|
|
69
|
-
category: InsightCategory.ALL,
|
|
70
|
-
state: partialModel.entitySummaries.find(summary => summary.entity !== partialModel.firstPartyEntity) ?
|
|
71
|
-
'informative' :
|
|
72
|
-
'pass',
|
|
73
|
-
...partialModel,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function isThirdPartyInsight(model: InsightModel): model is ThirdPartiesInsightModel {
|
|
78
|
-
return model.insightKey === InsightKeys.THIRD_PARTIES;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export function generateInsight(
|
|
82
|
-
data: Handlers.Types.HandlerData, context: InsightSetContext): ThirdPartiesInsightModel {
|
|
83
|
-
const entitySummaries = Extras.ThirdParties.summarizeByThirdParty(data as Handlers.Types.HandlerData, context.bounds);
|
|
84
|
-
|
|
85
|
-
const firstPartyUrl = context.navigation?.args.data?.documentLoaderURL ?? data.Meta.mainFrameURL;
|
|
86
|
-
const firstPartyEntity = ThirdPartyWeb.ThirdPartyWeb.getEntity(firstPartyUrl) ||
|
|
87
|
-
Handlers.Helpers.makeUpEntity(data.Renderer.entityMappings.createdEntityCache, firstPartyUrl);
|
|
88
|
-
|
|
89
|
-
return finalize({
|
|
90
|
-
relatedEvents: getRelatedEvents(entitySummaries, firstPartyEntity),
|
|
91
|
-
firstPartyEntity,
|
|
92
|
-
entitySummaries,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function createOverlaysForSummary(summary: Extras.ThirdParties.EntitySummary): Types.Overlays.Overlay[] {
|
|
97
|
-
const overlays = [];
|
|
98
|
-
for (const event of summary.relatedEvents) {
|
|
99
|
-
// The events found for a third party can be vast, as they gather every
|
|
100
|
-
// single main thread task along with everything else on the page. If the
|
|
101
|
-
// main thread is busy with large icicles, we can easily create tens of
|
|
102
|
-
// thousands of overlays. Therefore, only create overlays for events of at least 1ms.
|
|
103
|
-
if (event.dur === undefined || event.dur < 1_000) {
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const overlay: Types.Overlays.Overlay = {
|
|
108
|
-
type: 'ENTRY_OUTLINE',
|
|
109
|
-
entry: event,
|
|
110
|
-
outlineReason: 'INFO',
|
|
111
|
-
};
|
|
112
|
-
overlays.push(overlay);
|
|
113
|
-
}
|
|
114
|
-
return overlays;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function createOverlays(model: ThirdPartiesInsightModel): Types.Overlays.Overlay[] {
|
|
118
|
-
const overlays: Types.Overlays.Overlay[] = [];
|
|
119
|
-
const summaries = model.entitySummaries ?? [];
|
|
120
|
-
for (const summary of summaries) {
|
|
121
|
-
if (summary.entity === model.firstPartyEntity) {
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const summaryOverlays = createOverlaysForSummary(summary);
|
|
126
|
-
overlays.push(...summaryOverlays);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return overlays;
|
|
130
|
-
}
|