@paulirish/trace_engine 0.0.67-beta.1 → 0.0.67
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/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts +13 -0
- package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/analyze-trace.d.mts +17 -0
- package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts +2 -0
- package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts +3 -0
- package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -0
- package/README.md +22 -62
- package/analyze-inspector-issues.mjs +60 -0
- package/analyze-trace.mjs +144 -6
- package/core/common/ParsedURL.d.ts +8 -0
- package/core/common/ParsedURL.js +512 -0
- package/core/common/ParsedURL.js.map +1 -0
- package/core/common/common.d.ts +8 -33
- package/core/common/common.js +2 -0
- package/core/host/host.d.ts +1 -13
- package/core/host/host.js +1 -0
- package/core/i18n/i18n.d.ts +20 -8
- package/core/i18n/i18n.js +15 -0
- package/core/platform/ArrayUtilities.js +224 -0
- package/core/platform/ArrayUtilities.js.map +1 -0
- package/core/platform/Brand.js +5 -0
- package/core/platform/Brand.js.map +1 -0
- package/core/platform/Constructor.js +5 -0
- package/core/platform/Constructor.js.map +1 -0
- package/core/platform/DateUtilities.js +14 -0
- package/core/platform/DateUtilities.js.map +1 -0
- package/core/platform/DevToolsPath.js +28 -0
- package/core/platform/DevToolsPath.js.map +1 -0
- package/core/platform/HostRuntime.js +8 -0
- package/core/platform/HostRuntime.js.map +1 -0
- package/core/platform/KeyboardUtilities.js +34 -0
- package/core/platform/KeyboardUtilities.js.map +1 -0
- package/core/platform/MapUtilities.js +80 -0
- package/core/platform/MapUtilities.js.map +1 -0
- package/core/platform/MimeType.js +157 -0
- package/core/platform/MimeType.js.map +1 -0
- package/core/platform/NumberUtilities.js +73 -0
- package/core/platform/NumberUtilities.js.map +1 -0
- package/core/platform/Size.js +36 -0
- package/core/platform/Size.js.map +1 -0
- package/core/platform/StringUtilities.d.ts +21 -0
- package/core/platform/StringUtilities.js +731 -0
- package/core/platform/StringUtilities.js.map +1 -0
- package/core/platform/Timing.js +10 -0
- package/core/platform/Timing.js.map +1 -0
- package/core/platform/TypedArrayUtilities.js +158 -0
- package/core/platform/TypedArrayUtilities.js.map +1 -0
- package/core/platform/TypescriptUtilities.js +17 -0
- package/core/platform/TypescriptUtilities.js.map +1 -0
- package/core/platform/UIString.d.ts +5 -2
- package/core/platform/UIString.js +5 -0
- package/core/platform/UIString.js.map +1 -0
- package/core/platform/UserVisibleError.d.ts +1 -12
- package/core/platform/UserVisibleError.js +23 -0
- package/core/platform/UserVisibleError.js.map +1 -0
- package/core/platform/api/HostRuntime.d.ts +1 -0
- package/core/platform/api/HostRuntime.js +5 -0
- package/core/platform/api/HostRuntime.js.map +1 -0
- package/core/platform/api/api-tsconfig.json +58 -0
- package/core/platform/api/api-tsconfig.ref.json +26 -0
- package/core/platform/api/api.js +6 -0
- package/core/platform/api/api.js.map +1 -0
- package/core/platform/bundle-tsconfig.json +59 -0
- package/core/platform/bundle-tsconfig.ref.json +27 -0
- package/core/platform/foundation_unittests-tsconfig.json +73 -0
- package/core/platform/foundation_unittests-tsconfig.ref.json +40 -0
- package/core/platform/foundation_unittests_node_typecheck-tsconfig.json +69 -0
- package/core/platform/platform-tsconfig.json +81 -0
- package/core/platform/platform-tsconfig.ref.json +49 -0
- package/core/platform/platform.js +28 -0
- package/core/platform/platform.js.map +1 -0
- package/core/platform/platform_node_typecheck-tsconfig.json +78 -0
- package/core/platform/platform_node_typecheck.stamp +0 -0
- package/core/root/root.d.ts +1 -4
- package/core/root/root.js +1 -0
- package/core/sdk/sdk.d.ts +27 -97
- package/core/sdk/sdk.js +1 -0
- package/generated/protocol.d.ts +93 -30
- package/generated/protocol.js +3304 -0
- package/locales/af.json +173 -176
- package/locales/am.json +352 -355
- package/locales/ar.json +353 -356
- package/locales/as.json +351 -354
- package/locales/az.json +342 -345
- package/locales/be.json +352 -355
- package/locales/bg.json +352 -355
- package/locales/bn.json +352 -355
- package/locales/bs.json +254 -257
- package/locales/ca.json +284 -287
- package/locales/cs.json +337 -340
- package/locales/cy.json +147 -150
- package/locales/da.json +234 -237
- package/locales/de.json +253 -256
- package/locales/el.json +337 -340
- package/locales/en-GB.json +135 -138
- package/locales/en-US.json +300 -300
- package/locales/en-XL.json +1055 -0
- package/locales/es-419.json +283 -286
- package/locales/es.json +283 -286
- package/locales/et.json +239 -242
- package/locales/eu.json +134 -137
- package/locales/fa.json +352 -355
- package/locales/fi.json +284 -287
- package/locales/fil.json +131 -134
- package/locales/fr-CA.json +311 -314
- package/locales/fr.json +310 -313
- package/locales/gl.json +265 -268
- package/locales/gu.json +353 -356
- package/locales/he.json +353 -356
- package/locales/hi.json +337 -340
- package/locales/hr.json +258 -261
- package/locales/hu.json +343 -346
- package/locales/hy.json +352 -355
- package/locales/id.json +131 -134
- package/locales/is.json +305 -308
- package/locales/it.json +222 -225
- package/locales/ja.json +352 -355
- package/locales/ka.json +353 -356
- package/locales/kk.json +353 -356
- package/locales/km.json +352 -355
- package/locales/kn.json +353 -356
- package/locales/ko.json +352 -355
- package/locales/ky.json +351 -354
- package/locales/lo.json +353 -356
- package/locales/lt.json +324 -327
- package/locales/lv.json +318 -321
- package/locales/mk.json +353 -356
- package/locales/ml.json +352 -355
- package/locales/mn.json +352 -355
- package/locales/mr.json +352 -355
- package/locales/ms.json +131 -134
- package/locales/my.json +351 -354
- package/locales/ne.json +337 -340
- package/locales/nl.json +184 -187
- package/locales/no.json +240 -243
- package/locales/or.json +352 -355
- package/locales/pa.json +352 -355
- package/locales/pl.json +308 -311
- package/locales/pt-PT.json +275 -278
- package/locales/pt.json +271 -274
- package/locales/ro.json +310 -313
- package/locales/ru.json +352 -355
- package/locales/si.json +353 -356
- package/locales/sk.json +334 -337
- package/locales/sl.json +275 -278
- package/locales/sq.json +317 -320
- package/locales/sr-Latn.json +257 -260
- package/locales/sr.json +353 -356
- package/locales/sv.json +298 -301
- package/locales/sw.json +131 -134
- package/locales/ta.json +353 -356
- package/locales/te.json +351 -354
- package/locales/th.json +353 -356
- package/locales/tr.json +328 -331
- package/locales/uk.json +352 -355
- package/locales/ur.json +353 -356
- package/locales/uz.json +235 -238
- package/locales/vi.json +353 -356
- package/locales/zh-HK.json +353 -356
- package/locales/zh-TW.json +352 -355
- package/locales/zh.json +352 -355
- package/locales/zu.json +130 -133
- package/models/cpu_profile/CPUProfileDataModel.js +517 -0
- package/models/cpu_profile/CPUProfileDataModel.js.map +1 -0
- package/models/cpu_profile/ProfileTreeModel.js +90 -0
- package/models/cpu_profile/ProfileTreeModel.js.map +1 -0
- package/models/cpu_profile/bundle-tsconfig.json +59 -0
- package/models/cpu_profile/bundle-tsconfig.ref.json +27 -0
- package/models/cpu_profile/cpu_profile-tsconfig.json +63 -0
- package/models/cpu_profile/cpu_profile-tsconfig.ref.json +31 -0
- package/models/cpu_profile/cpu_profile.js +7 -0
- package/models/cpu_profile/cpu_profile.js.map +1 -0
- package/models/cpu_profile/cpu_profile_node_typecheck-tsconfig.json +60 -0
- package/models/cpu_profile/cpu_profile_node_typecheck.stamp +0 -0
- package/models/cpu_profile/foundation_unittests-tsconfig.json +63 -0
- package/models/cpu_profile/foundation_unittests-tsconfig.ref.json +30 -0
- package/models/cpu_profile/foundation_unittests_node_typecheck-tsconfig.json +59 -0
- package/models/crux-manager/crux-manager.d.ts +3 -1
- package/models/crux-manager/crux-manager.js +1 -0
- package/models/trace/EntityMapper.js +133 -0
- package/models/trace/EntityMapper.js.map +1 -0
- package/models/trace/EventsSerializer.d.ts +1 -0
- package/models/trace/EventsSerializer.js +118 -0
- package/models/trace/EventsSerializer.js.map +1 -0
- package/models/trace/LanternComputationData.js +368 -0
- package/models/trace/LanternComputationData.js.map +1 -0
- package/models/trace/ModelImpl.js +181 -0
- package/models/trace/ModelImpl.js.map +1 -0
- package/models/trace/Name.js +115 -0
- package/models/trace/Name.js.map +1 -0
- package/models/trace/Processor.js +616 -0
- package/models/trace/Processor.js.map +1 -0
- package/models/trace/Styles.d.ts +2 -2
- package/models/trace/Styles.js +836 -0
- package/models/trace/Styles.js.map +1 -0
- package/models/trace/bundle-tsconfig.json +77 -0
- package/models/trace/bundle-tsconfig.ref.json +45 -0
- package/models/trace/extras/FilmStrip.js +45 -0
- package/models/trace/extras/FilmStrip.js.map +1 -0
- package/models/trace/extras/Initiators.js +47 -0
- package/models/trace/extras/Initiators.js.map +1 -0
- package/models/trace/extras/MainThreadActivity.js +77 -0
- package/models/trace/extras/MainThreadActivity.js.map +1 -0
- package/models/trace/extras/ScriptDuplication.js +163 -0
- package/models/trace/extras/ScriptDuplication.js.map +1 -0
- package/models/trace/extras/StackTraceForEvent.d.ts +1 -1
- package/models/trace/extras/StackTraceForEvent.js +192 -0
- package/models/trace/extras/StackTraceForEvent.js.map +1 -0
- package/models/trace/extras/ThirdParties.js +119 -0
- package/models/trace/extras/ThirdParties.js.map +1 -0
- package/models/trace/extras/TraceFilter.js +51 -0
- package/models/trace/extras/TraceFilter.js.map +1 -0
- package/models/trace/extras/TraceTree.js +652 -0
- package/models/trace/extras/TraceTree.js.map +1 -0
- package/models/trace/extras/bundle-tsconfig.json +59 -0
- package/models/trace/extras/bundle-tsconfig.ref.json +27 -0
- package/models/trace/extras/extras-tsconfig.json +81 -0
- package/models/trace/extras/extras-tsconfig.ref.json +49 -0
- package/models/trace/extras/extras.js +12 -0
- package/models/trace/extras/extras.js.map +1 -0
- package/models/trace/extras/extras_node_typecheck-tsconfig.json +78 -0
- package/models/trace/extras/extras_node_typecheck.stamp +0 -0
- package/models/trace/extras/foundation_unittests-tsconfig.json +91 -0
- package/models/trace/extras/foundation_unittests-tsconfig.ref.json +58 -0
- package/models/trace/extras/foundation_unittests_node_typecheck-tsconfig.json +87 -0
- package/models/trace/foundation_unittests-tsconfig.json +70 -0
- package/models/trace/foundation_unittests-tsconfig.ref.json +37 -0
- package/models/trace/foundation_unittests_node_typecheck-tsconfig.json +66 -0
- package/models/trace/handlers/AnimationFramesHandler.d.ts +1 -1
- package/models/trace/handlers/AnimationFramesHandler.js +110 -0
- package/models/trace/handlers/AnimationFramesHandler.js.map +1 -0
- package/models/trace/handlers/AnimationHandler.js +27 -0
- package/models/trace/handlers/AnimationHandler.js.map +1 -0
- package/models/trace/handlers/AsyncJSCallsHandler.d.ts +2 -2
- package/models/trace/handlers/AsyncJSCallsHandler.js +188 -0
- package/models/trace/handlers/AsyncJSCallsHandler.js.map +1 -0
- package/models/trace/handlers/DOMStatsHandler.js +22 -0
- package/models/trace/handlers/DOMStatsHandler.js.map +1 -0
- package/models/trace/handlers/ExtensionTraceDataHandler.js +264 -0
- package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -0
- package/models/trace/handlers/FlowsHandler.js +149 -0
- package/models/trace/handlers/FlowsHandler.js.map +1 -0
- package/models/trace/handlers/FramesHandler.js +491 -0
- package/models/trace/handlers/FramesHandler.js.map +1 -0
- package/models/trace/handlers/GPUHandler.js +36 -0
- package/models/trace/handlers/GPUHandler.js.map +1 -0
- package/models/trace/handlers/ImagePaintingHandler.d.ts +2 -2
- package/models/trace/handlers/ImagePaintingHandler.js +148 -0
- package/models/trace/handlers/ImagePaintingHandler.js.map +1 -0
- package/models/trace/handlers/InitiatorsHandler.d.ts +2 -2
- package/models/trace/handlers/InitiatorsHandler.js +181 -0
- package/models/trace/handlers/InitiatorsHandler.js.map +1 -0
- package/models/trace/handlers/InvalidationsHandler.js +125 -0
- package/models/trace/handlers/InvalidationsHandler.js.map +1 -0
- package/models/trace/handlers/LargestImagePaintHandler.js +86 -0
- package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -0
- package/models/trace/handlers/LargestTextPaintHandler.js +28 -0
- package/models/trace/handlers/LargestTextPaintHandler.js.map +1 -0
- package/models/trace/handlers/LayerTreeHandler.d.ts +1 -1
- package/models/trace/handlers/LayerTreeHandler.js +104 -0
- package/models/trace/handlers/LayerTreeHandler.js.map +1 -0
- package/models/trace/handlers/LayoutShiftsHandler.js +453 -0
- package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -0
- package/models/trace/handlers/MemoryHandler.js +22 -0
- package/models/trace/handlers/MemoryHandler.js.map +1 -0
- package/models/trace/handlers/MetaHandler.js +442 -0
- package/models/trace/handlers/MetaHandler.js.map +1 -0
- package/models/trace/handlers/ModelHandlers.js +33 -0
- package/models/trace/handlers/ModelHandlers.js.map +1 -0
- package/models/trace/handlers/NetworkRequestsHandler.d.ts +1 -1
- package/models/trace/handlers/NetworkRequestsHandler.js +578 -0
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -0
- package/models/trace/handlers/PageFramesHandler.js +43 -0
- package/models/trace/handlers/PageFramesHandler.js.map +1 -0
- package/models/trace/handlers/PageLoadMetricsHandler.d.ts +1 -1
- package/models/trace/handlers/PageLoadMetricsHandler.js +463 -0
- package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -0
- package/models/trace/handlers/RendererHandler.js +346 -0
- package/models/trace/handlers/RendererHandler.js.map +1 -0
- package/models/trace/handlers/SamplesHandler.js +261 -0
- package/models/trace/handlers/SamplesHandler.js.map +1 -0
- package/models/trace/handlers/ScreenshotsHandler.js +56 -0
- package/models/trace/handlers/ScreenshotsHandler.js.map +1 -0
- package/models/trace/handlers/ScriptsHandler.d.ts +1 -1
- package/models/trace/handlers/ScriptsHandler.js +277 -0
- package/models/trace/handlers/ScriptsHandler.js.map +1 -0
- package/models/trace/handlers/SelectorStatsHandler.js +72 -0
- package/models/trace/handlers/SelectorStatsHandler.js.map +1 -0
- package/models/trace/handlers/Threads.js +108 -0
- package/models/trace/handlers/Threads.js.map +1 -0
- package/models/trace/handlers/UserInteractionsHandler.js +319 -0
- package/models/trace/handlers/UserInteractionsHandler.js.map +1 -0
- package/models/trace/handlers/UserTimingsHandler.js +194 -0
- package/models/trace/handlers/UserTimingsHandler.js.map +1 -0
- package/models/trace/handlers/WarningsHandler.d.ts +1 -1
- package/models/trace/handlers/WarningsHandler.js +135 -0
- package/models/trace/handlers/WarningsHandler.js.map +1 -0
- package/models/trace/handlers/WorkersHandler.js +34 -0
- package/models/trace/handlers/WorkersHandler.js.map +1 -0
- package/models/trace/handlers/bundle-tsconfig.json +59 -0
- package/models/trace/handlers/bundle-tsconfig.ref.json +27 -0
- package/models/trace/handlers/foundation_unittests-tsconfig.json +102 -0
- package/models/trace/handlers/foundation_unittests-tsconfig.ref.json +69 -0
- package/models/trace/handlers/foundation_unittests_node_typecheck-tsconfig.json +98 -0
- package/models/trace/handlers/handlers-tsconfig.json +112 -0
- package/models/trace/handlers/handlers-tsconfig.ref.json +80 -0
- package/models/trace/handlers/handlers.js +8 -0
- package/models/trace/handlers/handlers.js.map +1 -0
- package/models/trace/handlers/handlers_node_typecheck-tsconfig.json +109 -0
- package/models/trace/handlers/handlers_node_typecheck.stamp +0 -0
- package/models/trace/handlers/helpers.js +167 -0
- package/models/trace/handlers/helpers.js.map +1 -0
- package/models/trace/handlers/types.js +2 -0
- package/models/trace/handlers/types.js.map +1 -0
- package/models/trace/helpers/Extensions.js +42 -0
- package/models/trace/helpers/Extensions.js.map +1 -0
- package/models/trace/helpers/Network.js +103 -0
- package/models/trace/helpers/Network.js.map +1 -0
- package/models/trace/helpers/SamplesIntegrator.d.ts +3 -1
- package/models/trace/helpers/SamplesIntegrator.js +527 -0
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -0
- package/models/trace/helpers/SyntheticEvents.js +96 -0
- package/models/trace/helpers/SyntheticEvents.js.map +1 -0
- package/models/trace/helpers/Timing.js +200 -0
- package/models/trace/helpers/Timing.js.map +1 -0
- package/models/trace/helpers/Trace.d.ts +2 -0
- package/models/trace/helpers/Trace.js +844 -0
- package/models/trace/helpers/Trace.js.map +1 -0
- package/models/trace/helpers/TreeHelpers.js +255 -0
- package/models/trace/helpers/TreeHelpers.js.map +1 -0
- package/models/trace/helpers/bundle-tsconfig.json +59 -0
- package/models/trace/helpers/bundle-tsconfig.ref.json +27 -0
- package/models/trace/helpers/foundation_unittests-tsconfig.json +73 -0
- package/models/trace/helpers/foundation_unittests-tsconfig.ref.json +40 -0
- package/models/trace/helpers/foundation_unittests_node_typecheck-tsconfig.json +69 -0
- package/models/trace/helpers/helpers-tsconfig.json +77 -0
- package/models/trace/helpers/helpers-tsconfig.ref.json +45 -0
- package/models/trace/helpers/helpers.js +11 -0
- package/models/trace/helpers/helpers.js.map +1 -0
- package/models/trace/helpers/helpers_node_typecheck-tsconfig.json +74 -0
- package/models/trace/helpers/helpers_node_typecheck.stamp +0 -0
- package/models/trace/insights/CLSCulprits.d.ts +14 -14
- package/models/trace/insights/CLSCulprits.js +519 -0
- package/models/trace/insights/CLSCulprits.js.map +1 -0
- package/models/trace/insights/Cache.d.ts +6 -6
- package/models/trace/insights/Cache.js +210 -0
- package/models/trace/insights/Cache.js.map +1 -0
- package/models/trace/insights/CharacterSet.d.ts +8 -8
- package/models/trace/insights/CharacterSet.js +132 -0
- package/models/trace/insights/CharacterSet.js.map +1 -0
- package/models/trace/insights/Common.js +367 -0
- package/models/trace/insights/Common.js.map +1 -0
- package/models/trace/insights/DOMSize.d.ts +13 -13
- package/models/trace/insights/DOMSize.js +182 -0
- package/models/trace/insights/DOMSize.js.map +1 -0
- package/models/trace/insights/DocumentLatency.d.ts +11 -11
- package/models/trace/insights/DocumentLatency.js +259 -0
- package/models/trace/insights/DocumentLatency.js.map +1 -0
- package/models/trace/insights/DuplicatedJavaScript.d.ts +6 -6
- package/models/trace/insights/DuplicatedJavaScript.js +110 -0
- package/models/trace/insights/DuplicatedJavaScript.js.map +1 -0
- package/models/trace/insights/FontDisplay.d.ts +5 -5
- package/models/trace/insights/FontDisplay.js +93 -0
- package/models/trace/insights/FontDisplay.js.map +1 -0
- package/models/trace/insights/ForcedReflow.d.ts +7 -7
- package/models/trace/insights/ForcedReflow.js +162 -0
- package/models/trace/insights/ForcedReflow.js.map +1 -0
- package/models/trace/insights/INPBreakdown.d.ts +8 -8
- package/models/trace/insights/INPBreakdown.js +130 -0
- package/models/trace/insights/INPBreakdown.js.map +1 -0
- package/models/trace/insights/ImageDelivery.d.ts +13 -12
- package/models/trace/insights/ImageDelivery.js +264 -0
- package/models/trace/insights/ImageDelivery.js.map +1 -0
- package/models/trace/insights/LCPBreakdown.d.ts +11 -11
- package/models/trace/insights/LCPBreakdown.js +200 -0
- package/models/trace/insights/LCPBreakdown.js.map +1 -0
- package/models/trace/insights/LCPDiscovery.d.ts +10 -10
- package/models/trace/insights/LCPDiscovery.js +190 -0
- package/models/trace/insights/LCPDiscovery.js.map +1 -0
- package/models/trace/insights/LegacyJavaScript.d.ts +5 -5
- package/models/trace/insights/LegacyJavaScript.js +99 -0
- package/models/trace/insights/LegacyJavaScript.js.map +1 -0
- package/models/trace/insights/Models.js +23 -0
- package/models/trace/insights/Models.js.map +1 -0
- package/models/trace/insights/ModernHTTP.d.ts +5 -5
- package/models/trace/insights/ModernHTTP.js +205 -0
- package/models/trace/insights/ModernHTTP.js.map +1 -0
- package/models/trace/insights/NetworkDependencyTree.d.ts +19 -19
- package/models/trace/insights/NetworkDependencyTree.js +551 -0
- package/models/trace/insights/NetworkDependencyTree.js.map +1 -0
- package/models/trace/insights/RenderBlocking.d.ts +5 -5
- package/models/trace/insights/RenderBlocking.js +211 -0
- package/models/trace/insights/RenderBlocking.js.map +1 -0
- package/models/trace/insights/SlowCSSSelector.d.ts +10 -10
- package/models/trace/insights/SlowCSSSelector.js +140 -0
- package/models/trace/insights/SlowCSSSelector.js.map +1 -0
- package/models/trace/insights/Statistics.js +93 -0
- package/models/trace/insights/Statistics.js.map +1 -0
- package/models/trace/insights/ThirdParties.d.ts +6 -6
- package/models/trace/insights/ThirdParties.js +110 -0
- package/models/trace/insights/ThirdParties.js.map +1 -0
- package/models/trace/insights/Viewport.d.ts +3 -3
- package/models/trace/insights/Viewport.js +105 -0
- package/models/trace/insights/Viewport.js.map +1 -0
- package/models/trace/insights/bundle-tsconfig.json +59 -0
- package/models/trace/insights/bundle-tsconfig.ref.json +27 -0
- package/models/trace/insights/foundation_unittests-tsconfig.json +98 -0
- package/models/trace/insights/foundation_unittests-tsconfig.ref.json +65 -0
- package/models/trace/insights/foundation_unittests_node_typecheck-tsconfig.json +94 -0
- package/models/trace/insights/insights-tsconfig.json +114 -0
- package/models/trace/insights/insights-tsconfig.ref.json +82 -0
- package/models/trace/insights/insights.js +10 -0
- package/models/trace/insights/insights.js.map +1 -0
- package/models/trace/insights/insights_node_typecheck-tsconfig.json +111 -0
- package/models/trace/insights/insights_node_typecheck.stamp +0 -0
- package/models/trace/insights/types.d.ts +3 -3
- package/models/trace/insights/types.js +41 -0
- package/models/trace/insights/types.js.map +1 -0
- package/models/trace/lantern/bundle-tsconfig.json +71 -0
- package/models/trace/lantern/bundle-tsconfig.ref.json +39 -0
- package/models/trace/lantern/core/LanternError.js +7 -0
- package/models/trace/lantern/core/LanternError.js.map +1 -0
- package/models/trace/lantern/core/NetworkAnalyzer.d.ts +1 -0
- package/models/trace/lantern/core/NetworkAnalyzer.js +496 -0
- package/models/trace/lantern/core/NetworkAnalyzer.js.map +1 -0
- package/models/trace/lantern/core/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/core/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/core/core-tsconfig.json +60 -0
- package/models/trace/lantern/core/core-tsconfig.ref.json +28 -0
- package/models/trace/lantern/core/core.js +6 -0
- package/models/trace/lantern/core/core.js.map +1 -0
- package/models/trace/lantern/core/core_node_typecheck-tsconfig.json +57 -0
- package/models/trace/lantern/core/core_node_typecheck.stamp +0 -0
- package/models/trace/lantern/core/foundation_unittests-tsconfig.json +69 -0
- package/models/trace/lantern/core/foundation_unittests-tsconfig.ref.json +36 -0
- package/models/trace/lantern/core/foundation_unittests_node_typecheck-tsconfig.json +65 -0
- package/models/trace/lantern/graph/BaseNode.d.ts +2 -2
- package/models/trace/lantern/graph/BaseNode.js +277 -0
- package/models/trace/lantern/graph/BaseNode.js.map +1 -0
- package/models/trace/lantern/graph/CPUNode.d.ts +4 -2
- package/models/trace/lantern/graph/CPUNode.js +80 -0
- package/models/trace/lantern/graph/CPUNode.js.map +1 -0
- package/models/trace/lantern/graph/NetworkNode.js +95 -0
- package/models/trace/lantern/graph/NetworkNode.js.map +1 -0
- package/models/trace/lantern/graph/PageDependencyGraph.js +574 -0
- package/models/trace/lantern/graph/PageDependencyGraph.js.map +1 -0
- package/models/trace/lantern/graph/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/graph/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/graph/foundation_unittests-tsconfig.json +61 -0
- package/models/trace/lantern/graph/foundation_unittests-tsconfig.ref.json +28 -0
- package/models/trace/lantern/graph/foundation_unittests_node_typecheck-tsconfig.json +57 -0
- package/models/trace/lantern/graph/graph-tsconfig.json +65 -0
- package/models/trace/lantern/graph/graph-tsconfig.ref.json +33 -0
- package/models/trace/lantern/graph/graph.js +8 -0
- package/models/trace/lantern/graph/graph.js.map +1 -0
- package/models/trace/lantern/graph/graph_node_typecheck-tsconfig.json +62 -0
- package/models/trace/lantern/graph/graph_node_typecheck.stamp +0 -0
- package/models/trace/lantern/lantern.js +10 -0
- package/models/trace/lantern/lantern.js.map +1 -0
- package/models/trace/lantern/metrics/FirstContentfulPaint.js +137 -0
- package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +1 -0
- package/models/trace/lantern/metrics/Interactive.js +68 -0
- package/models/trace/lantern/metrics/Interactive.js.map +1 -0
- package/models/trace/lantern/metrics/LargestContentfulPaint.js +75 -0
- package/models/trace/lantern/metrics/LargestContentfulPaint.js.map +1 -0
- package/models/trace/lantern/metrics/MaxPotentialFID.js +49 -0
- package/models/trace/lantern/metrics/MaxPotentialFID.js.map +1 -0
- package/models/trace/lantern/metrics/Metric.js +69 -0
- package/models/trace/lantern/metrics/Metric.js.map +1 -0
- package/models/trace/lantern/metrics/SpeedIndex.js +102 -0
- package/models/trace/lantern/metrics/SpeedIndex.js.map +1 -0
- package/models/trace/lantern/metrics/TBTUtils.js +65 -0
- package/models/trace/lantern/metrics/TBTUtils.js.map +1 -0
- package/models/trace/lantern/metrics/TotalBlockingTime.js +79 -0
- package/models/trace/lantern/metrics/TotalBlockingTime.js.map +1 -0
- package/models/trace/lantern/metrics/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/metrics/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/metrics/foundation_unittests-tsconfig.json +76 -0
- package/models/trace/lantern/metrics/foundation_unittests-tsconfig.ref.json +43 -0
- package/models/trace/lantern/metrics/foundation_unittests_node_typecheck-tsconfig.json +72 -0
- package/models/trace/lantern/metrics/metrics-tsconfig.json +75 -0
- package/models/trace/lantern/metrics/metrics-tsconfig.ref.json +43 -0
- package/models/trace/lantern/metrics/metrics.js +12 -0
- package/models/trace/lantern/metrics/metrics.js.map +1 -0
- package/models/trace/lantern/metrics/metrics_node_typecheck-tsconfig.json +72 -0
- package/models/trace/lantern/metrics/metrics_node_typecheck.stamp +0 -0
- package/models/trace/lantern/simulation/ConnectionPool.js +116 -0
- package/models/trace/lantern/simulation/ConnectionPool.js.map +1 -0
- package/models/trace/lantern/simulation/Constants.js +45 -0
- package/models/trace/lantern/simulation/Constants.js.map +1 -0
- package/models/trace/lantern/simulation/DNSCache.js +48 -0
- package/models/trace/lantern/simulation/DNSCache.js.map +1 -0
- package/models/trace/lantern/simulation/SimulationTimingMap.js +135 -0
- package/models/trace/lantern/simulation/SimulationTimingMap.js.map +1 -0
- package/models/trace/lantern/simulation/Simulator.js +457 -0
- package/models/trace/lantern/simulation/Simulator.js.map +1 -0
- package/models/trace/lantern/simulation/TCPConnection.d.ts +4 -4
- package/models/trace/lantern/simulation/TCPConnection.js +155 -0
- package/models/trace/lantern/simulation/TCPConnection.js.map +1 -0
- package/models/trace/lantern/simulation/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/simulation/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/simulation/foundation_unittests-tsconfig.json +75 -0
- package/models/trace/lantern/simulation/foundation_unittests-tsconfig.ref.json +42 -0
- package/models/trace/lantern/simulation/foundation_unittests_node_typecheck-tsconfig.json +71 -0
- package/models/trace/lantern/simulation/simulation-tsconfig.json +70 -0
- package/models/trace/lantern/simulation/simulation-tsconfig.ref.json +38 -0
- package/models/trace/lantern/simulation/simulation.js +10 -0
- package/models/trace/lantern/simulation/simulation.js.map +1 -0
- package/models/trace/lantern/simulation/simulation_node_typecheck-tsconfig.json +67 -0
- package/models/trace/lantern/simulation/simulation_node_typecheck.stamp +0 -0
- package/models/trace/lantern/testing/bundle-tsconfig.json +60 -0
- package/models/trace/lantern/testing/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/testing/testing-tsconfig.json +63 -0
- package/models/trace/lantern/testing/testing-tsconfig.ref.json +30 -0
- package/models/trace/lantern/types/Lantern.d.ts +34 -19
- package/models/trace/lantern/types/Lantern.js +25 -0
- package/models/trace/lantern/types/Lantern.js.map +1 -0
- package/models/trace/lantern/types/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/types/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/types/types-tsconfig.json +59 -0
- package/models/trace/lantern/types/types-tsconfig.ref.json +27 -0
- package/models/trace/lantern/types/types.js +5 -0
- package/models/trace/lantern/types/types.js.map +1 -0
- package/models/trace/lantern/types/types_node_typecheck-tsconfig.json +56 -0
- package/models/trace/lantern/types/types_node_typecheck.stamp +0 -0
- package/models/trace/trace-tsconfig.json +89 -0
- package/models/trace/trace-tsconfig.ref.json +57 -0
- package/models/trace/trace.js +16 -544
- package/models/trace/trace.js.map +1 -0
- package/models/trace/trace_node_typecheck-tsconfig.json +86 -0
- package/models/trace/trace_node_typecheck.stamp +0 -0
- package/models/trace/types/Configuration.d.ts +2 -2
- package/models/trace/types/Configuration.js +19 -0
- package/models/trace/types/Configuration.js.map +1 -0
- package/models/trace/types/Extensions.d.ts +1 -1
- package/models/trace/types/Extensions.js +38 -0
- package/models/trace/types/Extensions.js.map +1 -0
- package/models/trace/types/File.d.ts +9 -3
- package/models/trace/types/File.js +92 -0
- package/models/trace/types/File.js.map +1 -0
- package/models/trace/types/Overlays.d.ts +4 -3
- package/models/trace/types/Overlays.js +5 -0
- package/models/trace/types/Overlays.js.map +1 -0
- package/models/trace/types/Timing.js +16 -0
- package/models/trace/types/Timing.js.map +1 -0
- package/models/trace/types/TraceEvents.d.ts +205 -140
- package/models/trace/types/TraceEvents.js +983 -0
- package/models/trace/types/TraceEvents.js.map +1 -0
- package/models/trace/types/bundle-tsconfig.json +59 -0
- package/models/trace/types/bundle-tsconfig.ref.json +27 -0
- package/models/trace/types/foundation_unittests-tsconfig.json +67 -0
- package/models/trace/types/foundation_unittests-tsconfig.ref.json +34 -0
- package/models/trace/types/foundation_unittests_node_typecheck-tsconfig.json +63 -0
- package/models/trace/types/types-tsconfig.json +76 -0
- package/models/trace/types/types-tsconfig.ref.json +44 -0
- package/models/trace/types/types.js +10 -0
- package/models/trace/types/types.js.map +1 -0
- package/models/trace/types/types_node_typecheck-tsconfig.json +73 -0
- package/models/trace/types/types_node_typecheck.stamp +0 -0
- package/package.json +8 -37
- package/test/invalid-animation-events.json.gz +0 -0
- package/test/test-trace-engine.mjs +191 -0
- package/third_party/legacy-javascript/bundle-tsconfig.json +59 -0
- package/third_party/legacy-javascript/bundle-tsconfig.ref.json +27 -0
- package/third_party/legacy-javascript/legacy-javascript-tsconfig.ref.json +15 -0
- package/third_party/legacy-javascript/legacy-javascript.js +3 -0
- package/third_party/legacy-javascript/legacy-javascript.js.map +1 -0
- package/third_party/legacy-javascript/lib/legacy-javascript.js +1119 -0
- package/third_party/marked/marked.d.ts +1 -0
- package/third_party/marked/marked.js +1 -0
- package/third_party/third-party-web/third-party-web.d.ts +1 -2
- package/third_party/third-party-web/third-party-web.js +1 -0
- package/tsconfig.json +29 -0
- package/core/common/Base64.d.ts +0 -12
- package/core/common/CharacterIdMap.d.ts +0 -5
- package/core/common/Color.d.ts +0 -357
- package/core/common/ColorConverter.d.ts +0 -26
- package/core/common/ColorUtils.d.ts +0 -45
- package/core/common/Console.d.ts +0 -54
- package/core/common/Debouncer.d.ts +0 -8
- package/core/common/EventTarget.d.ts +0 -22
- package/core/common/Gzip.d.ts +0 -23
- package/core/common/JavaScriptMetaData.d.ts +0 -20
- package/core/common/Lazy.d.ts +0 -4
- package/core/common/MapWithDefault.d.ts +0 -9
- package/core/common/Mutex.d.ts +0 -13
- package/core/common/Object.d.ts +0 -20
- package/core/common/Progress.d.ts +0 -47
- package/core/common/ResolverBase.d.ts +0 -29
- package/core/common/ResourceType.d.ts +0 -52
- package/core/common/ReturnToPanel.d.ts +0 -10
- package/core/common/Revealer.d.ts +0 -66
- package/core/common/Runnable.d.ts +0 -14
- package/core/common/SegmentedRange.d.ts +0 -14
- package/core/common/SettingRegistration.d.ts +0 -136
- package/core/common/Settings.d.ts +0 -226
- package/core/common/SimpleHistoryManager.d.ts +0 -20
- package/core/common/Srcset.d.ts +0 -16
- package/core/common/StringOutputStream.d.ts +0 -10
- package/core/common/TextDictionary.d.ts +0 -11
- package/core/common/Throttler.d.ts +0 -12
- package/core/common/Trie.d.ts +0 -24
- package/core/common/VersionController.d.ts +0 -85
- package/core/host/AidaClient.d.ts +0 -73
- package/core/host/AidaClientTypes.d.ts +0 -355
- package/core/host/AidaGcaTranslation.d.ts +0 -10
- package/core/host/DispatchHttpRequestClient.d.ts +0 -14
- package/core/host/GcaClient.d.ts +0 -14
- package/core/host/GcaTypes.d.ts +0 -411
- package/core/host/GdpClient.d.ts +0 -84
- package/core/host/InspectorFrontendHost.d.ts +0 -29
- package/core/host/InspectorFrontendHostAPI.d.ts +0 -425
- package/core/host/InspectorFrontendHostStub.d.ts +0 -151
- package/core/host/Platform.d.ts +0 -11
- package/core/host/ResourceLoader.d.ts +0 -15
- package/core/host/UserMetrics.d.ts +0 -116
- package/core/host/UserMetricsEnums.d.ts +0 -883
- package/core/i18n/ByteUtilities.d.ts +0 -11
- package/core/i18n/DevToolsLocale.d.ts +0 -41
- package/core/i18n/NumberFormatter.d.ts +0 -11
- package/core/i18n/i18nImpl.d.ts +0 -64
- package/core/i18n/i18nTypes.d.ts +0 -5
- package/core/i18n/locales.d.ts +0 -15
- package/core/i18n/time-utilities.d.ts +0 -16
- package/core/platform/browser/HostRuntime.d.ts +0 -2
- package/core/platform/browser/browser.d.ts +0 -2
- package/core/platform/node/HostRuntime.d.ts +0 -2
- package/core/platform/node/node.d.ts +0 -2
- package/core/protocol_client/CDPConnection.d.ts +0 -77
- package/core/protocol_client/ConnectionTransport.d.ts +0 -9
- package/core/protocol_client/DevToolsCDPConnection.d.ts +0 -16
- package/core/protocol_client/InspectorBackend.d.ts +0 -223
- package/core/protocol_client/protocol_client.d.ts +0 -5
- package/core/root/DevToolsContext.d.ts +0 -34
- package/core/root/ExperimentNames.d.ts +0 -8
- package/core/root/Runtime.d.ts +0 -351
- package/core/sdk/AccessibilityModel.d.ts +0 -76
- package/core/sdk/AnimationModel.d.ts +0 -161
- package/core/sdk/AutofillModel.d.ts +0 -23
- package/core/sdk/CPUProfilerModel.d.ts +0 -46
- package/core/sdk/CPUThrottlingManager.d.ts +0 -47
- package/core/sdk/CSSContainerQuery.d.ts +0 -42
- package/core/sdk/CSSFontFace.d.ts +0 -10
- package/core/sdk/CSSLayer.d.ts +0 -9
- package/core/sdk/CSSLocation.d.ts +0 -14
- package/core/sdk/CSSMatchedStyles.d.ts +0 -138
- package/core/sdk/CSSMedia.d.ts +0 -36
- package/core/sdk/CSSMetadata.d.ts +0 -87
- package/core/sdk/CSSModel.d.ts +0 -180
- package/core/sdk/CSSNavigation.d.ts +0 -10
- package/core/sdk/CSSProperty.d.ts +0 -53
- package/core/sdk/CSSPropertyParser.d.ts +0 -131
- package/core/sdk/CSSPropertyParserMatchers.d.ts +0 -442
- package/core/sdk/CSSQuery.d.ts +0 -22
- package/core/sdk/CSSRule.d.ts +0 -132
- package/core/sdk/CSSScope.d.ts +0 -9
- package/core/sdk/CSSStartingStyle.d.ts +0 -9
- package/core/sdk/CSSStyleDeclaration.d.ts +0 -38
- package/core/sdk/CSSStyleSheetHeader.d.ts +0 -53
- package/core/sdk/CSSSupports.d.ts +0 -10
- package/core/sdk/CategorizedBreakpoint.d.ts +0 -42
- package/core/sdk/ChildTargetManager.d.ts +0 -40
- package/core/sdk/CompilerSourceMappingContentProvider.d.ts +0 -12
- package/core/sdk/Connections.d.ts +0 -36
- package/core/sdk/ConsoleModel.d.ts +0 -127
- package/core/sdk/ConsoleModelTypes.d.ts +0 -6
- package/core/sdk/Cookie.d.ts +0 -68
- package/core/sdk/CookieModel.d.ts +0 -31
- package/core/sdk/CookieParser.d.ts +0 -14
- package/core/sdk/CrashReportContextModel.d.ts +0 -8
- package/core/sdk/DOMDebuggerModel.d.ts +0 -127
- package/core/sdk/DOMModel.d.ts +0 -436
- package/core/sdk/DOMStorageModel.d.ts +0 -79
- package/core/sdk/DebuggerModel.d.ts +0 -272
- package/core/sdk/EmulationModel.d.ts +0 -95
- package/core/sdk/EnhancedTracesParser.d.ts +0 -105
- package/core/sdk/EventBreakpointsModel.d.ts +0 -66
- package/core/sdk/FrameAssociated.d.ts +0 -6
- package/core/sdk/FrameManager.d.ts +0 -68
- package/core/sdk/HeapProfilerModel.d.ts +0 -75
- package/core/sdk/HttpReasonPhraseStrings.d.ts +0 -5
- package/core/sdk/IOModel.d.ts +0 -10
- package/core/sdk/IsolateManager.d.ts +0 -53
- package/core/sdk/IssuesModel.d.ts +0 -28
- package/core/sdk/LayerTreeBase.d.ts +0 -70
- package/core/sdk/LogModel.d.ts +0 -20
- package/core/sdk/NetworkManager.d.ts +0 -418
- package/core/sdk/NetworkRequest.d.ts +0 -469
- package/core/sdk/NetworkRequestAccess.d.ts +0 -91
- package/core/sdk/OverlayColorGenerator.d.ts +0 -14
- package/core/sdk/OverlayModel.d.ts +0 -186
- package/core/sdk/OverlayPersistentHighlighter.d.ts +0 -116
- package/core/sdk/PageFunctions.d.ts +0 -22
- package/core/sdk/PageLoad.d.ts +0 -14
- package/core/sdk/PageResourceLoader.d.ts +0 -111
- package/core/sdk/PaintProfiler.d.ts +0 -43
- package/core/sdk/PerformanceMetricsModel.d.ts +0 -12
- package/core/sdk/PreloadingModel.d.ts +0 -146
- package/core/sdk/RehydratingConnection.d.ts +0 -73
- package/core/sdk/RehydratingObject.d.ts +0 -59
- package/core/sdk/RemoteObject.d.ts +0 -210
- package/core/sdk/Resource.d.ts +0 -36
- package/core/sdk/ResourceTreeModel.d.ts +0 -278
- package/core/sdk/RuntimeModel.d.ts +0 -163
- package/core/sdk/SDKModel.d.ts +0 -30
- package/core/sdk/SDKSettings.d.ts +0 -53
- package/core/sdk/ScopeTreeCache.d.ts +0 -21
- package/core/sdk/ScreenCaptureModel.d.ts +0 -69
- package/core/sdk/Script.d.ts +0 -134
- package/core/sdk/SecurityOrigin.d.ts +0 -108
- package/core/sdk/SecurityOriginManager.d.ts +0 -23
- package/core/sdk/ServerSentEvents.d.ts +0 -18
- package/core/sdk/ServerSentEventsProtocol.d.ts +0 -18
- package/core/sdk/ServerTiming.d.ts +0 -24
- package/core/sdk/ServiceWorkerCacheModel.d.ts +0 -71
- package/core/sdk/ServiceWorkerManager.d.ts +0 -125
- package/core/sdk/SourceMap.d.ts +0 -197
- package/core/sdk/SourceMapCache.d.ts +0 -12
- package/core/sdk/SourceMapFunctionRanges.d.ts +0 -26
- package/core/sdk/SourceMapManager.d.ts +0 -46
- package/core/sdk/SourceMapRangeMappings.d.ts +0 -15
- package/core/sdk/SourceMapScopeChainEntry.d.ts +0 -23
- package/core/sdk/SourceMapScopesInfo.d.ts +0 -109
- package/core/sdk/StorageBucketsModel.d.ts +0 -48
- package/core/sdk/StorageKeyManager.d.ts +0 -38
- package/core/sdk/Target.d.ts +0 -79
- package/core/sdk/TargetManager.d.ts +0 -92
- package/core/sdk/TraceObject.d.ts +0 -43
- package/core/sdk/WebAuthnModel.d.ts +0 -29
- package/core/text_utils/CodeMirrorUtils.d.ts +0 -3
- package/core/text_utils/ContentData.d.ts +0 -94
- package/core/text_utils/ContentProvider.d.ts +0 -42
- package/core/text_utils/StaticContentProvider.d.ts +0 -13
- package/core/text_utils/StreamingContentData.d.ts +0 -49
- package/core/text_utils/Text.d.ts +0 -19
- package/core/text_utils/TextCursor.d.ts +0 -9
- package/core/text_utils/TextRange.d.ts +0 -81
- package/core/text_utils/TextUtils.d.ts +0 -97
- package/core/text_utils/WasmDisassembly.d.ts +0 -29
- package/core/text_utils/text_utils.d.ts +0 -11
- package/entrypoints/formatter_actions/formatter_actions.d.ts +0 -48
- package/generated/InspectorBackendCommands.d.ts +0 -14
- package/generated/SupportedCSSProperties.d.ts +0 -18
- package/generated/protocol-mapping.d.ts +0 -5930
- package/generated/protocol-proxy-api.d.ts +0 -5396
- package/index.d.ts +0 -2
- package/index.js +0 -6
- package/models/crux-manager/CrUXManager.d.ts +0 -107
- package/models/emulation/DeviceModeModel.d.ts +0 -156
- package/models/emulation/EmulatedDevices.d.ts +0 -148
- package/models/emulation/emulation.d.ts +0 -3
- package/models/formatter/FormatterWorkerPool.d.ts +0 -58
- package/models/formatter/ScriptFormatter.d.ts +0 -11
- package/models/formatter/formatter.d.ts +0 -3
- package/third_party/codemirror.next/codemirror.next.d.ts +0 -9196
- package/third_party/i18n/i18n-impl.d.ts +0 -25
- package/third_party/i18n/i18n.d.ts +0 -3
- package/third_party/i18n/localized-string-set.d.ts +0 -49
- package/third_party/intl-messageformat/intl-messageformat.d.ts +0 -1
- package/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +0 -67
- package/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +0 -38
- package/third_party/source-map-scopes-codec/package/src/codec.d.ts +0 -48
- package/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +0 -31
- package/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +0 -8
- package/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +0 -6
- package/third_party/source-map-scopes-codec/package/src/mod.d.ts +0 -5
- package/third_party/source-map-scopes-codec/package/src/scopes.d.ts +0 -168
- package/third_party/source-map-scopes-codec/package/src/util.d.ts +0 -5
- package/third_party/source-map-scopes-codec/package/src/vlq.d.ts +0 -14
- package/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +0 -1
- package/third_party/third-party-web/lib/nostats-subset.d.ts +0 -2
- package/third_party/third-party-web/package/lib/index.d.ts +0 -34
- package/third_party/third-party-web/package/lib/subsets/nostats.d.ts +0 -1
|
@@ -0,0 +1,182 @@
|
|
|
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
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
5
|
+
import * as Handlers from '../handlers/handlers.js';
|
|
6
|
+
import * as Helpers from '../helpers/helpers.js';
|
|
7
|
+
import * as Types from '../types/types.js';
|
|
8
|
+
import { InsightCategory, InsightKeys, } from './types.js';
|
|
9
|
+
export const UIStrings = {
|
|
10
|
+
/**
|
|
11
|
+
* @description Title of an insight that recommends reducing the size of the DOM tree as a means to improve page responsiveness. "DOM" is an acronym and should not be translated.
|
|
12
|
+
*/
|
|
13
|
+
title: 'Optimize DOM size',
|
|
14
|
+
/**
|
|
15
|
+
* @description Description of an insight that recommends reducing the size of the DOM tree as a means to improve page responsiveness. "DOM" is an acronym and should not be translated. "layout reflows" are when the browser will recompute the layout of content on the page.
|
|
16
|
+
*/
|
|
17
|
+
description: 'A large DOM can increase the duration of style calculations and layout reflows, impacting page responsiveness. A large DOM will also increase memory usage. [Learn how to avoid an excessive DOM size](https://developer.chrome.com/docs/performance/insights/dom-size).',
|
|
18
|
+
/**
|
|
19
|
+
* @description Header for a column containing the names of statistics as opposed to the actual statistic values.
|
|
20
|
+
*/
|
|
21
|
+
statistic: 'Statistic',
|
|
22
|
+
/**
|
|
23
|
+
* @description Header for a column containing the value of a statistic.
|
|
24
|
+
*/
|
|
25
|
+
value: 'Value',
|
|
26
|
+
/**
|
|
27
|
+
* @description Header for a column containing the page element related to a statistic.
|
|
28
|
+
*/
|
|
29
|
+
element: 'Element',
|
|
30
|
+
/**
|
|
31
|
+
* @description Label for a value representing the total number of elements on the page.
|
|
32
|
+
*/
|
|
33
|
+
totalElements: 'Total elements',
|
|
34
|
+
/**
|
|
35
|
+
* @description Label for a value representing the maximum depth of the Document Object Model (DOM). "DOM" is an acronym and should not be translated.
|
|
36
|
+
*/
|
|
37
|
+
maxDOMDepth: 'DOM depth',
|
|
38
|
+
/**
|
|
39
|
+
* @description Label for a value representing the maximum number of child elements of any parent element on the page.
|
|
40
|
+
*/
|
|
41
|
+
maxChildren: 'Most children',
|
|
42
|
+
/**
|
|
43
|
+
* @description Text for a section.
|
|
44
|
+
*/
|
|
45
|
+
topUpdatesDescription: 'These are the largest layout and style recalculation events. Their performance impact may be reduced by making the DOM simpler.',
|
|
46
|
+
/**
|
|
47
|
+
* @description Label used for a time duration.
|
|
48
|
+
*/
|
|
49
|
+
duration: 'Duration',
|
|
50
|
+
/**
|
|
51
|
+
* @description Message displayed in a table detailing how big a layout (rendering) is.
|
|
52
|
+
* @example {134} PH1
|
|
53
|
+
*/
|
|
54
|
+
largeLayout: 'Layout ({PH1} objects)',
|
|
55
|
+
/**
|
|
56
|
+
* @description Message displayed in a table detailing how big a style recalculation (rendering) is.
|
|
57
|
+
* @example {134} PH1
|
|
58
|
+
*/
|
|
59
|
+
largeStyleRecalc: 'Style recalculation ({PH1} elements)',
|
|
60
|
+
};
|
|
61
|
+
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/DOMSize.ts', UIStrings);
|
|
62
|
+
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
63
|
+
const DOM_SIZE_DURATION_THRESHOLD = Helpers.Timing.milliToMicro(Types.Timing.Milli(40));
|
|
64
|
+
// These thresholds were selected to maximize the number of long (>40ms) events above
|
|
65
|
+
// the threshold while maximizing the number of short (<40ms) events below the threshold.
|
|
66
|
+
// See go/rpp-dom-size-thresholds for the analysis that produced these thresholds.
|
|
67
|
+
const LAYOUT_OBJECTS_THRESHOLD = 100;
|
|
68
|
+
const STYLE_RECALC_ELEMENTS_THRESHOLD = 300;
|
|
69
|
+
function finalize(partialModel) {
|
|
70
|
+
const relatedEvents = [...partialModel.largeLayoutUpdates, ...partialModel.largeStyleRecalcs];
|
|
71
|
+
return {
|
|
72
|
+
insightKey: InsightKeys.DOM_SIZE,
|
|
73
|
+
strings: UIStrings,
|
|
74
|
+
title: i18nString(UIStrings.title),
|
|
75
|
+
description: i18nString(UIStrings.description),
|
|
76
|
+
docs: 'https://developer.chrome.com/docs/performance/insights/dom-size',
|
|
77
|
+
category: InsightCategory.INP,
|
|
78
|
+
state: relatedEvents.length > 0 ? 'informative' : 'pass',
|
|
79
|
+
...partialModel,
|
|
80
|
+
relatedEvents,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export function isDomSizeInsight(model) {
|
|
84
|
+
return model.insightKey === InsightKeys.DOM_SIZE;
|
|
85
|
+
}
|
|
86
|
+
export function generateInsight(data, context) {
|
|
87
|
+
const isWithinContext = (event) => Helpers.Timing.eventIsInBounds(event, context.bounds);
|
|
88
|
+
const mainTid = context.navigation?.tid;
|
|
89
|
+
const largeLayoutUpdates = [];
|
|
90
|
+
const largeStyleRecalcs = [];
|
|
91
|
+
const threads = Handlers.Threads.threadsInRenderer(data.Renderer);
|
|
92
|
+
for (const thread of threads) {
|
|
93
|
+
if (thread.type !== Handlers.Threads.ThreadType.MAIN_THREAD) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (mainTid === undefined) {
|
|
97
|
+
// We won't have a specific thread ID to reference if the context does not have a navigation.
|
|
98
|
+
// In this case, we'll just filter out any OOPIFs threads.
|
|
99
|
+
if (!thread.processIsOnMainFrame) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (thread.tid !== mainTid) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const rendererThread = data.Renderer.processes.get(thread.pid)?.threads.get(thread.tid);
|
|
107
|
+
if (!rendererThread) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const { entries, layoutEvents, recalcStyleEvents } = rendererThread;
|
|
111
|
+
if (!entries.length) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
const first = entries[0];
|
|
115
|
+
const last = entries[entries.length - 1];
|
|
116
|
+
const timeRange = Helpers.Timing.traceWindowFromMicroSeconds(first.ts, Types.Timing.Micro(last.ts + (last.dur ?? 0)));
|
|
117
|
+
if (!Helpers.Timing.boundsIncludeTimeRange({ timeRange, bounds: context.bounds })) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
for (const event of layoutEvents) {
|
|
121
|
+
if (event.dur < DOM_SIZE_DURATION_THRESHOLD || !isWithinContext(event)) {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const { dirtyObjects } = event.args.beginData;
|
|
125
|
+
if (dirtyObjects > LAYOUT_OBJECTS_THRESHOLD) {
|
|
126
|
+
largeLayoutUpdates.push(event);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
for (const event of recalcStyleEvents) {
|
|
130
|
+
if (event.dur < DOM_SIZE_DURATION_THRESHOLD || !isWithinContext(event)) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
const { elementCount } = event.args;
|
|
134
|
+
if (elementCount > STYLE_RECALC_ELEMENTS_THRESHOLD) {
|
|
135
|
+
largeStyleRecalcs.push(event);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const largeUpdates = [
|
|
140
|
+
...largeLayoutUpdates.map(event => {
|
|
141
|
+
const duration = (event.dur / 1000);
|
|
142
|
+
const size = event.args.beginData.dirtyObjects;
|
|
143
|
+
const label = i18nString(UIStrings.largeLayout, { PH1: size });
|
|
144
|
+
return { label, duration, size, event };
|
|
145
|
+
}),
|
|
146
|
+
...largeStyleRecalcs.map(event => {
|
|
147
|
+
const duration = (event.dur / 1000);
|
|
148
|
+
const size = event.args.elementCount;
|
|
149
|
+
const label = i18nString(UIStrings.largeStyleRecalc, { PH1: size });
|
|
150
|
+
return { label, duration, size, event };
|
|
151
|
+
}),
|
|
152
|
+
].sort((a, b) => b.duration - a.duration).slice(0, 5);
|
|
153
|
+
const domStatsEvents = data.DOMStats.domStatsByFrameId.get(context.frameId)?.filter(isWithinContext) ?? [];
|
|
154
|
+
let maxDOMStats;
|
|
155
|
+
for (const domStats of domStatsEvents) {
|
|
156
|
+
// While recording a cross-origin navigation, there can be overlapping dom stats from before & after
|
|
157
|
+
// the navigation which share a frameId. In this case we should also ensure the pid matches up with
|
|
158
|
+
// the navigation we care about (i.e. from after the navigation event).
|
|
159
|
+
const navigationPid = context.navigation?.pid;
|
|
160
|
+
if (navigationPid && domStats.pid !== navigationPid) {
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (!maxDOMStats || domStats.args.data.totalElements > maxDOMStats.args.data.totalElements) {
|
|
164
|
+
maxDOMStats = domStats;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return finalize({
|
|
168
|
+
largeLayoutUpdates,
|
|
169
|
+
largeStyleRecalcs,
|
|
170
|
+
largeUpdates,
|
|
171
|
+
maxDOMStats,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
export function createOverlays(model) {
|
|
175
|
+
const entries = [...model.largeStyleRecalcs, ...model.largeLayoutUpdates];
|
|
176
|
+
return entries.map(entry => ({
|
|
177
|
+
type: 'ENTRY_OUTLINE',
|
|
178
|
+
entry,
|
|
179
|
+
outlineReason: 'ERROR',
|
|
180
|
+
}));
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=DOMSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DOMSize.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/DOMSize.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EACL,eAAe,EACf,WAAW,GAIZ,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,mBAAmB;IAC1B;;OAEG;IACH,WAAW,EACP,0QAA0Q;IAC9Q;;OAEG;IACH,SAAS,EAAE,WAAW;IACtB;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,OAAO,EAAE,SAAS;IAClB;;OAEG;IACH,aAAa,EAAE,gBAAgB;IAC/B;;OAEG;IACH,WAAW,EAAE,WAAW;IACxB;;OAEG;IACH,WAAW,EAAE,eAAe;IAC5B;;OAEG;IACH,qBAAqB,EACjB,iIAAiI;IACrI;;OAEG;IACH,QAAQ,EAAE,UAAU;IACpB;;;OAGG;IACH,WAAW,EAAE,wBAAwB;IACrC;;;OAGG;IACH,gBAAgB,EAAE,sCAAsC;CAChD,CAAC;AAEX,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,kCAAkC,EAAE,SAAS,CAAC,CAAC;AACxF,MAAM,CAAC,MAAM,UAAU,GAAwB,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAElG,MAAM,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC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B;IACvD,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,iBAAiB,EAAE,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC1E,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACR,IAAI,EAAE,eAAe;QACrB,KAAK;QACL,aAAa,EAAE,OAAO;KACvB,CAAC,CAAC,CAAC;AACzB,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../../core/common/common.js';\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Handlers from '../handlers/handlers.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport {\n InsightCategory,\n InsightKeys,\n type InsightModel,\n type InsightSetContext,\n type PartialInsightModel,\n} from './types.js';\n\nexport const UIStrings = {\n /**\n * @description Title of an insight that recommends reducing the size of the DOM tree as a means to improve page responsiveness. \"DOM\" is an acronym and should not be translated.\n */\n title: 'Optimize DOM size',\n /**\n * @description Description of an insight that recommends reducing the size of the DOM tree as a means to improve page responsiveness. \"DOM\" is an acronym and should not be translated. \"layout reflows\" are when the browser will recompute the layout of content on the page.\n */\n description:\n 'A large DOM can increase the duration of style calculations and layout reflows, impacting page responsiveness. A large DOM will also increase memory usage. [Learn how to avoid an excessive DOM size](https://developer.chrome.com/docs/performance/insights/dom-size).',\n /**\n * @description Header for a column containing the names of statistics as opposed to the actual statistic values.\n */\n statistic: 'Statistic',\n /**\n * @description Header for a column containing the value of a statistic.\n */\n value: 'Value',\n /**\n * @description Header for a column containing the page element related to a statistic.\n */\n element: 'Element',\n /**\n * @description Label for a value representing the total number of elements on the page.\n */\n totalElements: 'Total elements',\n /**\n * @description Label for a value representing the maximum depth of the Document Object Model (DOM). \"DOM\" is an acronym and should not be translated.\n */\n maxDOMDepth: 'DOM depth',\n /**\n * @description Label for a value representing the maximum number of child elements of any parent element on the page.\n */\n maxChildren: 'Most children',\n /**\n * @description Text for a section.\n */\n topUpdatesDescription:\n 'These are the largest layout and style recalculation events. Their performance impact may be reduced by making the DOM simpler.',\n /**\n * @description Label used for a time duration.\n */\n duration: 'Duration',\n /**\n * @description Message displayed in a table detailing how big a layout (rendering) is.\n * @example {134} PH1\n */\n largeLayout: 'Layout ({PH1} objects)',\n /**\n * @description Message displayed in a table detailing how big a style recalculation (rendering) is.\n * @example {134} PH1\n */\n largeStyleRecalc: 'Style recalculation ({PH1} elements)',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/DOMSize.ts', UIStrings);\nexport const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst DOM_SIZE_DURATION_THRESHOLD = Helpers.Timing.milliToMicro(Types.Timing.Milli(40));\n\n// These thresholds were selected to maximize the number of long (>40ms) events above\n// the threshold while maximizing the number of short (<40ms) events below the threshold.\n// See go/rpp-dom-size-thresholds for the analysis that produced these thresholds.\nconst LAYOUT_OBJECTS_THRESHOLD = 100;\nconst STYLE_RECALC_ELEMENTS_THRESHOLD = 300;\n\nexport type DOMSizeInsightModel = InsightModel<typeof UIStrings, {\n largeLayoutUpdates: Types.Events.Layout[],\n largeStyleRecalcs: Types.Events.RecalcStyle[],\n largeUpdates: Array<\n {label: Common.UIString.LocalizedString, duration: Types.Timing.Milli, size: number, event: Types.Events.Event}>,\n maxDOMStats?: Types.Events.DOMStats,\n}>;\n\nfunction finalize(partialModel: PartialInsightModel<DOMSizeInsightModel>): DOMSizeInsightModel {\n const relatedEvents = [...partialModel.largeLayoutUpdates, ...partialModel.largeStyleRecalcs];\n return {\n insightKey: InsightKeys.DOM_SIZE,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n docs: 'https://developer.chrome.com/docs/performance/insights/dom-size',\n category: InsightCategory.INP,\n state: relatedEvents.length > 0 ? 'informative' : 'pass',\n ...partialModel,\n relatedEvents,\n };\n}\n\nexport function isDomSizeInsight(model: InsightModel): model is DOMSizeInsightModel {\n return model.insightKey === InsightKeys.DOM_SIZE;\n}\n\nexport function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): DOMSizeInsightModel {\n const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);\n\n const mainTid = context.navigation?.tid;\n\n const largeLayoutUpdates: Types.Events.Layout[] = [];\n const largeStyleRecalcs: Types.Events.RecalcStyle[] = [];\n\n const threads = Handlers.Threads.threadsInRenderer(data.Renderer);\n for (const thread of threads) {\n if (thread.type !== Handlers.Threads.ThreadType.MAIN_THREAD) {\n continue;\n }\n\n if (mainTid === undefined) {\n // We won't have a specific thread ID to reference if the context does not have a navigation.\n // In this case, we'll just filter out any OOPIFs threads.\n if (!thread.processIsOnMainFrame) {\n continue;\n }\n } else if (thread.tid !== mainTid) {\n continue;\n }\n\n const rendererThread = data.Renderer.processes.get(thread.pid)?.threads.get(thread.tid);\n if (!rendererThread) {\n continue;\n }\n\n const {entries, layoutEvents, recalcStyleEvents} = rendererThread;\n if (!entries.length) {\n continue;\n }\n\n const first = entries[0];\n const last = entries[entries.length - 1];\n const timeRange =\n Helpers.Timing.traceWindowFromMicroSeconds(first.ts, Types.Timing.Micro(last.ts + (last.dur ?? 0)));\n if (!Helpers.Timing.boundsIncludeTimeRange({timeRange, bounds: context.bounds})) {\n continue;\n }\n\n for (const event of layoutEvents) {\n if (event.dur < DOM_SIZE_DURATION_THRESHOLD || !isWithinContext(event)) {\n continue;\n }\n\n const {dirtyObjects} = event.args.beginData;\n if (dirtyObjects > LAYOUT_OBJECTS_THRESHOLD) {\n largeLayoutUpdates.push(event);\n }\n }\n\n for (const event of recalcStyleEvents) {\n if (event.dur < DOM_SIZE_DURATION_THRESHOLD || !isWithinContext(event)) {\n continue;\n }\n\n const {elementCount} = event.args;\n if (elementCount > STYLE_RECALC_ELEMENTS_THRESHOLD) {\n largeStyleRecalcs.push(event);\n }\n }\n }\n\n const largeUpdates: DOMSizeInsightModel['largeUpdates'] = [\n ...largeLayoutUpdates.map(event => {\n const duration = (event.dur / 1000) as Types.Timing.Milli;\n const size = event.args.beginData.dirtyObjects;\n const label = i18nString(UIStrings.largeLayout, {PH1: size});\n return {label, duration, size, event};\n }),\n ...largeStyleRecalcs.map(event => {\n const duration = (event.dur / 1000) as Types.Timing.Milli;\n const size = event.args.elementCount;\n const label = i18nString(UIStrings.largeStyleRecalc, {PH1: size});\n return {label, duration, size, event};\n }),\n ].sort((a, b) => b.duration - a.duration).slice(0, 5);\n\n const domStatsEvents = data.DOMStats.domStatsByFrameId.get(context.frameId)?.filter(isWithinContext) ?? [];\n let maxDOMStats: Types.Events.DOMStats|undefined;\n for (const domStats of domStatsEvents) {\n // While recording a cross-origin navigation, there can be overlapping dom stats from before & after\n // the navigation which share a frameId. In this case we should also ensure the pid matches up with\n // the navigation we care about (i.e. from after the navigation event).\n const navigationPid = context.navigation?.pid;\n if (navigationPid && domStats.pid !== navigationPid) {\n continue;\n }\n\n if (!maxDOMStats || domStats.args.data.totalElements > maxDOMStats.args.data.totalElements) {\n maxDOMStats = domStats;\n }\n }\n\n return finalize({\n largeLayoutUpdates,\n largeStyleRecalcs,\n largeUpdates,\n maxDOMStats,\n });\n}\n\nexport function createOverlays(model: DOMSizeInsightModel): Types.Overlays.Overlay[] {\n const entries = [...model.largeStyleRecalcs, ...model.largeLayoutUpdates];\n return entries.map(entry => ({\n type: 'ENTRY_OUTLINE',\n entry,\n outlineReason: 'ERROR',\n }));\n}\n"]}
|
|
@@ -6,51 +6,51 @@ export declare const UIStrings: {
|
|
|
6
6
|
/**
|
|
7
7
|
* @description Title of an insight that provides a breakdown for how long it took to download the main document.
|
|
8
8
|
*/
|
|
9
|
-
readonly title:
|
|
9
|
+
readonly title: 'Document request latency';
|
|
10
10
|
/**
|
|
11
11
|
* @description Description of an insight that provides a breakdown for how long it took to download the main document.
|
|
12
12
|
*/
|
|
13
|
-
readonly description:
|
|
13
|
+
readonly description: 'Your first network request is the most important. [Reduce its latency](https://developer.chrome.com/docs/performance/insights/document-latency) by avoiding redirects, ensuring a fast server response, and enabling text compression.';
|
|
14
14
|
/**
|
|
15
15
|
* @description Text to tell the user that the document request does not have redirects.
|
|
16
16
|
*/
|
|
17
|
-
readonly passingRedirects:
|
|
17
|
+
readonly passingRedirects: 'Avoids redirects';
|
|
18
18
|
/**
|
|
19
19
|
* @description Text to tell the user that the document request had redirects.
|
|
20
20
|
* @example {3} PH1
|
|
21
21
|
* @example {1000 ms} PH2
|
|
22
22
|
*/
|
|
23
|
-
readonly failedRedirects:
|
|
23
|
+
readonly failedRedirects: 'Had redirects ({PH1} redirects, +{PH2})';
|
|
24
24
|
/**
|
|
25
25
|
* @description Text to tell the user that the time starting the document request to when the server started responding is acceptable.
|
|
26
26
|
* @example {600 ms} PH1
|
|
27
27
|
*/
|
|
28
|
-
readonly passingServerResponseTime:
|
|
28
|
+
readonly passingServerResponseTime: 'Server responds quickly (observed {PH1})';
|
|
29
29
|
/**
|
|
30
30
|
* @description Text to tell the user that the time starting the document request to when the server started responding is not acceptable.
|
|
31
31
|
* @example {601 ms} PH1
|
|
32
32
|
*/
|
|
33
|
-
readonly failedServerResponseTime:
|
|
33
|
+
readonly failedServerResponseTime: 'Server responded slowly (observed {PH1})';
|
|
34
34
|
/**
|
|
35
35
|
* @description Text to tell the user that text compression (like gzip) was applied.
|
|
36
36
|
*/
|
|
37
|
-
readonly passingTextCompression:
|
|
37
|
+
readonly passingTextCompression: 'Applies text compression';
|
|
38
38
|
/**
|
|
39
39
|
* @description Text to tell the user that text compression (like gzip) was not applied.
|
|
40
40
|
*/
|
|
41
|
-
readonly failedTextCompression:
|
|
41
|
+
readonly failedTextCompression: 'No compression applied';
|
|
42
42
|
/**
|
|
43
43
|
* @description Text for a label describing a network request event as having redirects.
|
|
44
44
|
*/
|
|
45
|
-
readonly redirectsLabel:
|
|
45
|
+
readonly redirectsLabel: 'Redirects';
|
|
46
46
|
/**
|
|
47
47
|
* @description Text for a label describing a network request event as taking too long to start delivery by the server.
|
|
48
48
|
*/
|
|
49
|
-
readonly serverResponseTimeLabel:
|
|
49
|
+
readonly serverResponseTimeLabel: 'Server response time';
|
|
50
50
|
/**
|
|
51
51
|
* @description Text for a label describing a network request event as taking longer to download because it wasn't compressed.
|
|
52
52
|
*/
|
|
53
|
-
readonly uncompressedDownload:
|
|
53
|
+
readonly uncompressedDownload: 'Uncompressed download';
|
|
54
54
|
};
|
|
55
55
|
export declare const i18nString: i18n.LocalizeString;
|
|
56
56
|
export declare function isDocumentLatencyInsight(x: InsightModel): x is DocumentLatencyInsightModel;
|
|
@@ -0,0 +1,259 @@
|
|
|
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
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
5
|
+
import * as Helpers from '../helpers/helpers.js';
|
|
6
|
+
import * as Types from '../types/types.js';
|
|
7
|
+
import { isRequestCompressed } from './Common.js';
|
|
8
|
+
import { InsightCategory, InsightKeys, InsightWarning, } from './types.js';
|
|
9
|
+
export const UIStrings = {
|
|
10
|
+
/**
|
|
11
|
+
* @description Title of an insight that provides a breakdown for how long it took to download the main document.
|
|
12
|
+
*/
|
|
13
|
+
title: 'Document request latency',
|
|
14
|
+
/**
|
|
15
|
+
* @description Description of an insight that provides a breakdown for how long it took to download the main document.
|
|
16
|
+
*/
|
|
17
|
+
description: 'Your first network request is the most important. [Reduce its latency](https://developer.chrome.com/docs/performance/insights/document-latency) by avoiding redirects, ensuring a fast server response, and enabling text compression.',
|
|
18
|
+
/**
|
|
19
|
+
* @description Text to tell the user that the document request does not have redirects.
|
|
20
|
+
*/
|
|
21
|
+
passingRedirects: 'Avoids redirects',
|
|
22
|
+
/**
|
|
23
|
+
* @description Text to tell the user that the document request had redirects.
|
|
24
|
+
* @example {3} PH1
|
|
25
|
+
* @example {1000 ms} PH2
|
|
26
|
+
*/
|
|
27
|
+
failedRedirects: 'Had redirects ({PH1} redirects, +{PH2})',
|
|
28
|
+
/**
|
|
29
|
+
* @description Text to tell the user that the time starting the document request to when the server started responding is acceptable.
|
|
30
|
+
* @example {600 ms} PH1
|
|
31
|
+
*/
|
|
32
|
+
passingServerResponseTime: 'Server responds quickly (observed {PH1})',
|
|
33
|
+
/**
|
|
34
|
+
* @description Text to tell the user that the time starting the document request to when the server started responding is not acceptable.
|
|
35
|
+
* @example {601 ms} PH1
|
|
36
|
+
*/
|
|
37
|
+
failedServerResponseTime: 'Server responded slowly (observed {PH1})',
|
|
38
|
+
/**
|
|
39
|
+
* @description Text to tell the user that text compression (like gzip) was applied.
|
|
40
|
+
*/
|
|
41
|
+
passingTextCompression: 'Applies text compression',
|
|
42
|
+
/**
|
|
43
|
+
* @description Text to tell the user that text compression (like gzip) was not applied.
|
|
44
|
+
*/
|
|
45
|
+
failedTextCompression: 'No compression applied',
|
|
46
|
+
/**
|
|
47
|
+
* @description Text for a label describing a network request event as having redirects.
|
|
48
|
+
*/
|
|
49
|
+
redirectsLabel: 'Redirects',
|
|
50
|
+
/**
|
|
51
|
+
* @description Text for a label describing a network request event as taking too long to start delivery by the server.
|
|
52
|
+
*/
|
|
53
|
+
serverResponseTimeLabel: 'Server response time',
|
|
54
|
+
/**
|
|
55
|
+
* @description Text for a label describing a network request event as taking longer to download because it wasn't compressed.
|
|
56
|
+
*/
|
|
57
|
+
uncompressedDownload: 'Uncompressed download',
|
|
58
|
+
};
|
|
59
|
+
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/DocumentLatency.ts', UIStrings);
|
|
60
|
+
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
61
|
+
// Due to the way that DevTools throttling works we cannot see if server response took less than ~570ms.
|
|
62
|
+
// We set our failure threshold to 600ms to avoid those false positives but we want devs to shoot for 100ms.
|
|
63
|
+
const TOO_SLOW_THRESHOLD_MS = 600;
|
|
64
|
+
const TARGET_MS = 100;
|
|
65
|
+
// Threshold for compression savings.
|
|
66
|
+
const IGNORE_THRESHOLD_IN_BYTES = 1400;
|
|
67
|
+
export function isDocumentLatencyInsight(x) {
|
|
68
|
+
return x.insightKey === 'DocumentLatency';
|
|
69
|
+
}
|
|
70
|
+
function getServerResponseTime(request) {
|
|
71
|
+
// For technical reasons, Lightrider does not have `sendEnd` timing values. The
|
|
72
|
+
// closest we can get to the server response time is from a header that Lightrider
|
|
73
|
+
// sets.
|
|
74
|
+
// @ts-expect-error
|
|
75
|
+
const isLightrider = globalThis.isLightrider;
|
|
76
|
+
if (isLightrider) {
|
|
77
|
+
return request.args.data.lrServerResponseTime ?? null;
|
|
78
|
+
}
|
|
79
|
+
const timing = request.args.data.timing;
|
|
80
|
+
if (!timing) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const ms = Helpers.Timing.microToMilli(request.args.data.syntheticData.serverResponseTime);
|
|
84
|
+
return Math.round(ms);
|
|
85
|
+
}
|
|
86
|
+
function getCompressionSavings(request) {
|
|
87
|
+
const isCompressed = isRequestCompressed(request);
|
|
88
|
+
if (isCompressed) {
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
// We don't know how many bytes this asset used on the network, but we can guess it was
|
|
92
|
+
// roughly the size of the content gzipped.
|
|
93
|
+
// See https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/optimize-encoding-and-transfer for specific CSS/Script examples
|
|
94
|
+
// See https://discuss.httparchive.org/t/file-size-and-compression-savings/145 for fallback multipliers
|
|
95
|
+
// See https://letstalkaboutwebperf.com/en/gzip-brotli-server-config/ for MIME types to compress
|
|
96
|
+
const originalSize = request.args.data.decodedBodyLength;
|
|
97
|
+
let estimatedSavings = 0;
|
|
98
|
+
switch (request.args.data.mimeType) {
|
|
99
|
+
case 'text/css':
|
|
100
|
+
// Stylesheets tend to compress extremely well.
|
|
101
|
+
estimatedSavings = Math.round(originalSize * 0.8);
|
|
102
|
+
break;
|
|
103
|
+
case 'text/html':
|
|
104
|
+
case 'text/javascript':
|
|
105
|
+
// Scripts and HTML compress fairly well too.
|
|
106
|
+
estimatedSavings = Math.round(originalSize * 0.67);
|
|
107
|
+
break;
|
|
108
|
+
case 'text/plain':
|
|
109
|
+
case 'text/xml':
|
|
110
|
+
case 'text/x-component':
|
|
111
|
+
case 'application/javascript':
|
|
112
|
+
case 'application/json':
|
|
113
|
+
case 'application/manifest+json':
|
|
114
|
+
case 'application/vnd.api+json':
|
|
115
|
+
case 'application/xml':
|
|
116
|
+
case 'application/xhtml+xml':
|
|
117
|
+
case 'application/rss+xml':
|
|
118
|
+
case 'application/atom+xml':
|
|
119
|
+
case 'application/vnd.ms-fontobject':
|
|
120
|
+
case 'application/x-font-ttf':
|
|
121
|
+
case 'application/x-font-opentype':
|
|
122
|
+
case 'application/x-font-truetype':
|
|
123
|
+
case 'image/svg+xml':
|
|
124
|
+
case 'image/x-icon':
|
|
125
|
+
case 'image/vnd.microsoft.icon':
|
|
126
|
+
case 'font/ttf':
|
|
127
|
+
case 'font/eot':
|
|
128
|
+
case 'font/otf':
|
|
129
|
+
case 'font/opentype':
|
|
130
|
+
// Use the average savings in HTTPArchive.
|
|
131
|
+
estimatedSavings = Math.round(originalSize * 0.5);
|
|
132
|
+
break;
|
|
133
|
+
default: // Any other MIME types are likely already compressed.
|
|
134
|
+
}
|
|
135
|
+
// Check if the estimated savings are greater than the byte ignore threshold.
|
|
136
|
+
// Note that the estimated gzip savings are always more than 10%, so there is
|
|
137
|
+
// no percent threshold.
|
|
138
|
+
return estimatedSavings < IGNORE_THRESHOLD_IN_BYTES ? 0 : estimatedSavings;
|
|
139
|
+
}
|
|
140
|
+
function finalize(partialModel) {
|
|
141
|
+
let hasFailure = false;
|
|
142
|
+
if (partialModel.data) {
|
|
143
|
+
hasFailure = !partialModel.data.checklist.usesCompression.value ||
|
|
144
|
+
!partialModel.data.checklist.serverResponseIsFast.value || !partialModel.data.checklist.noRedirects.value;
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
insightKey: InsightKeys.DOCUMENT_LATENCY,
|
|
148
|
+
strings: UIStrings,
|
|
149
|
+
title: i18nString(UIStrings.title),
|
|
150
|
+
description: i18nString(UIStrings.description),
|
|
151
|
+
docs: 'https://developer.chrome.com/docs/performance/insights/document-latency',
|
|
152
|
+
category: InsightCategory.ALL,
|
|
153
|
+
state: hasFailure ? 'fail' : 'pass',
|
|
154
|
+
...partialModel,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
export function generateInsight(data, context) {
|
|
158
|
+
if (!context.navigation || !('navigationId' in context)) {
|
|
159
|
+
return finalize({});
|
|
160
|
+
}
|
|
161
|
+
const millisToString = context.options.insightTimeFormatters?.milli ?? i18n.TimeUtilities.millisToString;
|
|
162
|
+
const documentRequest = data.NetworkRequests.byId.get(context.navigationId);
|
|
163
|
+
if (!documentRequest) {
|
|
164
|
+
return finalize({ warnings: [InsightWarning.NO_DOCUMENT_REQUEST] });
|
|
165
|
+
}
|
|
166
|
+
const serverResponseTime = getServerResponseTime(documentRequest);
|
|
167
|
+
if (serverResponseTime === null) {
|
|
168
|
+
throw new Error('missing document request timing');
|
|
169
|
+
}
|
|
170
|
+
const serverResponseTooSlow = serverResponseTime > TOO_SLOW_THRESHOLD_MS;
|
|
171
|
+
let overallSavingsMs = 0;
|
|
172
|
+
if (serverResponseTime > TOO_SLOW_THRESHOLD_MS) {
|
|
173
|
+
overallSavingsMs = Math.max(serverResponseTime - TARGET_MS, 0);
|
|
174
|
+
}
|
|
175
|
+
const redirectDuration = Math.round(documentRequest.args.data.syntheticData.redirectionDuration / 1000);
|
|
176
|
+
overallSavingsMs += redirectDuration;
|
|
177
|
+
const metricSavings = {
|
|
178
|
+
FCP: overallSavingsMs,
|
|
179
|
+
LCP: overallSavingsMs,
|
|
180
|
+
};
|
|
181
|
+
const uncompressedResponseBytes = getCompressionSavings(documentRequest);
|
|
182
|
+
const noRedirects = redirectDuration === 0;
|
|
183
|
+
const serverResponseIsFast = !serverResponseTooSlow;
|
|
184
|
+
const usesCompression = uncompressedResponseBytes === 0;
|
|
185
|
+
return finalize({
|
|
186
|
+
relatedEvents: [documentRequest],
|
|
187
|
+
data: {
|
|
188
|
+
serverResponseTime,
|
|
189
|
+
redirectDuration: Types.Timing.Milli(redirectDuration),
|
|
190
|
+
uncompressedResponseBytes,
|
|
191
|
+
documentRequest,
|
|
192
|
+
checklist: {
|
|
193
|
+
noRedirects: {
|
|
194
|
+
label: noRedirects ? i18nString(UIStrings.passingRedirects) : i18nString(UIStrings.failedRedirects, {
|
|
195
|
+
PH1: documentRequest.args.data.redirects.length,
|
|
196
|
+
PH2: millisToString(redirectDuration),
|
|
197
|
+
}),
|
|
198
|
+
value: noRedirects,
|
|
199
|
+
},
|
|
200
|
+
serverResponseIsFast: {
|
|
201
|
+
label: serverResponseIsFast ?
|
|
202
|
+
i18nString(UIStrings.passingServerResponseTime, { PH1: millisToString(serverResponseTime) }) :
|
|
203
|
+
i18nString(UIStrings.failedServerResponseTime, { PH1: millisToString(serverResponseTime) }),
|
|
204
|
+
value: serverResponseIsFast,
|
|
205
|
+
},
|
|
206
|
+
usesCompression: {
|
|
207
|
+
label: usesCompression ? i18nString(UIStrings.passingTextCompression) :
|
|
208
|
+
i18nString(UIStrings.failedTextCompression),
|
|
209
|
+
value: usesCompression,
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
metricSavings,
|
|
214
|
+
wastedBytes: uncompressedResponseBytes,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
export function createOverlays(model) {
|
|
218
|
+
if (!model.data?.documentRequest) {
|
|
219
|
+
return [];
|
|
220
|
+
}
|
|
221
|
+
const overlays = [];
|
|
222
|
+
const event = model.data.documentRequest;
|
|
223
|
+
const redirectDurationMicro = Helpers.Timing.milliToMicro(model.data.redirectDuration);
|
|
224
|
+
const sections = [];
|
|
225
|
+
if (model.data.redirectDuration) {
|
|
226
|
+
const bounds = Helpers.Timing.traceWindowFromMicroSeconds(event.ts, (event.ts + redirectDurationMicro));
|
|
227
|
+
sections.push({ bounds, label: i18nString(UIStrings.redirectsLabel), showDuration: true });
|
|
228
|
+
overlays.push({ type: 'CANDY_STRIPED_TIME_RANGE', bounds, entry: event });
|
|
229
|
+
}
|
|
230
|
+
if (!model.data.checklist.serverResponseIsFast.value) {
|
|
231
|
+
const serverResponseTimeMicro = Helpers.Timing.milliToMicro(model.data.serverResponseTime);
|
|
232
|
+
// NOTE: NetworkRequestHandlers never makes a synthetic network request event if `timing` is missing.
|
|
233
|
+
const sendEnd = event.args.data.timing?.sendEnd ?? Types.Timing.Milli(0);
|
|
234
|
+
const sendEndMicro = Helpers.Timing.milliToMicro(sendEnd);
|
|
235
|
+
const bounds = Helpers.Timing.traceWindowFromMicroSeconds(sendEndMicro, (sendEndMicro + serverResponseTimeMicro));
|
|
236
|
+
sections.push({ bounds, label: i18nString(UIStrings.serverResponseTimeLabel), showDuration: true });
|
|
237
|
+
}
|
|
238
|
+
if (model.data.uncompressedResponseBytes) {
|
|
239
|
+
const bounds = Helpers.Timing.traceWindowFromMicroSeconds(event.args.data.syntheticData.downloadStart, (event.args.data.syntheticData.downloadStart + event.args.data.syntheticData.download));
|
|
240
|
+
sections.push({ bounds, label: i18nString(UIStrings.uncompressedDownload), showDuration: true });
|
|
241
|
+
overlays.push({ type: 'CANDY_STRIPED_TIME_RANGE', bounds, entry: event });
|
|
242
|
+
}
|
|
243
|
+
if (sections.length) {
|
|
244
|
+
overlays.push({
|
|
245
|
+
type: 'TIMESPAN_BREAKDOWN',
|
|
246
|
+
sections,
|
|
247
|
+
entry: model.data.documentRequest,
|
|
248
|
+
// Always render below because the document request is guaranteed to be
|
|
249
|
+
// the first request in the network track.
|
|
250
|
+
renderLocation: 'BELOW_EVENT',
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
overlays.push({
|
|
254
|
+
type: 'ENTRY_SELECTED',
|
|
255
|
+
entry: model.data.documentRequest,
|
|
256
|
+
});
|
|
257
|
+
return overlays;
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=DocumentLatency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentLatency.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/DocumentLatency.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAEnD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAEL,eAAe,EACf,WAAW,EAGX,cAAc,GAEf,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,0BAA0B;IACjC;;OAEG;IACH,WAAW,EACP,wOAAwO;IAC5O;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;IACpC;;;;OAIG;IACH,eAAe,EAAE,yCAAyC;IAC1D;;;OAGG;IACH,yBAAyB,EAAE,0CAA0C;IACrE;;;OAGG;IACH,wBAAwB,EAAE,0CAA0C;IACpE;;OAEG;IACH,sBAAsB,EAAE,0BAA0B;IAClD;;OAEG;IACH,qBAAqB,EAAE,wBAAwB;IAC/C;;OAEG;IACH,cAAc,EAAE,WAAW;IAC3B;;OAEG;IACH,uBAAuB,EAAE,sBAAsB;IAC/C;;OAEG;IACH,oBAAoB,EAAE,uBAAuB;CACrC,CAAC;AAEX,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,0CAA0C,EAAE,SAAS,CAAC,CAAC;AAChG,MAAM,CAAC,MAAM,UAAU,GAAwB,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAElG,w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aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAuB,CAC/G,CAAC;QACF,QAAQ,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC,CAAC;QAC/F,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC;IAC1E,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,oBAAoB;YAC1B,QAAQ;YACR,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe;YACjC,uEAAuE;YACvE,0CAA0C;YAC1C,cAAc,EAAE,aAAa;SAC9B,CAAC,CAAC;IACL,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC;QACZ,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe;KAClC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport type * as Handlers from '../handlers/handlers.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport {isRequestCompressed} from './Common.js';\nimport {\n type Checklist,\n InsightCategory,\n InsightKeys,\n type InsightModel,\n type InsightSetContext,\n InsightWarning,\n type PartialInsightModel,\n} from './types.js';\n\nexport const UIStrings = {\n /**\n * @description Title of an insight that provides a breakdown for how long it took to download the main document.\n */\n title: 'Document request latency',\n /**\n * @description Description of an insight that provides a breakdown for how long it took to download the main document.\n */\n description:\n 'Your first network request is the most important. [Reduce its latency](https://developer.chrome.com/docs/performance/insights/document-latency) by avoiding redirects, ensuring a fast server response, and enabling text compression.',\n /**\n * @description Text to tell the user that the document request does not have redirects.\n */\n passingRedirects: 'Avoids redirects',\n /**\n * @description Text to tell the user that the document request had redirects.\n * @example {3} PH1\n * @example {1000 ms} PH2\n */\n failedRedirects: 'Had redirects ({PH1} redirects, +{PH2})',\n /**\n * @description Text to tell the user that the time starting the document request to when the server started responding is acceptable.\n * @example {600 ms} PH1\n */\n passingServerResponseTime: 'Server responds quickly (observed {PH1})',\n /**\n * @description Text to tell the user that the time starting the document request to when the server started responding is not acceptable.\n * @example {601 ms} PH1\n */\n failedServerResponseTime: 'Server responded slowly (observed {PH1})',\n /**\n * @description Text to tell the user that text compression (like gzip) was applied.\n */\n passingTextCompression: 'Applies text compression',\n /**\n * @description Text to tell the user that text compression (like gzip) was not applied.\n */\n failedTextCompression: 'No compression applied',\n /**\n * @description Text for a label describing a network request event as having redirects.\n */\n redirectsLabel: 'Redirects',\n /**\n * @description Text for a label describing a network request event as taking too long to start delivery by the server.\n */\n serverResponseTimeLabel: 'Server response time',\n /**\n * @description Text for a label describing a network request event as taking longer to download because it wasn't compressed.\n */\n uncompressedDownload: 'Uncompressed download',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/DocumentLatency.ts', UIStrings);\nexport const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\n// Due to the way that DevTools throttling works we cannot see if server response took less than ~570ms.\n// We set our failure threshold to 600ms to avoid those false positives but we want devs to shoot for 100ms.\nconst TOO_SLOW_THRESHOLD_MS = 600;\nconst TARGET_MS = 100;\n\n// Threshold for compression savings.\nconst IGNORE_THRESHOLD_IN_BYTES = 1400;\n\nexport function isDocumentLatencyInsight(x: InsightModel): x is DocumentLatencyInsightModel {\n return x.insightKey === 'DocumentLatency';\n}\n\nexport type DocumentLatencyInsightModel = InsightModel<typeof UIStrings, {\n data?: {\n serverResponseTime: Types.Timing.Milli,\n redirectDuration: Types.Timing.Milli,\n uncompressedResponseBytes: number,\n checklist: Checklist<'noRedirects'|'serverResponseIsFast'|'usesCompression'>,\n documentRequest?: Types.Events.SyntheticNetworkRequest,\n },\n}>;\n\nfunction getServerResponseTime(request: Types.Events.SyntheticNetworkRequest): Types.Timing.Milli|null {\n // For technical reasons, Lightrider does not have `sendEnd` timing values. The\n // closest we can get to the server response time is from a header that Lightrider\n // sets.\n // @ts-expect-error\n const isLightrider = globalThis.isLightrider;\n if (isLightrider) {\n return request.args.data.lrServerResponseTime ?? null;\n }\n\n const timing = request.args.data.timing;\n if (!timing) {\n return null;\n }\n\n const ms = Helpers.Timing.microToMilli(request.args.data.syntheticData.serverResponseTime);\n return Math.round(ms) as Types.Timing.Milli;\n}\n\nfunction getCompressionSavings(request: Types.Events.SyntheticNetworkRequest): number {\n const isCompressed = isRequestCompressed(request);\n if (isCompressed) {\n return 0;\n }\n\n // We don't know how many bytes this asset used on the network, but we can guess it was\n // roughly the size of the content gzipped.\n // See https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/optimize-encoding-and-transfer for specific CSS/Script examples\n // See https://discuss.httparchive.org/t/file-size-and-compression-savings/145 for fallback multipliers\n // See https://letstalkaboutwebperf.com/en/gzip-brotli-server-config/ for MIME types to compress\n const originalSize = request.args.data.decodedBodyLength;\n let estimatedSavings = 0;\n switch (request.args.data.mimeType) {\n case 'text/css':\n // Stylesheets tend to compress extremely well.\n estimatedSavings = Math.round(originalSize * 0.8);\n break;\n case 'text/html':\n case 'text/javascript':\n // Scripts and HTML compress fairly well too.\n estimatedSavings = Math.round(originalSize * 0.67);\n break;\n case 'text/plain':\n case 'text/xml':\n case 'text/x-component':\n case 'application/javascript':\n case 'application/json':\n case 'application/manifest+json':\n case 'application/vnd.api+json':\n case 'application/xml':\n case 'application/xhtml+xml':\n case 'application/rss+xml':\n case 'application/atom+xml':\n case 'application/vnd.ms-fontobject':\n case 'application/x-font-ttf':\n case 'application/x-font-opentype':\n case 'application/x-font-truetype':\n case 'image/svg+xml':\n case 'image/x-icon':\n case 'image/vnd.microsoft.icon':\n case 'font/ttf':\n case 'font/eot':\n case 'font/otf':\n case 'font/opentype':\n // Use the average savings in HTTPArchive.\n estimatedSavings = Math.round(originalSize * 0.5);\n break;\n default: // Any other MIME types are likely already compressed.\n }\n // Check if the estimated savings are greater than the byte ignore threshold.\n // Note that the estimated gzip savings are always more than 10%, so there is\n // no percent threshold.\n return estimatedSavings < IGNORE_THRESHOLD_IN_BYTES ? 0 : estimatedSavings;\n}\n\nfunction finalize(partialModel: PartialInsightModel<DocumentLatencyInsightModel>): DocumentLatencyInsightModel {\n let hasFailure = false;\n if (partialModel.data) {\n hasFailure = !partialModel.data.checklist.usesCompression.value ||\n !partialModel.data.checklist.serverResponseIsFast.value || !partialModel.data.checklist.noRedirects.value;\n }\n\n return {\n insightKey: InsightKeys.DOCUMENT_LATENCY,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n docs: 'https://developer.chrome.com/docs/performance/insights/document-latency',\n category: InsightCategory.ALL,\n state: hasFailure ? 'fail' : 'pass',\n ...partialModel,\n };\n}\n\nexport function generateInsight(\n data: Handlers.Types.HandlerData, context: InsightSetContext): DocumentLatencyInsightModel {\n if (!context.navigation || !('navigationId' in context)) {\n return finalize({});\n }\n\n const millisToString = context.options.insightTimeFormatters?.milli ?? i18n.TimeUtilities.millisToString;\n\n const documentRequest = data.NetworkRequests.byId.get(context.navigationId);\n if (!documentRequest) {\n return finalize({warnings: [InsightWarning.NO_DOCUMENT_REQUEST]});\n }\n\n const serverResponseTime = getServerResponseTime(documentRequest);\n if (serverResponseTime === null) {\n throw new Error('missing document request timing');\n }\n\n const serverResponseTooSlow = serverResponseTime > TOO_SLOW_THRESHOLD_MS;\n\n let overallSavingsMs = 0;\n if (serverResponseTime > TOO_SLOW_THRESHOLD_MS) {\n overallSavingsMs = Math.max(serverResponseTime - TARGET_MS, 0);\n }\n\n const redirectDuration =\n Math.round(documentRequest.args.data.syntheticData.redirectionDuration / 1000) as Types.Timing.Milli;\n overallSavingsMs += redirectDuration;\n\n const metricSavings = {\n FCP: overallSavingsMs as Types.Timing.Milli,\n LCP: overallSavingsMs as Types.Timing.Milli,\n };\n\n const uncompressedResponseBytes = getCompressionSavings(documentRequest);\n\n const noRedirects = redirectDuration === 0;\n const serverResponseIsFast = !serverResponseTooSlow;\n const usesCompression = uncompressedResponseBytes === 0;\n\n return finalize({\n relatedEvents: [documentRequest],\n data: {\n serverResponseTime,\n redirectDuration: Types.Timing.Milli(redirectDuration),\n uncompressedResponseBytes,\n documentRequest,\n checklist: {\n noRedirects: {\n label: noRedirects ? i18nString(UIStrings.passingRedirects) : i18nString(UIStrings.failedRedirects, {\n PH1: documentRequest.args.data.redirects.length,\n PH2: millisToString(redirectDuration),\n }),\n value: noRedirects,\n },\n serverResponseIsFast: {\n label: serverResponseIsFast ?\n i18nString(UIStrings.passingServerResponseTime, {PH1: millisToString(serverResponseTime)}) :\n i18nString(UIStrings.failedServerResponseTime, {PH1: millisToString(serverResponseTime)}),\n value: serverResponseIsFast,\n },\n usesCompression: {\n label: usesCompression ? i18nString(UIStrings.passingTextCompression) :\n i18nString(UIStrings.failedTextCompression),\n value: usesCompression,\n },\n },\n },\n metricSavings,\n wastedBytes: uncompressedResponseBytes,\n });\n}\n\nexport function createOverlays(model: DocumentLatencyInsightModel): Types.Overlays.Overlay[] {\n if (!model.data?.documentRequest) {\n return [];\n }\n\n const overlays: Types.Overlays.Overlay[] = [];\n const event = model.data.documentRequest;\n const redirectDurationMicro = Helpers.Timing.milliToMicro(model.data.redirectDuration);\n\n const sections = [];\n if (model.data.redirectDuration) {\n const bounds = Helpers.Timing.traceWindowFromMicroSeconds(\n event.ts,\n (event.ts + redirectDurationMicro) as Types.Timing.Micro,\n );\n sections.push({bounds, label: i18nString(UIStrings.redirectsLabel), showDuration: true});\n overlays.push({type: 'CANDY_STRIPED_TIME_RANGE', bounds, entry: event});\n }\n if (!model.data.checklist.serverResponseIsFast.value) {\n const serverResponseTimeMicro = Helpers.Timing.milliToMicro(model.data.serverResponseTime);\n // NOTE: NetworkRequestHandlers never makes a synthetic network request event if `timing` is missing.\n const sendEnd = event.args.data.timing?.sendEnd ?? Types.Timing.Milli(0);\n const sendEndMicro = Helpers.Timing.milliToMicro(sendEnd);\n const bounds = Helpers.Timing.traceWindowFromMicroSeconds(\n sendEndMicro,\n (sendEndMicro + serverResponseTimeMicro) as Types.Timing.Micro,\n );\n sections.push({bounds, label: i18nString(UIStrings.serverResponseTimeLabel), showDuration: true});\n }\n if (model.data.uncompressedResponseBytes) {\n const bounds = Helpers.Timing.traceWindowFromMicroSeconds(\n event.args.data.syntheticData.downloadStart,\n (event.args.data.syntheticData.downloadStart + event.args.data.syntheticData.download) as Types.Timing.Micro,\n );\n sections.push({bounds, label: i18nString(UIStrings.uncompressedDownload), showDuration: true});\n overlays.push({type: 'CANDY_STRIPED_TIME_RANGE', bounds, entry: event});\n }\n\n if (sections.length) {\n overlays.push({\n type: 'TIMESPAN_BREAKDOWN',\n sections,\n entry: model.data.documentRequest,\n // Always render below because the document request is guaranteed to be\n // the first request in the network track.\n renderLocation: 'BELOW_EVENT',\n });\n }\n overlays.push({\n type: 'ENTRY_SELECTED',\n entry: model.data.documentRequest,\n });\n\n return overlays;\n}\n"]}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
2
2
|
import * as Extras from '../extras/extras.js';
|
|
3
3
|
import type * as Handlers from '../handlers/handlers.js';
|
|
4
|
-
import
|
|
4
|
+
import * as Types from '../types/types.js';
|
|
5
5
|
import { type InsightModel, type InsightSetContext } from './types.js';
|
|
6
6
|
export declare const UIStrings: {
|
|
7
7
|
/**
|
|
8
8
|
* @description Title of an insight that identifies multiple copies of the same JavaScript sources, and recommends removing the duplication.
|
|
9
9
|
*/
|
|
10
|
-
readonly title:
|
|
10
|
+
readonly title: 'Duplicated JavaScript';
|
|
11
11
|
/**
|
|
12
12
|
* @description Description of an insight that identifies multiple copies of the same JavaScript sources, and recommends removing the duplication.
|
|
13
13
|
*/
|
|
14
|
-
readonly description:
|
|
14
|
+
readonly description: 'Remove large, [duplicate JavaScript modules](https://developer.chrome.com/docs/performance/insights/duplicated-javascript) from bundles to reduce unnecessary bytes consumed by network activity';
|
|
15
15
|
/**
|
|
16
16
|
* @description Label for a column in a data table; entries will be the locations of JavaScript or CSS code, e.g. the name of a JavaScript package or module.
|
|
17
17
|
*/
|
|
18
|
-
readonly columnSource:
|
|
18
|
+
readonly columnSource: 'Source';
|
|
19
19
|
/**
|
|
20
20
|
* @description Label for a column in a data table; entries will be the number of wasted bytes due to duplication of a web resource.
|
|
21
21
|
*/
|
|
22
|
-
readonly columnDuplicatedBytes:
|
|
22
|
+
readonly columnDuplicatedBytes: 'Duplicated bytes';
|
|
23
23
|
/**
|
|
24
24
|
* @description Message shown when no duplicated JavaScript is found.
|
|
25
25
|
*/
|
|
26
|
-
readonly noDuplicatedJavaScript:
|
|
26
|
+
readonly noDuplicatedJavaScript: 'No duplicated JavaScript found';
|
|
27
27
|
};
|
|
28
28
|
export declare const i18nString: i18n.LocalizeString;
|
|
29
29
|
export type DuplicatedJavaScriptInsightModel = InsightModel<typeof UIStrings, {
|