@paulirish/trace_engine 0.0.67-beta.2 → 0.0.68
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 +0 -2
- 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 +15 -4
- package/core/platform/StringUtilities.js +767 -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 +34 -6
- package/generated/protocol.js +3312 -0
- package/locales/af.json +94 -97
- package/locales/am.json +353 -356
- package/locales/ar.json +354 -357
- package/locales/as.json +352 -355
- package/locales/az.json +343 -346
- package/locales/be.json +353 -356
- package/locales/bg.json +353 -356
- package/locales/bn.json +353 -356
- package/locales/bs.json +247 -250
- package/locales/ca.json +285 -288
- package/locales/cs.json +338 -341
- package/locales/cy.json +124 -127
- package/locales/da.json +202 -205
- package/locales/de.json +222 -225
- package/locales/el.json +338 -341
- package/locales/en-GB.json +78 -81
- package/locales/en-US.json +250 -256
- package/locales/en-XL.json +1052 -0
- package/locales/es-419.json +278 -281
- package/locales/es.json +279 -282
- package/locales/et.json +237 -240
- package/locales/eu.json +124 -127
- package/locales/fa.json +353 -356
- package/locales/fi.json +283 -286
- package/locales/fil.json +32 -35
- package/locales/fr-CA.json +310 -313
- package/locales/fr.json +307 -310
- package/locales/gl.json +263 -266
- package/locales/gu.json +354 -357
- package/locales/he.json +354 -357
- package/locales/hi.json +338 -341
- package/locales/hr.json +238 -241
- package/locales/hu.json +344 -347
- package/locales/hy.json +353 -356
- package/locales/id.json +67 -70
- package/locales/is.json +305 -308
- package/locales/it.json +175 -178
- package/locales/ja.json +353 -356
- package/locales/ka.json +354 -357
- package/locales/kk.json +354 -357
- package/locales/km.json +353 -356
- package/locales/kn.json +354 -357
- package/locales/ko.json +353 -356
- package/locales/ky.json +352 -355
- package/locales/lo.json +354 -357
- package/locales/lt.json +322 -325
- package/locales/lv.json +319 -322
- package/locales/mk.json +354 -357
- package/locales/ml.json +353 -356
- package/locales/mn.json +353 -356
- package/locales/mr.json +353 -356
- package/locales/ms.json +14 -17
- package/locales/my.json +352 -355
- package/locales/ne.json +338 -341
- package/locales/nl.json +91 -94
- package/locales/no.json +179 -182
- package/locales/or.json +353 -356
- package/locales/pa.json +353 -356
- package/locales/pl.json +309 -312
- package/locales/pt-PT.json +275 -278
- package/locales/pt.json +268 -271
- package/locales/ro.json +309 -312
- package/locales/ru.json +353 -356
- package/locales/si.json +354 -357
- package/locales/sk.json +335 -338
- package/locales/sl.json +220 -223
- package/locales/sq.json +318 -321
- package/locales/sr-Latn.json +255 -258
- package/locales/sr.json +354 -357
- package/locales/sv.json +281 -284
- package/locales/sw.json +68 -71
- package/locales/ta.json +354 -357
- package/locales/te.json +352 -355
- package/locales/th.json +354 -357
- package/locales/tr.json +328 -331
- package/locales/uk.json +353 -356
- package/locales/ur.json +354 -357
- package/locales/uz.json +168 -171
- package/locales/vi.json +354 -357
- package/locales/zh-HK.json +354 -357
- package/locales/zh-TW.json +353 -356
- package/locales/zh.json +353 -356
- package/locales/zu.json +52 -55
- package/models/cpu_profile/CPUProfileDataModel.d.ts +0 -33
- package/models/cpu_profile/CPUProfileDataModel.js +517 -0
- package/models/cpu_profile/CPUProfileDataModel.js.map +1 -0
- package/models/cpu_profile/ProfileTreeModel.d.ts +1 -2
- 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 +113 -0
- package/models/trace/EventsSerializer.js.map +1 -0
- package/models/trace/LanternComputationData.js +394 -0
- package/models/trace/LanternComputationData.js.map +1 -0
- package/models/trace/ModelImpl.js +179 -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.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 +678 -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.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.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 +155 -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.js +148 -0
- package/models/trace/handlers/ImagePaintingHandler.js.map +1 -0
- package/models/trace/handlers/InitiatorsHandler.js +169 -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.js +104 -0
- package/models/trace/handlers/LayerTreeHandler.js.map +1 -0
- package/models/trace/handlers/LayoutShiftsHandler.js +449 -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.js +584 -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.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 +264 -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.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.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.js +527 -0
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -0
- package/models/trace/helpers/SyntheticEvents.d.ts +0 -8
- package/models/trace/helpers/SyntheticEvents.js +73 -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.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 +5 -5
- 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 +12 -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 +213 -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.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.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.d.ts +5 -1
- package/models/trace/lantern/metrics/LargestContentfulPaint.js +187 -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 +461 -0
- package/models/trace/lantern/simulation/Simulator.js.map +1 -0
- 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 +23 -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.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 +21 -16
- 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 -40
- 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 -2
- 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 -228
- 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 -16
- package/core/host/ResourceLoader.d.ts +0 -15
- package/core/host/UserMetrics.d.ts +0 -116
- package/core/host/UserMetricsEnums.d.ts +0 -888
- 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 -9
- package/core/root/Runtime.d.ts +0 -353
- 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 -185
- package/core/sdk/CSSNavigation.d.ts +0 -10
- package/core/sdk/CSSProperty.d.ts +0 -53
- package/core/sdk/CSSPropertyParser.d.ts +0 -126
- 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 -440
- package/core/sdk/DOMStorageModel.d.ts +0 -79
- package/core/sdk/DebuggerModel.d.ts +0 -305
- 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 -497
- 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 -280
- package/core/sdk/RuntimeModel.d.ts +0 -164
- package/core/sdk/SDKModel.d.ts +0 -30
- package/core/sdk/SDKSettings.d.ts +0 -54
- 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 -211
- package/core/sdk/SourceMapCache.d.ts +0 -12
- package/core/sdk/SourceMapFunctionRanges.d.ts +0 -23
- 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 -184
- 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/Markdown.d.ts +0 -13
- 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 -12
- package/entrypoints/formatter_actions/formatter_actions.d.ts +0 -65
- package/generated/InspectorBackendCommands.d.ts +0 -14
- package/generated/SupportedCSSProperties.d.ts +0 -18
- package/generated/protocol-mapping.d.ts +0 -5985
- package/generated/protocol-proxy-api.d.ts +0 -5447
- 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 -157
- 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/marked/package/lib/marked.esm.d.ts +0 -760
- package/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +0 -70
- package/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +0 -40
- package/third_party/source-map-scopes-codec/package/src/codec.d.ts +0 -49
- package/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +0 -33
- 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 -9
- 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 -169
- 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,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"declarationDir": ".",
|
|
6
|
+
"emitDeclarationOnly": true,
|
|
7
|
+
"outDir": ".",
|
|
8
|
+
"rootDir": "../../../../../../../../front_end/models/trace/lantern/metrics",
|
|
9
|
+
"rootDirs": [
|
|
10
|
+
"../../../../../../../../",
|
|
11
|
+
"../../../../../"
|
|
12
|
+
],
|
|
13
|
+
"skipLibCheck": true
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts",
|
|
17
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/Interactive.ts",
|
|
18
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts",
|
|
19
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/MaxPotentialFID.ts",
|
|
20
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/Metric.ts",
|
|
21
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/SpeedIndex.ts",
|
|
22
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/TBTUtils.ts",
|
|
23
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/TotalBlockingTime.ts",
|
|
24
|
+
"../../../../../../../../front_end/legacy/legacy-defs.d.ts",
|
|
25
|
+
"../../../../../../../../front_end/global_typings/global_defs.d.ts",
|
|
26
|
+
"../../../../../../../../node_modules/@types/filesystem/index.d.ts",
|
|
27
|
+
"../../../../../../../../node_modules/@types/filewriter/index.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"references": [
|
|
30
|
+
{
|
|
31
|
+
"path": "../core/bundle-tsconfig.ref.json"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "../graph/bundle-tsconfig.ref.json"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"path": "../simulation/bundle-tsconfig.ref.json"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"path": "../types/bundle-tsconfig.ref.json"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
export * from './FirstContentfulPaint.js';
|
|
5
|
+
export * from './Interactive.js';
|
|
6
|
+
export * from './LargestContentfulPaint.js';
|
|
7
|
+
export * from './MaxPotentialFID.js';
|
|
8
|
+
export * from './Metric.js';
|
|
9
|
+
export * from './SpeedIndex.js';
|
|
10
|
+
export * from './TotalBlockingTime.js';
|
|
11
|
+
export * as TBTUtils from './TBTUtils.js';
|
|
12
|
+
//# sourceMappingURL=metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/metrics/metrics.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,eAAe,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\nexport * from './FirstContentfulPaint.js';\nexport * from './Interactive.js';\nexport * from './LargestContentfulPaint.js';\nexport * from './MaxPotentialFID.js';\nexport * from './Metric.js';\nexport * from './SpeedIndex.js';\nexport * from './TotalBlockingTime.js';\nexport * as TBTUtils from './TBTUtils.js';\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": false,
|
|
4
|
+
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"checkJs": false,
|
|
6
|
+
"composite": false,
|
|
7
|
+
"declaration": false,
|
|
8
|
+
"disableSourceOfProjectReferenceRedirect": true,
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"incremental": false,
|
|
12
|
+
"inlineSources": true,
|
|
13
|
+
"lib": [
|
|
14
|
+
"ES2023",
|
|
15
|
+
"ES2024.Promise",
|
|
16
|
+
"ESNext.Iterator",
|
|
17
|
+
"ESNext.Collection",
|
|
18
|
+
"ESNext.Array"
|
|
19
|
+
],
|
|
20
|
+
"module": "esnext",
|
|
21
|
+
"moduleResolution": "bundler",
|
|
22
|
+
"noEmit": true,
|
|
23
|
+
"noEmitOnError": true,
|
|
24
|
+
"noFallthroughCasesInSwitch": true,
|
|
25
|
+
"noImplicitOverride": true,
|
|
26
|
+
"noImplicitReturns": true,
|
|
27
|
+
"outDir": ".",
|
|
28
|
+
"preserveConstEnums": true,
|
|
29
|
+
"rootDir": "../../../../../../../../front_end/models/trace/lantern/metrics",
|
|
30
|
+
"rootDirs": [
|
|
31
|
+
"../../../../../../../../",
|
|
32
|
+
"../../../../../"
|
|
33
|
+
],
|
|
34
|
+
"skipLibCheck": true,
|
|
35
|
+
"sourceMap": true,
|
|
36
|
+
"strict": true,
|
|
37
|
+
"target": "es2023",
|
|
38
|
+
"typeRoots": [
|
|
39
|
+
"../../../../../../../../node_modules/@types",
|
|
40
|
+
"../../../../../../../../node_modules"
|
|
41
|
+
],
|
|
42
|
+
"types": [
|
|
43
|
+
"node",
|
|
44
|
+
"undici-types"
|
|
45
|
+
],
|
|
46
|
+
"useUnknownInCatchVariables": false
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts",
|
|
50
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/Interactive.ts",
|
|
51
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts",
|
|
52
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/MaxPotentialFID.ts",
|
|
53
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/Metric.ts",
|
|
54
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/SpeedIndex.ts",
|
|
55
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/TBTUtils.ts",
|
|
56
|
+
"../../../../../../../../front_end/models/trace/lantern/metrics/TotalBlockingTime.ts"
|
|
57
|
+
],
|
|
58
|
+
"references": [
|
|
59
|
+
{
|
|
60
|
+
"path": "../core/bundle-tsconfig.ref.json"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"path": "../graph/bundle-tsconfig.ref.json"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"path": "../simulation/bundle-tsconfig.ref.json"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"path": "../types/bundle-tsconfig.ref.json"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,116 @@
|
|
|
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 Core from '../core/core.js';
|
|
5
|
+
import { TCPConnection } from './TCPConnection.js';
|
|
6
|
+
const DEFAULT_SERVER_RESPONSE_TIME = 30;
|
|
7
|
+
const TLS_SCHEMES = ['https', 'wss'];
|
|
8
|
+
// Each origin can have 6 simultaneous connections open
|
|
9
|
+
// https://cs.chromium.org/chromium/src/net/socket/client_socket_pool_manager.cc?type=cs&q="int+g_max_sockets_per_group"
|
|
10
|
+
const CONNECTIONS_PER_ORIGIN = 6;
|
|
11
|
+
export class ConnectionPool {
|
|
12
|
+
options;
|
|
13
|
+
records;
|
|
14
|
+
connectionsByOrigin;
|
|
15
|
+
connectionsByRequest;
|
|
16
|
+
_connectionsInUse;
|
|
17
|
+
connectionReusedByRequestId;
|
|
18
|
+
constructor(records, options) {
|
|
19
|
+
this.options = options;
|
|
20
|
+
this.records = records;
|
|
21
|
+
this.connectionsByOrigin = new Map();
|
|
22
|
+
this.connectionsByRequest = new Map();
|
|
23
|
+
this._connectionsInUse = new Set();
|
|
24
|
+
this.connectionReusedByRequestId = Core.NetworkAnalyzer.estimateIfConnectionWasReused(records, {
|
|
25
|
+
forceCoarseEstimates: true,
|
|
26
|
+
});
|
|
27
|
+
this.initializeConnections();
|
|
28
|
+
}
|
|
29
|
+
connectionsInUse() {
|
|
30
|
+
return Array.from(this._connectionsInUse);
|
|
31
|
+
}
|
|
32
|
+
initializeConnections() {
|
|
33
|
+
const connectionReused = this.connectionReusedByRequestId;
|
|
34
|
+
const additionalRttByOrigin = this.options.additionalRttByOrigin;
|
|
35
|
+
const serverResponseTimeByOrigin = this.options.serverResponseTimeByOrigin;
|
|
36
|
+
const recordsByOrigin = Core.NetworkAnalyzer.groupByOrigin(this.records);
|
|
37
|
+
for (const [origin, requests] of recordsByOrigin.entries()) {
|
|
38
|
+
const connections = [];
|
|
39
|
+
const additionalRtt = additionalRttByOrigin.get(origin) || 0;
|
|
40
|
+
const responseTime = serverResponseTimeByOrigin.get(origin) || DEFAULT_SERVER_RESPONSE_TIME;
|
|
41
|
+
for (const request of requests) {
|
|
42
|
+
if (connectionReused.get(request.requestId)) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const isTLS = TLS_SCHEMES.includes(request.parsedURL.scheme);
|
|
46
|
+
const isMultiplexed = Core.NetworkAnalyzer.isMultiplexedProtocol(request.protocol);
|
|
47
|
+
const connection = new TCPConnection(this.options.rtt + additionalRtt, this.options.throughput, responseTime, isTLS, isMultiplexed);
|
|
48
|
+
connections.push(connection);
|
|
49
|
+
}
|
|
50
|
+
if (!connections.length) {
|
|
51
|
+
throw new Core.LanternError(`Could not find a connection for origin: ${origin}`);
|
|
52
|
+
}
|
|
53
|
+
// Make sure each origin has minimum number of connections available for max throughput.
|
|
54
|
+
// But only if it's not over a multiplexed protocol which maximizes throughput already.
|
|
55
|
+
const minConnections = connections[0].isMultiplexed() ? 1 : CONNECTIONS_PER_ORIGIN;
|
|
56
|
+
while (connections.length < minConnections) {
|
|
57
|
+
connections.push(connections[0].clone());
|
|
58
|
+
}
|
|
59
|
+
this.connectionsByOrigin.set(origin, connections);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
findAvailableConnectionWithLargestCongestionWindow(connections) {
|
|
63
|
+
let maxConnection = null;
|
|
64
|
+
for (let i = 0; i < connections.length; i++) {
|
|
65
|
+
const connection = connections[i];
|
|
66
|
+
// Connections that are in use are never available.
|
|
67
|
+
if (this._connectionsInUse.has(connection)) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
// This connection is a match and is available! Update our max if it has a larger congestionWindow
|
|
71
|
+
const currentMax = (maxConnection?.congestionWindow) || -Infinity;
|
|
72
|
+
if (connection.congestionWindow > currentMax) {
|
|
73
|
+
maxConnection = connection;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return maxConnection;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* This method finds an available connection to the origin specified by the network request or null
|
|
80
|
+
* if no connection was available. If returned, connection will not be available for other network
|
|
81
|
+
* records until release is called.
|
|
82
|
+
*/
|
|
83
|
+
acquire(request) {
|
|
84
|
+
if (this.connectionsByRequest.has(request)) {
|
|
85
|
+
throw new Core.LanternError('Record already has a connection');
|
|
86
|
+
}
|
|
87
|
+
const origin = request.parsedURL.securityOrigin;
|
|
88
|
+
const connections = this.connectionsByOrigin.get(origin) || [];
|
|
89
|
+
const connectionToUse = this.findAvailableConnectionWithLargestCongestionWindow(connections);
|
|
90
|
+
if (!connectionToUse) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
this._connectionsInUse.add(connectionToUse);
|
|
94
|
+
this.connectionsByRequest.set(request, connectionToUse);
|
|
95
|
+
return connectionToUse;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Return the connection currently being used to fetch a request. If no connection
|
|
99
|
+
* currently being used for this request, an error will be thrown.
|
|
100
|
+
*/
|
|
101
|
+
acquireActiveConnectionFromRequest(request) {
|
|
102
|
+
const activeConnection = this.connectionsByRequest.get(request);
|
|
103
|
+
if (!activeConnection) {
|
|
104
|
+
throw new Core.LanternError('Could not find an active connection for request');
|
|
105
|
+
}
|
|
106
|
+
return activeConnection;
|
|
107
|
+
}
|
|
108
|
+
release(request) {
|
|
109
|
+
const connection = this.connectionsByRequest.get(request);
|
|
110
|
+
this.connectionsByRequest.delete(request);
|
|
111
|
+
if (connection) {
|
|
112
|
+
this._connectionsInUse.delete(connection);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=ConnectionPool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionPool.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/simulation/ConnectionPool.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAGxC,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEjD,MAAM,4BAA4B,GAAG,EAAE,CAAC;AACxC,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAErC,uDAAuD;AACvD,wHAAwH;AACxH,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAEjC,MAAM,OAAO,cAAc;IACzB,OAAO,CAAuC;IAC9C,OAAO,CAA2B;IAClC,mBAAmB,CAA+B;IAClD,oBAAoB,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,CAAC;YACtB,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,iDAAiD,CAAC,CAAC;QACjF,CAAC;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,OAAO,CAAC,OAA+B;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;CACF","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 Core from '../core/core.js';\nimport type * as Lantern from '../types/types.js';\n\nimport {TCPConnection} from './TCPConnection.js';\n\nconst DEFAULT_SERVER_RESPONSE_TIME = 30;\nconst TLS_SCHEMES = ['https', 'wss'];\n\n// Each origin can have 6 simultaneous connections open\n// https://cs.chromium.org/chromium/src/net/socket/client_socket_pool_manager.cc?type=cs&q=\"int+g_max_sockets_per_group\"\nconst CONNECTIONS_PER_ORIGIN = 6;\n\nexport class ConnectionPool {\n options: Required<Lantern.Simulation.Options>;\n records: Lantern.NetworkRequest[];\n connectionsByOrigin: Map<string, TCPConnection[]>;\n connectionsByRequest: Map<Lantern.NetworkRequest, TCPConnection>;\n _connectionsInUse: Set<TCPConnection>;\n connectionReusedByRequestId: Map<string, boolean>;\n\n constructor(records: Lantern.NetworkRequest[], options: Required<Lantern.Simulation.Options>) {\n this.options = options;\n\n this.records = records;\n this.connectionsByOrigin = new Map();\n this.connectionsByRequest = new Map();\n this._connectionsInUse = new Set();\n this.connectionReusedByRequestId = Core.NetworkAnalyzer.estimateIfConnectionWasReused(records, {\n forceCoarseEstimates: true,\n });\n\n this.initializeConnections();\n }\n\n connectionsInUse(): TCPConnection[] {\n return Array.from(this._connectionsInUse);\n }\n\n initializeConnections(): void {\n const connectionReused = this.connectionReusedByRequestId;\n const additionalRttByOrigin = this.options.additionalRttByOrigin;\n const serverResponseTimeByOrigin = this.options.serverResponseTimeByOrigin;\n\n const recordsByOrigin = Core.NetworkAnalyzer.groupByOrigin(this.records);\n for (const [origin, requests] of recordsByOrigin.entries()) {\n const connections = [];\n const additionalRtt = additionalRttByOrigin.get(origin) || 0;\n const responseTime = serverResponseTimeByOrigin.get(origin) || DEFAULT_SERVER_RESPONSE_TIME;\n\n for (const request of requests) {\n if (connectionReused.get(request.requestId)) {\n continue;\n }\n\n const isTLS = TLS_SCHEMES.includes(request.parsedURL.scheme);\n const isMultiplexed = Core.NetworkAnalyzer.isMultiplexedProtocol(request.protocol);\n const connection = new TCPConnection(\n this.options.rtt + additionalRtt,\n this.options.throughput,\n responseTime,\n isTLS,\n isMultiplexed,\n );\n\n connections.push(connection);\n }\n\n if (!connections.length) {\n throw new Core.LanternError(`Could not find a connection for origin: ${origin}`);\n }\n\n // Make sure each origin has minimum number of connections available for max throughput.\n // But only if it's not over a multiplexed protocol which maximizes throughput already.\n const minConnections = connections[0].isMultiplexed() ? 1 : CONNECTIONS_PER_ORIGIN;\n while (connections.length < minConnections) {\n connections.push(connections[0].clone());\n }\n\n this.connectionsByOrigin.set(origin, connections);\n }\n }\n\n findAvailableConnectionWithLargestCongestionWindow(connections: TCPConnection[]): TCPConnection|null {\n let maxConnection: TCPConnection|null = null;\n for (let i = 0; i < connections.length; i++) {\n const connection = connections[i];\n\n // Connections that are in use are never available.\n if (this._connectionsInUse.has(connection)) {\n continue;\n }\n\n // This connection is a match and is available! Update our max if it has a larger congestionWindow\n const currentMax = (maxConnection?.congestionWindow) || -Infinity;\n if (connection.congestionWindow > currentMax) {\n maxConnection = connection;\n }\n }\n\n return maxConnection;\n }\n\n /**\n * This method finds an available connection to the origin specified by the network request or null\n * if no connection was available. If returned, connection will not be available for other network\n * records until release is called.\n */\n acquire(request: Lantern.NetworkRequest): TCPConnection|null {\n if (this.connectionsByRequest.has(request)) {\n throw new Core.LanternError('Record already has a connection');\n }\n\n const origin = request.parsedURL.securityOrigin;\n const connections = this.connectionsByOrigin.get(origin) || [];\n const connectionToUse = this.findAvailableConnectionWithLargestCongestionWindow(connections);\n\n if (!connectionToUse) {\n return null;\n }\n\n this._connectionsInUse.add(connectionToUse);\n this.connectionsByRequest.set(request, connectionToUse);\n return connectionToUse;\n }\n\n /**\n * Return the connection currently being used to fetch a request. If no connection\n * currently being used for this request, an error will be thrown.\n */\n acquireActiveConnectionFromRequest(request: Lantern.NetworkRequest): TCPConnection {\n const activeConnection = this.connectionsByRequest.get(request);\n if (!activeConnection) {\n throw new Core.LanternError('Could not find an active connection for request');\n }\n\n return activeConnection;\n }\n\n release(request: Lantern.NetworkRequest): void {\n const connection = this.connectionsByRequest.get(request);\n this.connectionsByRequest.delete(request);\n if (connection) {\n this._connectionsInUse.delete(connection);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
const DEVTOOLS_RTT_ADJUSTMENT_FACTOR = 3.75;
|
|
5
|
+
const DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR = 0.9;
|
|
6
|
+
const throttling = {
|
|
7
|
+
DEVTOOLS_RTT_ADJUSTMENT_FACTOR,
|
|
8
|
+
DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,
|
|
9
|
+
// These values align with WebPageTest's definition of "Fast 3G"
|
|
10
|
+
// But offer similar characteristics to roughly the 75th percentile of 4G connections.
|
|
11
|
+
mobileSlow4G: {
|
|
12
|
+
rttMs: 150,
|
|
13
|
+
throughputKbps: 1.6 * 1024,
|
|
14
|
+
requestLatencyMs: 150 * DEVTOOLS_RTT_ADJUSTMENT_FACTOR,
|
|
15
|
+
downloadThroughputKbps: 1.6 * 1024 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,
|
|
16
|
+
uploadThroughputKbps: 750 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,
|
|
17
|
+
cpuSlowdownMultiplier: 4,
|
|
18
|
+
},
|
|
19
|
+
// These values partially align with WebPageTest's definition of "Regular 3G".
|
|
20
|
+
// These values are meant to roughly align with Chrome UX report's 3G definition which are based
|
|
21
|
+
// on HTTP RTT of 300-1400ms and downlink throughput of <700kbps.
|
|
22
|
+
mobileRegular3G: {
|
|
23
|
+
rttMs: 300,
|
|
24
|
+
throughputKbps: 700,
|
|
25
|
+
requestLatencyMs: 300 * DEVTOOLS_RTT_ADJUSTMENT_FACTOR,
|
|
26
|
+
downloadThroughputKbps: 700 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,
|
|
27
|
+
uploadThroughputKbps: 700 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,
|
|
28
|
+
cpuSlowdownMultiplier: 4,
|
|
29
|
+
},
|
|
30
|
+
// Using a "broadband" connection type
|
|
31
|
+
// Corresponds to "Dense 4G 25th percentile" in https://docs.google.com/document/d/1Ft1Bnq9-t4jK5egLSOc28IL4TvR-Tt0se_1faTA4KTY/edit#heading=h.bb7nfy2x9e5v
|
|
32
|
+
desktopDense4G: {
|
|
33
|
+
rttMs: 40,
|
|
34
|
+
throughputKbps: 10 * 1024,
|
|
35
|
+
cpuSlowdownMultiplier: 1,
|
|
36
|
+
requestLatencyMs: 0, // 0 means unset
|
|
37
|
+
downloadThroughputKbps: 0,
|
|
38
|
+
uploadThroughputKbps: 0,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
const Constants = {
|
|
42
|
+
throttling,
|
|
43
|
+
};
|
|
44
|
+
export { Constants };
|
|
45
|
+
//# sourceMappingURL=Constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/simulation/Constants.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAC5C,MAAM,qCAAqC,GAAG,GAAG,CAAC;AAgClD,MAAM,UAAU,GAAuB;IACrC,8BAA8B;IAC9B,qCAAqC;IACrC,gEAAgE;IAChE,sFAAsF;IACtF,YAAY,EAAE;QACZ,KAAK,EAAE,GAAG;QACV,cAAc,EAAE,GAAG,GAAG,IAAI;QAC1B,gBAAgB,EAAE,GAAG,GAAG,8BAA8B;QACtD,sBAAsB,EAAE,GAAG,GAAG,IAAI,GAAG,qCAAqC;QAC1E,oBAAoB,EAAE,GAAG,GAAG,qCAAqC;QACjE,qBAAqB,EAAE,CAAC;KACzB;IACD,8EAA8E;IAC9E,gGAAgG;IAChG,iEAAiE;IACjE,eAAe,EAAE;QACf,KAAK,EAAE,GAAG;QACV,cAAc,EAAE,GAAG;QACnB,gBAAgB,EAAE,GAAG,GAAG,8BAA8B;QACtD,sBAAsB,EAAE,GAAG,GAAG,qCAAqC;QACnE,oBAAoB,EAAE,GAAG,GAAG,qCAAqC;QACjE,qBAAqB,EAAE,CAAC;KACzB;IACD,sCAAsC;IACtC,2JAA2J;IAC3J,cAAc,EAAE;QACd,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,EAAE,GAAG,IAAI;QACzB,qBAAqB,EAAE,CAAC;QACxB,gBAAgB,EAAE,CAAC,EAAG,gBAAgB;QACtC,sBAAsB,EAAE,CAAC;QACzB,oBAAoB,EAAE,CAAC;KACxB;CACF,CAAC;AAEF,MAAM,SAAS,GAAqC;IAClD,UAAU;CACX,CAAC;AAEF,OAAO,EAAC,SAAS,EAAC,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\nconst DEVTOOLS_RTT_ADJUSTMENT_FACTOR = 3.75;\nconst DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR = 0.9;\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport interface ThrottlingSettings {\n DEVTOOLS_RTT_ADJUSTMENT_FACTOR: number;\n DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR: number;\n mobileSlow4G: {\n rttMs: number,\n throughputKbps: number,\n requestLatencyMs: number,\n downloadThroughputKbps: number,\n uploadThroughputKbps: number,\n cpuSlowdownMultiplier: number,\n };\n mobileRegular3G: {\n rttMs: number,\n throughputKbps: number,\n requestLatencyMs: number,\n downloadThroughputKbps: number,\n uploadThroughputKbps: number,\n cpuSlowdownMultiplier: number,\n };\n desktopDense4G: {\n rttMs: number,\n throughputKbps: number,\n cpuSlowdownMultiplier: number,\n requestLatencyMs: number,\n downloadThroughputKbps: number,\n uploadThroughputKbps: number,\n };\n}\n\nconst throttling: ThrottlingSettings = {\n DEVTOOLS_RTT_ADJUSTMENT_FACTOR,\n DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,\n // These values align with WebPageTest's definition of \"Fast 3G\"\n // But offer similar characteristics to roughly the 75th percentile of 4G connections.\n mobileSlow4G: {\n rttMs: 150,\n throughputKbps: 1.6 * 1024,\n requestLatencyMs: 150 * DEVTOOLS_RTT_ADJUSTMENT_FACTOR,\n downloadThroughputKbps: 1.6 * 1024 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,\n uploadThroughputKbps: 750 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,\n cpuSlowdownMultiplier: 4,\n },\n // These values partially align with WebPageTest's definition of \"Regular 3G\".\n // These values are meant to roughly align with Chrome UX report's 3G definition which are based\n // on HTTP RTT of 300-1400ms and downlink throughput of <700kbps.\n mobileRegular3G: {\n rttMs: 300,\n throughputKbps: 700,\n requestLatencyMs: 300 * DEVTOOLS_RTT_ADJUSTMENT_FACTOR,\n downloadThroughputKbps: 700 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,\n uploadThroughputKbps: 700 * DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR,\n cpuSlowdownMultiplier: 4,\n },\n // Using a \"broadband\" connection type\n // Corresponds to \"Dense 4G 25th percentile\" in https://docs.google.com/document/d/1Ft1Bnq9-t4jK5egLSOc28IL4TvR-Tt0se_1faTA4KTY/edit#heading=h.bb7nfy2x9e5v\n desktopDense4G: {\n rttMs: 40,\n throughputKbps: 10 * 1024,\n cpuSlowdownMultiplier: 1,\n requestLatencyMs: 0, // 0 means unset\n downloadThroughputKbps: 0,\n uploadThroughputKbps: 0,\n },\n};\n\nconst Constants: {throttling: ThrottlingSettings} = {\n throttling,\n};\n\nexport {Constants};\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
// A DNS lookup will usually take ~1-2 roundtrips of connection latency plus the extra DNS routing time.
|
|
5
|
+
// Example: https://www.webpagetest.org/result/180703_3A_e33ec79747c002ed4d7bcbfc81462203/1/details/#waterfall_view_step1
|
|
6
|
+
// Example: https://www.webpagetest.org/result/180707_1M_89673eb633b5d98386de95dfcf9b33d5/1/details/#waterfall_view_step1
|
|
7
|
+
// DNS is highly variable though, many times it's a little more than 1, but can easily be 4-5x RTT.
|
|
8
|
+
// We'll use 2 since it seems to give the most accurate results on average, but this can be tweaked.
|
|
9
|
+
const DNS_RESOLUTION_RTT_MULTIPLIER = 2;
|
|
10
|
+
class DNSCache {
|
|
11
|
+
static rttMultiplier = DNS_RESOLUTION_RTT_MULTIPLIER;
|
|
12
|
+
rtt;
|
|
13
|
+
resolvedDomainNames;
|
|
14
|
+
constructor({ rtt }) {
|
|
15
|
+
this.rtt = rtt;
|
|
16
|
+
this.resolvedDomainNames = new Map();
|
|
17
|
+
}
|
|
18
|
+
getTimeUntilResolution(request, options) {
|
|
19
|
+
const { requestedAt = 0, shouldUpdateCache = false } = options || {};
|
|
20
|
+
const domain = request.parsedURL.host;
|
|
21
|
+
const cacheEntry = this.resolvedDomainNames.get(domain);
|
|
22
|
+
let timeUntilResolved = this.rtt * DNSCache.rttMultiplier;
|
|
23
|
+
if (cacheEntry) {
|
|
24
|
+
const timeUntilCachedIsResolved = Math.max(cacheEntry.resolvedAt - requestedAt, 0);
|
|
25
|
+
timeUntilResolved = Math.min(timeUntilCachedIsResolved, timeUntilResolved);
|
|
26
|
+
}
|
|
27
|
+
const resolvedAt = requestedAt + timeUntilResolved;
|
|
28
|
+
if (shouldUpdateCache) {
|
|
29
|
+
this.updateCacheResolvedAtIfNeeded(request, resolvedAt);
|
|
30
|
+
}
|
|
31
|
+
return timeUntilResolved;
|
|
32
|
+
}
|
|
33
|
+
updateCacheResolvedAtIfNeeded(request, resolvedAt) {
|
|
34
|
+
const domain = request.parsedURL.host;
|
|
35
|
+
const cacheEntry = this.resolvedDomainNames.get(domain) || { resolvedAt };
|
|
36
|
+
cacheEntry.resolvedAt = Math.min(cacheEntry.resolvedAt, resolvedAt);
|
|
37
|
+
this.resolvedDomainNames.set(domain, cacheEntry);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Forcefully sets the DNS resolution time for a request.
|
|
41
|
+
* Useful for testing and alternate execution simulations.
|
|
42
|
+
*/
|
|
43
|
+
setResolvedAt(domain, resolvedAt) {
|
|
44
|
+
this.resolvedDomainNames.set(domain, { resolvedAt });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export { DNSCache };
|
|
48
|
+
//# sourceMappingURL=DNSCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DNSCache.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/simulation/DNSCache.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAI7B,wGAAwG;AACxG,yHAAyH;AACzH,yHAAyH;AACzH,mGAAmG;AACnG,oGAAoG;AACpG,MAAM,6BAA6B,GAAG,CAA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AC,CAAC;QACxE,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACpE,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACnD,CAAC;IAED;;;OAGG;IACH,aAAa,CAAC,MAAc,EAAE,UAAkB;QAC9C,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAC,UAAU,EAAC,CAAC,CAAC;IACrD,CAAC;CACF;AAED,OAAO,EAAC,QAAQ,EAAC,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 Lantern from '../types/types.js';\n\n// A DNS lookup will usually take ~1-2 roundtrips of connection latency plus the extra DNS routing time.\n// Example: https://www.webpagetest.org/result/180703_3A_e33ec79747c002ed4d7bcbfc81462203/1/details/#waterfall_view_step1\n// Example: https://www.webpagetest.org/result/180707_1M_89673eb633b5d98386de95dfcf9b33d5/1/details/#waterfall_view_step1\n// DNS is highly variable though, many times it's a little more than 1, but can easily be 4-5x RTT.\n// We'll use 2 since it seems to give the most accurate results on average, but this can be tweaked.\nconst DNS_RESOLUTION_RTT_MULTIPLIER = 2;\n\nclass DNSCache {\n static rttMultiplier: number = DNS_RESOLUTION_RTT_MULTIPLIER;\n\n rtt: number;\n resolvedDomainNames: Map<string, {resolvedAt: number}>;\n\n constructor({rtt}: {rtt: number}) {\n this.rtt = rtt;\n this.resolvedDomainNames = new Map();\n }\n\n getTimeUntilResolution(\n request: Lantern.NetworkRequest, options?: {requestedAt?: number, shouldUpdateCache?: boolean}): number {\n const {requestedAt = 0, shouldUpdateCache = false} = options || {};\n\n const domain = request.parsedURL.host;\n const cacheEntry = this.resolvedDomainNames.get(domain);\n let timeUntilResolved = this.rtt * DNSCache.rttMultiplier;\n if (cacheEntry) {\n const timeUntilCachedIsResolved = Math.max(cacheEntry.resolvedAt - requestedAt, 0);\n timeUntilResolved = Math.min(timeUntilCachedIsResolved, timeUntilResolved);\n }\n\n const resolvedAt = requestedAt + timeUntilResolved;\n if (shouldUpdateCache) {\n this.updateCacheResolvedAtIfNeeded(request, resolvedAt);\n }\n\n return timeUntilResolved;\n }\n\n updateCacheResolvedAtIfNeeded(request: Lantern.NetworkRequest, resolvedAt: number): void {\n const domain = request.parsedURL.host;\n const cacheEntry = this.resolvedDomainNames.get(domain) || {resolvedAt};\n cacheEntry.resolvedAt = Math.min(cacheEntry.resolvedAt, resolvedAt);\n this.resolvedDomainNames.set(domain, cacheEntry);\n }\n\n /**\n * Forcefully sets the DNS resolution time for a request.\n * Useful for testing and alternate execution simulations.\n */\n setResolvedAt(domain: string, resolvedAt: number): void {\n this.resolvedDomainNames.set(domain, {resolvedAt});\n }\n}\n\nexport {DNSCache};\n"]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// Copyright 2024 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
/**
|
|
5
|
+
* @file
|
|
6
|
+
*
|
|
7
|
+
* This class encapsulates the type-related validation logic for moving timing information for nodes
|
|
8
|
+
* through the different simulation phases. Methods here ensure that the invariants of simulation hold
|
|
9
|
+
* as nodes are queued, partially simulated, and completed.
|
|
10
|
+
*/
|
|
11
|
+
import * as Core from '../core/core.js';
|
|
12
|
+
import * as Graph from '../graph/graph.js';
|
|
13
|
+
class SimulatorTimingMap {
|
|
14
|
+
nodeTimings;
|
|
15
|
+
constructor() {
|
|
16
|
+
this.nodeTimings = new Map();
|
|
17
|
+
}
|
|
18
|
+
getNodes() {
|
|
19
|
+
return Array.from(this.nodeTimings.keys());
|
|
20
|
+
}
|
|
21
|
+
setReadyToStart(node, values) {
|
|
22
|
+
this.nodeTimings.set(node, values);
|
|
23
|
+
}
|
|
24
|
+
setInProgress(node, values) {
|
|
25
|
+
const nodeTiming = {
|
|
26
|
+
...this.getQueued(node),
|
|
27
|
+
startTime: values.startTime,
|
|
28
|
+
timeElapsed: 0,
|
|
29
|
+
};
|
|
30
|
+
this.nodeTimings.set(node, node.type === Graph.BaseNode.types.NETWORK ? { ...nodeTiming, timeElapsedOvershoot: 0, bytesDownloaded: 0 } :
|
|
31
|
+
nodeTiming);
|
|
32
|
+
}
|
|
33
|
+
setCompleted(node, values) {
|
|
34
|
+
const nodeTiming = {
|
|
35
|
+
...this.getInProgress(node),
|
|
36
|
+
endTime: values.endTime,
|
|
37
|
+
connectionTiming: values.connectionTiming,
|
|
38
|
+
};
|
|
39
|
+
this.nodeTimings.set(node, nodeTiming);
|
|
40
|
+
}
|
|
41
|
+
setCpu(node, values) {
|
|
42
|
+
const nodeTiming = {
|
|
43
|
+
...this.getCpuStarted(node),
|
|
44
|
+
timeElapsed: values.timeElapsed,
|
|
45
|
+
};
|
|
46
|
+
this.nodeTimings.set(node, nodeTiming);
|
|
47
|
+
}
|
|
48
|
+
setCpuEstimated(node, values) {
|
|
49
|
+
const nodeTiming = {
|
|
50
|
+
...this.getCpuStarted(node),
|
|
51
|
+
estimatedTimeElapsed: values.estimatedTimeElapsed,
|
|
52
|
+
};
|
|
53
|
+
this.nodeTimings.set(node, nodeTiming);
|
|
54
|
+
}
|
|
55
|
+
setNetwork(node, values) {
|
|
56
|
+
const nodeTiming = {
|
|
57
|
+
...this.getNetworkStarted(node),
|
|
58
|
+
timeElapsed: values.timeElapsed,
|
|
59
|
+
timeElapsedOvershoot: values.timeElapsedOvershoot,
|
|
60
|
+
bytesDownloaded: values.bytesDownloaded,
|
|
61
|
+
};
|
|
62
|
+
this.nodeTimings.set(node, nodeTiming);
|
|
63
|
+
}
|
|
64
|
+
setNetworkEstimated(node, values) {
|
|
65
|
+
const nodeTiming = {
|
|
66
|
+
...this.getNetworkStarted(node),
|
|
67
|
+
estimatedTimeElapsed: values.estimatedTimeElapsed,
|
|
68
|
+
};
|
|
69
|
+
this.nodeTimings.set(node, nodeTiming);
|
|
70
|
+
}
|
|
71
|
+
getQueued(node) {
|
|
72
|
+
const timing = this.nodeTimings.get(node);
|
|
73
|
+
if (!timing) {
|
|
74
|
+
throw new Core.LanternError(`Node ${node.id} not yet queued`);
|
|
75
|
+
}
|
|
76
|
+
return timing;
|
|
77
|
+
}
|
|
78
|
+
getCpuStarted(node) {
|
|
79
|
+
const timing = this.nodeTimings.get(node);
|
|
80
|
+
if (!timing) {
|
|
81
|
+
throw new Core.LanternError(`Node ${node.id} not yet queued`);
|
|
82
|
+
}
|
|
83
|
+
if (!('startTime' in timing)) {
|
|
84
|
+
throw new Core.LanternError(`Node ${node.id} not yet started`);
|
|
85
|
+
}
|
|
86
|
+
if ('bytesDownloaded' in timing) {
|
|
87
|
+
throw new Core.LanternError(`Node ${node.id} timing not valid`);
|
|
88
|
+
}
|
|
89
|
+
return timing;
|
|
90
|
+
}
|
|
91
|
+
getNetworkStarted(node) {
|
|
92
|
+
const timing = this.nodeTimings.get(node);
|
|
93
|
+
if (!timing) {
|
|
94
|
+
throw new Core.LanternError(`Node ${node.id} not yet queued`);
|
|
95
|
+
}
|
|
96
|
+
if (!('startTime' in timing)) {
|
|
97
|
+
throw new Core.LanternError(`Node ${node.id} not yet started`);
|
|
98
|
+
}
|
|
99
|
+
if (!('bytesDownloaded' in timing)) {
|
|
100
|
+
throw new Core.LanternError(`Node ${node.id} timing not valid`);
|
|
101
|
+
}
|
|
102
|
+
return timing;
|
|
103
|
+
}
|
|
104
|
+
getInProgress(node) {
|
|
105
|
+
const timing = this.nodeTimings.get(node);
|
|
106
|
+
if (!timing) {
|
|
107
|
+
throw new Core.LanternError(`Node ${node.id} not yet queued`);
|
|
108
|
+
}
|
|
109
|
+
if (!('startTime' in timing)) {
|
|
110
|
+
throw new Core.LanternError(`Node ${node.id} not yet started`);
|
|
111
|
+
}
|
|
112
|
+
if (!('estimatedTimeElapsed' in timing)) {
|
|
113
|
+
throw new Core.LanternError(`Node ${node.id} not yet in progress`);
|
|
114
|
+
}
|
|
115
|
+
return timing;
|
|
116
|
+
}
|
|
117
|
+
getCompleted(node) {
|
|
118
|
+
const timing = this.nodeTimings.get(node);
|
|
119
|
+
if (!timing) {
|
|
120
|
+
throw new Core.LanternError(`Node ${node.id} not yet queued`);
|
|
121
|
+
}
|
|
122
|
+
if (!('startTime' in timing)) {
|
|
123
|
+
throw new Core.LanternError(`Node ${node.id} not yet started`);
|
|
124
|
+
}
|
|
125
|
+
if (!('estimatedTimeElapsed' in timing)) {
|
|
126
|
+
throw new Core.LanternError(`Node ${node.id} not yet in progress`);
|
|
127
|
+
}
|
|
128
|
+
if (!('endTime' in timing)) {
|
|
129
|
+
throw new Core.LanternError(`Node ${node.id} not yet completed`);
|
|
130
|
+
}
|
|
131
|
+
return timing;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
export { SimulatorTimingMap };
|
|
135
|
+
//# sourceMappingURL=SimulationTimingMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimulationTimingMap.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/simulation/SimulationTimingMap.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;GAMG;AAEH,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAmC3C,MAAM,kBAAkB;IACtB,WAAW,CAAkC;IAE7C;QACE,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,EAA8B,CAAC;IAC3D,CAAC;IAED,QAAQ;QACN,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,eAAe,CAAC,IAAgB,EAAE,MAA4B;QAC5D,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IAED,aAAa,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AAC;YACxC,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,IAAI,CAAC,EAAE,sBAAsB,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,YAAY,CAAC,IAAgB;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,IAAI,CAAC,EAAE,iBAAiB,CAAC,CAAC;QAChE,CAAC;QACD,IAAI,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,IAAI,CAAC,EAAE,kBAAkB,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,CAAC,CAAC,sBAAsB,IAAI,MAAM,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,IAAI,CAAC,EAAE,sBAAsB,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,IAAI,CAAC,EAAE,oBAAoB,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,OAAO,EAAC,kBAAkB,EAAC,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\n/**\n * @file\n *\n * This class encapsulates the type-related validation logic for moving timing information for nodes\n * through the different simulation phases. Methods here ensure that the invariants of simulation hold\n * as nodes are queued, partially simulated, and completed.\n */\n\nimport * as Core from '../core/core.js';\nimport * as Graph from '../graph/graph.js';\n\ninterface NodeTimingComplete {\n startTime: number;\n endTime: number;\n queuedTime: number;\n estimatedTimeElapsed: number;\n timeElapsed: number;\n timeElapsedOvershoot: number;\n bytesDownloaded: number;\n}\n\ntype NodeTimingQueued = Pick<NodeTimingComplete, 'queuedTime'>;\n\ntype CpuNodeTimingStarted = NodeTimingQueued&Pick<NodeTimingComplete, 'startTime'|'timeElapsed'>;\ntype NetworkNodeTimingStarted = CpuNodeTimingStarted&Pick<NodeTimingComplete, 'timeElapsedOvershoot'|'bytesDownloaded'>;\n\ntype CpuNodeTimingInProgress = CpuNodeTimingStarted&Pick<NodeTimingComplete, 'estimatedTimeElapsed'>;\ntype NetworkNodeTimingInProgress = NetworkNodeTimingStarted&Pick<NodeTimingComplete, 'estimatedTimeElapsed'>;\n\nexport type CpuNodeTimingComplete = CpuNodeTimingInProgress&Pick<NodeTimingComplete, 'endTime'>;\nexport type NetworkNodeTimingComplete =\n NetworkNodeTimingInProgress&Pick<NodeTimingComplete, 'endTime'>&{connectionTiming: ConnectionTiming};\nexport type CompleteNodeTiming = CpuNodeTimingComplete|NetworkNodeTimingComplete;\n\ntype NodeTimingData = NodeTimingQueued|CpuNodeTimingStarted|NetworkNodeTimingStarted|CpuNodeTimingInProgress|\n NetworkNodeTimingInProgress|CpuNodeTimingComplete|NetworkNodeTimingComplete;\n\nexport interface ConnectionTiming {\n dnsResolutionTime?: number;\n connectionTime?: number;\n sslTime?: number;\n timeToFirstByte: number;\n}\n\nclass SimulatorTimingMap {\n nodeTimings: Map<Graph.Node, NodeTimingData>;\n\n constructor() {\n this.nodeTimings = new Map<Graph.Node, NodeTimingData>();\n }\n\n getNodes(): Graph.Node[] {\n return Array.from(this.nodeTimings.keys());\n }\n\n setReadyToStart(node: Graph.Node, values: {queuedTime: number}): void {\n this.nodeTimings.set(node, values);\n }\n\n setInProgress(node: Graph.Node, values: {startTime: number}): void {\n const nodeTiming = {\n ...this.getQueued(node),\n startTime: values.startTime,\n timeElapsed: 0,\n };\n\n this.nodeTimings.set(\n node,\n node.type === Graph.BaseNode.types.NETWORK ? {...nodeTiming, timeElapsedOvershoot: 0, bytesDownloaded: 0} :\n nodeTiming,\n );\n }\n\n setCompleted(node: Graph.Node, values: {endTime: number, connectionTiming?: ConnectionTiming}): void {\n const nodeTiming = {\n ...this.getInProgress(node),\n endTime: values.endTime,\n connectionTiming: values.connectionTiming,\n };\n\n this.nodeTimings.set(node, nodeTiming);\n }\n\n setCpu(node: Graph.CPUNode, values: {timeElapsed: number}): void {\n const nodeTiming = {\n ...this.getCpuStarted(node),\n timeElapsed: values.timeElapsed,\n };\n\n this.nodeTimings.set(node, nodeTiming);\n }\n\n setCpuEstimated(node: Graph.CPUNode, values: {estimatedTimeElapsed: number}): void {\n const nodeTiming = {\n ...this.getCpuStarted(node),\n estimatedTimeElapsed: values.estimatedTimeElapsed,\n };\n\n this.nodeTimings.set(node, nodeTiming);\n }\n\n setNetwork(\n node: Graph.NetworkNode,\n values: {timeElapsed: number, timeElapsedOvershoot: number, bytesDownloaded: number}): void {\n const nodeTiming = {\n ...this.getNetworkStarted(node),\n timeElapsed: values.timeElapsed,\n timeElapsedOvershoot: values.timeElapsedOvershoot,\n bytesDownloaded: values.bytesDownloaded,\n };\n\n this.nodeTimings.set(node, nodeTiming);\n }\n\n setNetworkEstimated(node: Graph.NetworkNode, values: {estimatedTimeElapsed: number}): void {\n const nodeTiming = {\n ...this.getNetworkStarted(node),\n estimatedTimeElapsed: values.estimatedTimeElapsed,\n };\n\n this.nodeTimings.set(node, nodeTiming);\n }\n\n getQueued(node: Graph.Node): NodeTimingData {\n const timing = this.nodeTimings.get(node);\n if (!timing) {\n throw new Core.LanternError(`Node ${node.id} not yet queued`);\n }\n return timing;\n }\n\n getCpuStarted(node: Graph.CPUNode): CpuNodeTimingStarted {\n const timing = this.nodeTimings.get(node);\n if (!timing) {\n throw new Core.LanternError(`Node ${node.id} not yet queued`);\n }\n if (!('startTime' in timing)) {\n throw new Core.LanternError(`Node ${node.id} not yet started`);\n }\n if ('bytesDownloaded' in timing) {\n throw new Core.LanternError(`Node ${node.id} timing not valid`);\n }\n return timing;\n }\n\n getNetworkStarted(node: Graph.NetworkNode): NetworkNodeTimingStarted {\n const timing = this.nodeTimings.get(node);\n if (!timing) {\n throw new Core.LanternError(`Node ${node.id} not yet queued`);\n }\n if (!('startTime' in timing)) {\n throw new Core.LanternError(`Node ${node.id} not yet started`);\n }\n if (!('bytesDownloaded' in timing)) {\n throw new Core.LanternError(`Node ${node.id} timing not valid`);\n }\n return timing;\n }\n\n getInProgress(node: Graph.Node): CpuNodeTimingInProgress|NetworkNodeTimingInProgress {\n const timing = this.nodeTimings.get(node);\n if (!timing) {\n throw new Core.LanternError(`Node ${node.id} not yet queued`);\n }\n if (!('startTime' in timing)) {\n throw new Core.LanternError(`Node ${node.id} not yet started`);\n }\n if (!('estimatedTimeElapsed' in timing)) {\n throw new Core.LanternError(`Node ${node.id} not yet in progress`);\n }\n return timing;\n }\n\n getCompleted(node: Graph.Node): CpuNodeTimingComplete|NetworkNodeTimingComplete {\n const timing = this.nodeTimings.get(node);\n if (!timing) {\n throw new Core.LanternError(`Node ${node.id} not yet queued`);\n }\n if (!('startTime' in timing)) {\n throw new Core.LanternError(`Node ${node.id} not yet started`);\n }\n if (!('estimatedTimeElapsed' in timing)) {\n throw new Core.LanternError(`Node ${node.id} not yet in progress`);\n }\n if (!('endTime' in timing)) {\n throw new Core.LanternError(`Node ${node.id} not yet completed`);\n }\n return timing;\n }\n}\n\nexport {SimulatorTimingMap};\n"]}
|