@paulirish/trace_engine 0.0.58 → 0.0.60
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-trace.d.mts +2 -3
- package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +1 -1
- package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
- package/LICENSE +1 -1
- package/README.md +28 -1
- package/analyze-trace.mjs +5 -3
- package/core/platform/ArrayUtilities.d.ts +1 -0
- package/core/platform/ArrayUtilities.js +2 -2
- package/core/platform/ArrayUtilities.js.map +1 -1
- package/core/platform/Brand.js +1 -1
- package/core/platform/Brand.js.map +1 -1
- package/core/platform/Constructor.js +1 -1
- package/core/platform/Constructor.js.map +1 -1
- package/core/platform/DOMUtilities.js +1 -1
- package/core/platform/DOMUtilities.js.map +1 -1
- package/core/platform/DateUtilities.js +1 -1
- package/core/platform/DateUtilities.js.map +1 -1
- package/core/platform/DevToolsPath.js +1 -1
- package/core/platform/DevToolsPath.js.map +1 -1
- package/core/platform/KeyboardUtilities.js +1 -1
- package/core/platform/KeyboardUtilities.js.map +1 -1
- package/core/platform/MapUtilities.js +1 -1
- package/core/platform/MapUtilities.js.map +1 -1
- package/core/platform/MimeType.js +1 -1
- package/core/platform/MimeType.js.map +1 -1
- package/core/platform/NumberUtilities.js +1 -1
- package/core/platform/NumberUtilities.js.map +1 -1
- package/core/platform/StringUtilities.d.ts +2 -1
- package/core/platform/StringUtilities.js +34 -32
- package/core/platform/StringUtilities.js.map +1 -1
- package/core/platform/Timing.js +1 -1
- package/core/platform/Timing.js.map +1 -1
- package/core/platform/TypedArrayUtilities.js +1 -1
- package/core/platform/TypedArrayUtilities.js.map +1 -1
- package/core/platform/TypescriptUtilities.js +1 -1
- package/core/platform/TypescriptUtilities.js.map +1 -1
- package/core/platform/UIString.js +1 -1
- package/core/platform/UIString.js.map +1 -1
- package/core/platform/UserVisibleError.js +1 -1
- package/core/platform/UserVisibleError.js.map +1 -1
- package/core/platform/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/core/platform/platform-tsconfig.json +6 -2
- package/core/platform/platform.js +3 -29
- package/core/platform/platform.js.map +1 -1
- package/generated/protocol.d.ts +224 -14
- package/generated/protocol.js +1 -1
- package/locales/af.json +0 -9
- package/locales/am.json +0 -9
- package/locales/ar.json +0 -9
- package/locales/as.json +0 -9
- package/locales/az.json +0 -9
- package/locales/be.json +0 -9
- package/locales/bg.json +0 -9
- package/locales/bn.json +1 -10
- package/locales/bs.json +0 -9
- package/locales/ca.json +0 -9
- package/locales/cs.json +0 -9
- package/locales/cy.json +0 -9
- package/locales/da.json +0 -9
- package/locales/de.json +0 -9
- package/locales/el.json +0 -9
- package/locales/en-GB.json +0 -9
- package/locales/en-US.json +8 -8
- package/locales/en-XL.json +8 -8
- package/locales/es-419.json +0 -9
- package/locales/es.json +0 -9
- package/locales/et.json +0 -9
- package/locales/eu.json +0 -9
- package/locales/fa.json +0 -9
- package/locales/fi.json +0 -9
- package/locales/fil.json +0 -9
- package/locales/fr-CA.json +0 -9
- package/locales/fr.json +0 -9
- package/locales/gl.json +0 -9
- package/locales/gu.json +0 -9
- package/locales/he.json +0 -9
- package/locales/hi.json +0 -9
- package/locales/hr.json +4 -13
- package/locales/hu.json +0 -9
- package/locales/hy.json +0 -9
- package/locales/id.json +0 -9
- package/locales/is.json +0 -9
- package/locales/it.json +0 -9
- package/locales/ja.json +0 -9
- package/locales/ka.json +0 -9
- package/locales/kk.json +0 -9
- package/locales/km.json +0 -9
- package/locales/kn.json +0 -9
- package/locales/ko.json +0 -9
- package/locales/ky.json +0 -9
- package/locales/lo.json +0 -9
- package/locales/lt.json +0 -9
- package/locales/lv.json +0 -9
- package/locales/mk.json +0 -9
- package/locales/ml.json +0 -9
- package/locales/mn.json +0 -9
- package/locales/mr.json +0 -9
- package/locales/ms.json +0 -9
- package/locales/my.json +1 -10
- package/locales/ne.json +22 -31
- package/locales/nl.json +0 -9
- package/locales/no.json +0 -9
- package/locales/or.json +0 -9
- package/locales/pa.json +0 -9
- package/locales/pl.json +0 -9
- package/locales/pt-PT.json +0 -9
- package/locales/pt.json +0 -9
- package/locales/ro.json +0 -9
- package/locales/ru.json +0 -9
- package/locales/si.json +1 -10
- package/locales/sk.json +0 -9
- package/locales/sl.json +0 -9
- package/locales/sq.json +0 -9
- package/locales/sr-Latn.json +0 -9
- package/locales/sr.json +0 -9
- package/locales/sv.json +0 -9
- package/locales/sw.json +0 -9
- package/locales/ta.json +0 -9
- package/locales/te.json +0 -9
- package/locales/th.json +0 -9
- package/locales/tr.json +0 -9
- package/locales/uk.json +0 -9
- package/locales/ur.json +0 -9
- package/locales/uz.json +0 -9
- package/locales/vi.json +0 -9
- package/locales/zh-HK.json +0 -9
- package/locales/zh-TW.json +0 -9
- package/locales/zh.json +0 -9
- package/locales/zu.json +0 -9
- package/models/cpu_profile/CPUProfileDataModel.d.ts +1 -0
- package/models/cpu_profile/CPUProfileDataModel.js +1 -1
- package/models/cpu_profile/CPUProfileDataModel.js.map +1 -1
- package/models/cpu_profile/ProfileTreeModel.d.ts +1 -1
- package/models/cpu_profile/ProfileTreeModel.js +1 -1
- package/models/cpu_profile/ProfileTreeModel.js.map +1 -1
- package/models/cpu_profile/cpu_profile-tsconfig.json +6 -2
- package/models/cpu_profile/cpu_profile.js +1 -1
- package/models/cpu_profile/cpu_profile.js.map +1 -1
- package/models/cpu_profile/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/EntityMapper.d.ts +33 -0
- package/models/trace/EntityMapper.js +123 -0
- package/models/trace/EntityMapper.js.map +1 -0
- package/models/trace/EventsSerializer.d.ts +11 -0
- package/models/trace/EventsSerializer.js +82 -0
- package/models/trace/EventsSerializer.js.map +1 -0
- package/models/trace/LanternComputationData.d.ts +3 -3
- package/models/trace/LanternComputationData.js +12 -10
- package/models/trace/LanternComputationData.js.map +1 -1
- package/models/trace/ModelImpl.d.ts +7 -14
- package/models/trace/ModelImpl.js +25 -52
- package/models/trace/ModelImpl.js.map +1 -1
- package/models/trace/Name.d.ts +12 -0
- package/models/trace/Name.js +115 -0
- package/models/trace/Name.js.map +1 -0
- package/models/trace/Processor.d.ts +1 -1
- package/models/trace/Processor.js +42 -61
- package/models/trace/Processor.js.map +1 -1
- package/models/trace/Styles.d.ts +50 -0
- package/models/trace/Styles.js +816 -0
- package/models/trace/Styles.js.map +1 -0
- package/models/trace/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/extras/FilmStrip.d.ts +1 -1
- package/models/trace/extras/FilmStrip.js +7 -7
- package/models/trace/extras/FilmStrip.js.map +1 -1
- package/models/trace/extras/MainThreadActivity.js +1 -1
- package/models/trace/extras/MainThreadActivity.js.map +1 -1
- package/models/trace/extras/ScriptDuplication.js +1 -1
- package/models/trace/extras/ScriptDuplication.js.map +1 -1
- package/models/trace/extras/StackTraceForEvent.d.ts +2 -2
- package/models/trace/extras/StackTraceForEvent.js +21 -21
- package/models/trace/extras/StackTraceForEvent.js.map +1 -1
- package/models/trace/extras/ThirdParties.d.ts +2 -2
- package/models/trace/extras/ThirdParties.js +17 -17
- package/models/trace/extras/ThirdParties.js.map +1 -1
- package/models/trace/extras/TraceFilter.d.ts +1 -1
- package/models/trace/extras/TraceFilter.js +1 -1
- package/models/trace/extras/TraceFilter.js.map +1 -1
- package/models/trace/extras/TraceTree.d.ts +1 -0
- package/models/trace/extras/TraceTree.js +2 -2
- package/models/trace/extras/TraceTree.js.map +1 -1
- package/models/trace/extras/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/extras/extras-tsconfig.json +6 -2
- package/models/trace/extras/extras.js.map +1 -1
- package/models/trace/handlers/AnimationFramesHandler.js +11 -11
- package/models/trace/handlers/AnimationFramesHandler.js.map +1 -1
- package/models/trace/handlers/AnimationHandler.js +5 -5
- package/models/trace/handlers/AnimationHandler.js.map +1 -1
- package/models/trace/handlers/AsyncJSCallsHandler.d.ts +3 -3
- package/models/trace/handlers/AsyncJSCallsHandler.js +9 -9
- package/models/trace/handlers/AsyncJSCallsHandler.js.map +1 -1
- package/models/trace/handlers/AuctionWorkletsHandler.js +12 -12
- package/models/trace/handlers/AuctionWorkletsHandler.js.map +1 -1
- package/models/trace/handlers/DOMStatsHandler.js +3 -3
- package/models/trace/handlers/DOMStatsHandler.js.map +1 -1
- package/models/trace/handlers/ExtensionTraceDataHandler.d.ts +15 -2
- package/models/trace/handlers/ExtensionTraceDataHandler.js +53 -64
- package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -1
- package/models/trace/handlers/FlowsHandler.js +11 -11
- package/models/trace/handlers/FlowsHandler.js.map +1 -1
- package/models/trace/handlers/FramesHandler.d.ts +7 -0
- package/models/trace/handlers/FramesHandler.js +12 -10
- package/models/trace/handlers/FramesHandler.js.map +1 -1
- package/models/trace/handlers/GPUHandler.js +3 -3
- package/models/trace/handlers/GPUHandler.js.map +1 -1
- package/models/trace/handlers/ImagePaintingHandler.js +13 -13
- package/models/trace/handlers/ImagePaintingHandler.js.map +1 -1
- package/models/trace/handlers/InitiatorsHandler.js +32 -41
- package/models/trace/handlers/InitiatorsHandler.js.map +1 -1
- package/models/trace/handlers/InvalidationsHandler.js +63 -44
- package/models/trace/handlers/InvalidationsHandler.js.map +1 -1
- package/models/trace/handlers/LargestImagePaintHandler.js +5 -4
- package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -1
- package/models/trace/handlers/LargestTextPaintHandler.js +3 -3
- package/models/trace/handlers/LargestTextPaintHandler.js.map +1 -1
- package/models/trace/handlers/LayerTreeHandler.js +11 -11
- package/models/trace/handlers/LayerTreeHandler.js.map +1 -1
- package/models/trace/handlers/LayoutShiftsHandler.d.ts +17 -4
- package/models/trace/handlers/LayoutShiftsHandler.js +47 -40
- package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -1
- package/models/trace/handlers/MemoryHandler.js +3 -3
- package/models/trace/handlers/MemoryHandler.js.map +1 -1
- package/models/trace/handlers/MetaHandler.d.ts +22 -1
- package/models/trace/handlers/MetaHandler.js +30 -29
- package/models/trace/handlers/MetaHandler.js.map +1 -1
- package/models/trace/handlers/ModelHandlers.js +1 -1
- package/models/trace/handlers/ModelHandlers.js.map +1 -1
- package/models/trace/handlers/NetworkRequestsHandler.d.ts +10 -0
- package/models/trace/handlers/NetworkRequestsHandler.js +44 -25
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
- package/models/trace/handlers/PageFramesHandler.js +3 -3
- package/models/trace/handlers/PageFramesHandler.js.map +1 -1
- package/models/trace/handlers/PageLoadMetricsHandler.js +5 -5
- package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -1
- package/models/trace/handlers/RendererHandler.d.ts +1 -1
- package/models/trace/handlers/RendererHandler.js +22 -22
- package/models/trace/handlers/RendererHandler.js.map +1 -1
- package/models/trace/handlers/SamplesHandler.d.ts +2 -2
- package/models/trace/handlers/SamplesHandler.js +7 -9
- package/models/trace/handlers/SamplesHandler.js.map +1 -1
- package/models/trace/handlers/ScreenshotsHandler.js +9 -10
- package/models/trace/handlers/ScreenshotsHandler.js.map +1 -1
- package/models/trace/handlers/ScriptsHandler.js +9 -8
- package/models/trace/handlers/ScriptsHandler.js.map +1 -1
- package/models/trace/handlers/SelectorStatsHandler.d.ts +2 -2
- package/models/trace/handlers/SelectorStatsHandler.js +13 -13
- package/models/trace/handlers/SelectorStatsHandler.js.map +1 -1
- package/models/trace/handlers/Threads.d.ts +2 -2
- package/models/trace/handlers/Threads.js +9 -9
- package/models/trace/handlers/Threads.js.map +1 -1
- package/models/trace/handlers/UserInteractionsHandler.d.ts +10 -3
- package/models/trace/handlers/UserInteractionsHandler.js +104 -84
- package/models/trace/handlers/UserInteractionsHandler.js.map +1 -1
- package/models/trace/handlers/UserTimingsHandler.d.ts +21 -0
- package/models/trace/handlers/UserTimingsHandler.js +67 -39
- package/models/trace/handlers/UserTimingsHandler.js.map +1 -1
- package/models/trace/handlers/WarningsHandler.js +14 -14
- package/models/trace/handlers/WarningsHandler.js.map +1 -1
- package/models/trace/handlers/WorkersHandler.js +7 -7
- package/models/trace/handlers/WorkersHandler.js.map +1 -1
- package/models/trace/handlers/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/handlers/handlers-tsconfig.json +6 -2
- package/models/trace/handlers/handlers.js +1 -1
- package/models/trace/handlers/handlers.js.map +1 -1
- package/models/trace/handlers/helpers.d.ts +3 -2
- package/models/trace/handlers/helpers.js +10 -10
- package/models/trace/handlers/helpers.js.map +1 -1
- package/models/trace/handlers/types.d.ts +25 -2
- package/models/trace/handlers/types.js.map +1 -1
- package/models/trace/helpers/Extensions.js +8 -8
- package/models/trace/helpers/Extensions.js.map +1 -1
- package/models/trace/helpers/Network.js.map +1 -1
- package/models/trace/helpers/SamplesIntegrator.js +11 -9
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -1
- package/models/trace/helpers/SyntheticEvents.js +1 -1
- package/models/trace/helpers/SyntheticEvents.js.map +1 -1
- package/models/trace/helpers/Timing.d.ts +4 -0
- package/models/trace/helpers/Timing.js +6 -4
- package/models/trace/helpers/Timing.js.map +1 -1
- package/models/trace/helpers/Trace.d.ts +21 -23
- package/models/trace/helpers/Trace.js +188 -67
- package/models/trace/helpers/Trace.js.map +1 -1
- package/models/trace/helpers/TreeHelpers.js +1 -1
- package/models/trace/helpers/TreeHelpers.js.map +1 -1
- package/models/trace/helpers/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/helpers/helpers-tsconfig.json +6 -2
- package/models/trace/helpers/helpers.js +1 -1
- package/models/trace/helpers/helpers.js.map +1 -1
- package/models/trace/insights/CLSCulprits.d.ts +2 -2
- package/models/trace/insights/CLSCulprits.js +14 -14
- package/models/trace/insights/CLSCulprits.js.map +1 -1
- package/models/trace/insights/Cache.d.ts +2 -1
- package/models/trace/insights/Cache.js +8 -5
- package/models/trace/insights/Cache.js.map +1 -1
- package/models/trace/insights/Common.d.ts +9 -1
- package/models/trace/insights/Common.js +33 -1
- package/models/trace/insights/Common.js.map +1 -1
- package/models/trace/insights/DOMSize.d.ts +3 -2
- package/models/trace/insights/DOMSize.js +10 -7
- package/models/trace/insights/DOMSize.js.map +1 -1
- package/models/trace/insights/DocumentLatency.d.ts +2 -2
- package/models/trace/insights/DocumentLatency.js +18 -17
- package/models/trace/insights/DocumentLatency.js.map +1 -1
- package/models/trace/insights/DuplicatedJavaScript.d.ts +2 -2
- package/models/trace/insights/DuplicatedJavaScript.js +5 -5
- package/models/trace/insights/DuplicatedJavaScript.js.map +1 -1
- package/models/trace/insights/FontDisplay.d.ts +2 -1
- package/models/trace/insights/FontDisplay.js +7 -4
- package/models/trace/insights/FontDisplay.js.map +1 -1
- package/models/trace/insights/ForcedReflow.d.ts +2 -1
- package/models/trace/insights/ForcedReflow.js +6 -3
- package/models/trace/insights/ForcedReflow.js.map +1 -1
- package/models/trace/insights/INPBreakdown.d.ts +3 -3
- package/models/trace/insights/INPBreakdown.js +16 -5
- package/models/trace/insights/INPBreakdown.js.map +1 -1
- package/models/trace/insights/ImageDelivery.d.ts +2 -2
- package/models/trace/insights/ImageDelivery.js +13 -13
- package/models/trace/insights/ImageDelivery.js.map +1 -1
- package/models/trace/insights/LCPBreakdown.d.ts +3 -2
- package/models/trace/insights/LCPBreakdown.js +21 -15
- package/models/trace/insights/LCPBreakdown.js.map +1 -1
- package/models/trace/insights/LCPDiscovery.d.ts +2 -2
- package/models/trace/insights/LCPDiscovery.js +9 -11
- package/models/trace/insights/LCPDiscovery.js.map +1 -1
- package/models/trace/insights/LegacyJavaScript.d.ts +1 -1
- package/models/trace/insights/LegacyJavaScript.js +5 -4
- package/models/trace/insights/LegacyJavaScript.js.map +1 -1
- package/models/trace/insights/Models.js +1 -1
- package/models/trace/insights/Models.js.map +1 -1
- package/models/trace/insights/ModernHTTP.d.ts +2 -2
- package/models/trace/insights/ModernHTTP.js +6 -6
- package/models/trace/insights/ModernHTTP.js.map +1 -1
- package/models/trace/insights/NetworkDependencyTree.d.ts +6 -3
- package/models/trace/insights/NetworkDependencyTree.js +19 -16
- package/models/trace/insights/NetworkDependencyTree.js.map +1 -1
- package/models/trace/insights/RenderBlocking.d.ts +2 -2
- package/models/trace/insights/RenderBlocking.js +11 -11
- package/models/trace/insights/RenderBlocking.js.map +1 -1
- package/models/trace/insights/SlowCSSSelector.d.ts +3 -2
- package/models/trace/insights/SlowCSSSelector.js +9 -6
- package/models/trace/insights/SlowCSSSelector.js.map +1 -1
- package/models/trace/insights/Statistics.js +1 -1
- package/models/trace/insights/Statistics.js.map +1 -1
- package/models/trace/insights/ThirdParties.d.ts +2 -1
- package/models/trace/insights/ThirdParties.js +8 -5
- package/models/trace/insights/ThirdParties.js.map +1 -1
- package/models/trace/insights/Viewport.d.ts +2 -1
- package/models/trace/insights/Viewport.js +8 -5
- package/models/trace/insights/Viewport.js.map +1 -1
- package/models/trace/insights/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/insights/insights-tsconfig.json +6 -2
- package/models/trace/insights/insights.d.ts +2 -0
- package/models/trace/insights/insights.js +3 -1
- package/models/trace/insights/insights.js.map +1 -1
- package/models/trace/insights/types.d.ts +4 -1
- package/models/trace/insights/types.js +2 -1
- package/models/trace/insights/types.js.map +1 -1
- package/models/trace/lantern/core/LanternError.js +1 -1
- package/models/trace/lantern/core/LanternError.js.map +1 -1
- package/models/trace/lantern/core/NetworkAnalyzer.js +1 -1
- package/models/trace/lantern/core/NetworkAnalyzer.js.map +1 -1
- package/models/trace/lantern/core/core-tsconfig.json +6 -2
- package/models/trace/lantern/core/core.js +1 -1
- package/models/trace/lantern/core/core.js.map +1 -1
- package/models/trace/lantern/core/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/lantern/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/lantern/graph/BaseNode.js +1 -1
- package/models/trace/lantern/graph/BaseNode.js.map +1 -1
- package/models/trace/lantern/graph/CPUNode.js +1 -1
- package/models/trace/lantern/graph/CPUNode.js.map +1 -1
- package/models/trace/lantern/graph/NetworkNode.js +1 -1
- package/models/trace/lantern/graph/NetworkNode.js.map +1 -1
- package/models/trace/lantern/graph/PageDependencyGraph.js +1 -1
- package/models/trace/lantern/graph/PageDependencyGraph.js.map +1 -1
- package/models/trace/lantern/graph/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/lantern/graph/graph-tsconfig.json +6 -2
- package/models/trace/lantern/graph/graph.js +1 -1
- package/models/trace/lantern/graph/graph.js.map +1 -1
- package/models/trace/lantern/lantern-tsconfig.json +6 -2
- package/models/trace/lantern/lantern.js +1 -1
- package/models/trace/lantern/lantern.js.map +1 -1
- package/models/trace/lantern/metrics/FirstContentfulPaint.js +1 -1
- package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +1 -1
- package/models/trace/lantern/metrics/Interactive.js +1 -1
- package/models/trace/lantern/metrics/Interactive.js.map +1 -1
- package/models/trace/lantern/metrics/LargestContentfulPaint.js +1 -1
- package/models/trace/lantern/metrics/LargestContentfulPaint.js.map +1 -1
- package/models/trace/lantern/metrics/MaxPotentialFID.js +1 -1
- package/models/trace/lantern/metrics/MaxPotentialFID.js.map +1 -1
- package/models/trace/lantern/metrics/Metric.js +1 -1
- package/models/trace/lantern/metrics/Metric.js.map +1 -1
- package/models/trace/lantern/metrics/SpeedIndex.js +1 -1
- package/models/trace/lantern/metrics/SpeedIndex.js.map +1 -1
- package/models/trace/lantern/metrics/TBTUtils.js +1 -1
- package/models/trace/lantern/metrics/TBTUtils.js.map +1 -1
- package/models/trace/lantern/metrics/TotalBlockingTime.js +1 -1
- package/models/trace/lantern/metrics/TotalBlockingTime.js.map +1 -1
- package/models/trace/lantern/metrics/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/lantern/metrics/metrics-tsconfig.json +6 -2
- package/models/trace/lantern/metrics/metrics.js +1 -1
- package/models/trace/lantern/metrics/metrics.js.map +1 -1
- package/models/trace/lantern/simulation/ConnectionPool.js +1 -1
- package/models/trace/lantern/simulation/ConnectionPool.js.map +1 -1
- package/models/trace/lantern/simulation/Constants.js +1 -1
- package/models/trace/lantern/simulation/Constants.js.map +1 -1
- package/models/trace/lantern/simulation/DNSCache.js +1 -1
- package/models/trace/lantern/simulation/DNSCache.js.map +1 -1
- package/models/trace/lantern/simulation/SimulationTimingMap.js +1 -1
- package/models/trace/lantern/simulation/SimulationTimingMap.js.map +1 -1
- package/models/trace/lantern/simulation/Simulator.js +1 -1
- package/models/trace/lantern/simulation/Simulator.js.map +1 -1
- package/models/trace/lantern/simulation/TCPConnection.js +1 -1
- package/models/trace/lantern/simulation/TCPConnection.js.map +1 -1
- package/models/trace/lantern/simulation/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/lantern/simulation/simulation-tsconfig.json +6 -2
- package/models/trace/lantern/simulation/simulation.js +1 -1
- package/models/trace/lantern/simulation/simulation.js.map +1 -1
- package/models/trace/lantern/types/Lantern.js +1 -1
- package/models/trace/lantern/types/Lantern.js.map +1 -1
- package/models/trace/lantern/types/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/lantern/types/types-tsconfig.json +6 -2
- package/models/trace/lantern/types/types.js +1 -1
- package/models/trace/lantern/types/types.js.map +1 -1
- package/models/trace/trace-tsconfig.json +10 -2
- package/models/trace/trace.d.ts +5 -1
- package/models/trace/trace.js +6 -2
- package/models/trace/trace.js.map +1 -1
- package/models/trace/types/Configuration.d.ts +11 -0
- package/models/trace/types/Configuration.js +1 -1
- package/models/trace/types/Configuration.js.map +1 -1
- package/models/trace/types/Extensions.d.ts +25 -13
- package/models/trace/types/Extensions.js +6 -3
- package/models/trace/types/Extensions.js.map +1 -1
- package/models/trace/types/File.d.ts +13 -2
- package/models/trace/types/File.js +1 -1
- package/models/trace/types/File.js.map +1 -1
- package/models/trace/types/Overlays.d.ts +5 -4
- package/models/trace/types/Overlays.js +1 -1
- package/models/trace/types/Overlays.js.map +1 -1
- package/models/trace/types/Timing.d.ts +1 -0
- package/models/trace/types/Timing.js +1 -1
- package/models/trace/types/Timing.js.map +1 -1
- package/models/trace/types/TraceEvents.d.ts +81 -61
- package/models/trace/types/TraceEvents.js +42 -29
- package/models/trace/types/TraceEvents.js.map +1 -1
- package/models/trace/types/devtools_entrypoint-bundle-typescript-tsconfig.json +6 -2
- package/models/trace/types/types-tsconfig.json +6 -2
- package/models/trace/types/types.js +1 -1
- package/models/trace/types/types.js.map +1 -1
- package/package.json +1 -1
- package/test/test-trace-engine.mjs +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TCPConnection.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/simulation/TCPConnection.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAmB7B,MAAM,yBAAyB,GAAG,EAAE,CAAC;AACrC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B,MAAM,aAAa;IACjB,MAAM,CAAU;IAChB,GAAG,CAAU;IACb,EAAE,CAAU;IACZ,GAAG,CAAS;IACZ,UAAU,CAAS;IACnB,aAAa,CAAS;IACtB,iBAAiB,CAAS;IAC1B,yBAAyB,CAAS;IAElC,YAAY,GAAW,EAAE,UAAkB,EAAE,aAAa,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,EAAE,EAAE,GAAG,KAAK;QACpF,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,iBAAiB,GAAG,yBAAyB,CAAC;QACnD,IAAI,CAAC,yBAAyB,GAAG,CAAC,CAAC;IACrC,CAAC;IAED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AgB,GAAG;gBACjB,iBAAiB;gBACjB,cAAc,EAAE,mBAAmB,GAAG,iBAAiB;gBACvD,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;gBAC7C,eAAe;aAChB,CAAC;QACJ,CAAC;aAAM,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC;YACnB,iFAAiF;YACjF,gBAAgB,GAAG;gBACjB,eAAe;aAChB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,gBAAgB,GAAG;gBACjB,cAAc,EAAE,mBAAmB;gBACnC,eAAe;aAChB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,UAAU;YACV,WAAW;YACX,eAAe;YACf,oBAAoB;YACpB,gBAAgB;YAChB,gBAAgB;SACjB,CAAC;IACJ,CAAC;CACF;AAED,OAAO,EAAC,aAAa,EAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\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 {ConnectionTiming} from './SimulationTimingMap.js';\n\ninterface DownloadOptions {\n dnsResolutionTime?: number;\n timeAlreadyElapsed?: number;\n maximumTimeToElapse?: number;\n}\n\ninterface DownloadResults {\n roundTrips: number;\n timeElapsed: number;\n bytesDownloaded: number;\n extraBytesDownloaded: number;\n congestionWindow: number;\n connectionTiming: ConnectionTiming;\n}\n\nconst INITIAL_CONGESTION_WINDOW = 10;\nconst TCP_SEGMENT_SIZE = 1460;\n\nclass TCPConnection {\n warmed: boolean;\n ssl: boolean;\n h2: boolean;\n rtt: number;\n throughput: number;\n serverLatency: number;\n _congestionWindow: number;\n h2OverflowBytesDownloaded: number;\n\n constructor(rtt: number, throughput: number, serverLatency = 0, ssl = true, h2 = false) {\n this.warmed = false;\n this.ssl = ssl;\n this.h2 = h2;\n this.rtt = rtt;\n this.throughput = throughput;\n this.serverLatency = serverLatency;\n this._congestionWindow = INITIAL_CONGESTION_WINDOW;\n this.h2OverflowBytesDownloaded = 0;\n }\n\n static maximumSaturatedConnections(rtt: number, availableThroughput: number): number {\n const roundTripsPerSecond = 1000 / rtt;\n const bytesPerRoundTrip = TCP_SEGMENT_SIZE;\n const bytesPerSecond = roundTripsPerSecond * bytesPerRoundTrip;\n const minimumThroughputRequiredPerRequest = bytesPerSecond * 8;\n return Math.floor(availableThroughput / minimumThroughputRequiredPerRequest);\n }\n\n computeMaximumCongestionWindowInSegments(): number {\n const bytesPerSecond = this.throughput / 8;\n const secondsPerRoundTrip = this.rtt / 1000;\n const bytesPerRoundTrip = bytesPerSecond * secondsPerRoundTrip;\n return Math.floor(bytesPerRoundTrip / TCP_SEGMENT_SIZE);\n }\n\n setThroughput(throughput: number): void {\n this.throughput = throughput;\n }\n\n setCongestionWindow(congestion: number): void {\n this._congestionWindow = congestion;\n }\n\n setWarmed(warmed: boolean): void {\n this.warmed = warmed;\n }\n\n isH2(): boolean {\n return this.h2;\n }\n\n get congestionWindow(): number {\n return this._congestionWindow;\n }\n\n /**\n * Sets the number of excess bytes that are available to this connection on future downloads, only\n * applies to H2 connections.\n */\n setH2OverflowBytesDownloaded(bytes: number): void {\n if (!this.h2) {\n return;\n }\n this.h2OverflowBytesDownloaded = bytes;\n }\n\n clone(): TCPConnection {\n return Object.assign(new TCPConnection(this.rtt, this.throughput), this);\n }\n\n /**\n * Simulates a network download of a particular number of bytes over an optional maximum amount of time\n * and returns information about the ending state.\n *\n * See https://hpbn.co/building-blocks-of-tcp/#three-way-handshake and\n * https://hpbn.co/transport-layer-security-tls/#tls-handshake for details.\n */\n simulateDownloadUntil(bytesToDownload: number, options?: DownloadOptions): DownloadResults {\n const {timeAlreadyElapsed = 0, maximumTimeToElapse = Infinity, dnsResolutionTime = 0} = options || {};\n\n if (this.warmed && this.h2) {\n bytesToDownload -= this.h2OverflowBytesDownloaded;\n }\n const twoWayLatency = this.rtt;\n const oneWayLatency = twoWayLatency / 2;\n const maximumCongestionWindow = this.computeMaximumCongestionWindowInSegments();\n\n let handshakeAndRequest = oneWayLatency;\n if (!this.warmed) {\n handshakeAndRequest =\n // DNS lookup\n dnsResolutionTime +\n // SYN\n oneWayLatency +\n // SYN ACK\n oneWayLatency +\n // ACK + initial request\n oneWayLatency +\n // ClientHello/ServerHello assuming TLS False Start is enabled (https://istlsfastyet.com/#server-performance).\n (this.ssl ? twoWayLatency : 0);\n }\n\n let roundTrips = Math.ceil(handshakeAndRequest / twoWayLatency);\n let timeToFirstByte = handshakeAndRequest + this.serverLatency + oneWayLatency;\n if (this.warmed && this.h2) {\n timeToFirstByte = 0;\n }\n\n const timeElapsedForTTFB = Math.max(timeToFirstByte - timeAlreadyElapsed, 0);\n const maximumDownloadTimeToElapse = maximumTimeToElapse - timeElapsedForTTFB;\n\n let congestionWindow = Math.min(this._congestionWindow, maximumCongestionWindow);\n let totalBytesDownloaded = 0;\n if (timeElapsedForTTFB > 0) {\n totalBytesDownloaded = congestionWindow * TCP_SEGMENT_SIZE;\n } else {\n roundTrips = 0;\n }\n\n let downloadTimeElapsed = 0;\n let bytesRemaining = bytesToDownload - totalBytesDownloaded;\n while (bytesRemaining > 0 && downloadTimeElapsed <= maximumDownloadTimeToElapse) {\n roundTrips++;\n downloadTimeElapsed += twoWayLatency;\n congestionWindow = Math.max(Math.min(maximumCongestionWindow, congestionWindow * 2), 1);\n\n const bytesDownloadedInWindow = congestionWindow * TCP_SEGMENT_SIZE;\n totalBytesDownloaded += bytesDownloadedInWindow;\n bytesRemaining -= bytesDownloadedInWindow;\n }\n\n const timeElapsed = timeElapsedForTTFB + downloadTimeElapsed;\n const extraBytesDownloaded = this.h2 ? Math.max(totalBytesDownloaded - bytesToDownload, 0) : 0;\n const bytesDownloaded = Math.max(Math.min(totalBytesDownloaded, bytesToDownload), 0);\n\n let connectionTiming: ConnectionTiming;\n if (!this.warmed) {\n connectionTiming = {\n dnsResolutionTime,\n connectionTime: handshakeAndRequest - dnsResolutionTime,\n sslTime: this.ssl ? twoWayLatency : undefined,\n timeToFirstByte,\n };\n } else if (this.h2) {\n // TODO: timing information currently difficult to model for warm h2 connections.\n connectionTiming = {\n timeToFirstByte,\n };\n } else {\n connectionTiming = {\n connectionTime: handshakeAndRequest,\n timeToFirstByte,\n };\n }\n\n return {\n roundTrips,\n timeElapsed,\n bytesDownloaded,\n extraBytesDownloaded,\n congestionWindow,\n connectionTiming,\n };\n }\n}\n\nexport {TCPConnection};\n"]}
|
|
1
|
+
{"version":3,"file":"TCPConnection.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/simulation/TCPConnection.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAmB7B,MAAM,yBAAyB,GAAG,EAAE,CAAC;AACrC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B,MAAM,aAAa;IACjB,MAAM,CAAU;IAChB,GAAG,CAAU;IACb,EAAE,CAAU;IACZ,GAAG,CAAS;IACZ,UAAU,CAAS;IACnB,aAAa,CAAS;IACtB,iBAAiB,CAAS;IAC1B,yBAAyB,CAAS;IAElC,YAAY,GAAW,EAAE,UAAkB,EAAE,aAAa,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,EAAE,EAAE,GAAG,KAAK;QACpF,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,iBAAiB,GAAG,yBAAyB,CAAC;QACnD,IAAI,CAAC,yBAAyB,GAAG,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,GAAW,EAAE,mBAA2B;QACzE,MAAM,mBAAmB,GAAG,IAAI,GAAG,GAAG,CAAC;QACvC,MAAM,iBAAiB,G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AC,aAAa,CAAC,CAAC,CAAC,SAAS;gBAC7C,eAAe;aAChB,CAAC;QACJ,CAAC;aAAM,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC;YACnB,iFAAiF;YACjF,gBAAgB,GAAG;gBACjB,eAAe;aAChB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,gBAAgB,GAAG;gBACjB,cAAc,EAAE,mBAAmB;gBACnC,eAAe;aAChB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,UAAU;YACV,WAAW;YACX,eAAe;YACf,oBAAoB;YACpB,gBAAgB;YAChB,gBAAgB;SACjB,CAAC;IACJ,CAAC;CACF;AAED,OAAO,EAAC,aAAa,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 {ConnectionTiming} from './SimulationTimingMap.js';\n\ninterface DownloadOptions {\n dnsResolutionTime?: number;\n timeAlreadyElapsed?: number;\n maximumTimeToElapse?: number;\n}\n\ninterface DownloadResults {\n roundTrips: number;\n timeElapsed: number;\n bytesDownloaded: number;\n extraBytesDownloaded: number;\n congestionWindow: number;\n connectionTiming: ConnectionTiming;\n}\n\nconst INITIAL_CONGESTION_WINDOW = 10;\nconst TCP_SEGMENT_SIZE = 1460;\n\nclass TCPConnection {\n warmed: boolean;\n ssl: boolean;\n h2: boolean;\n rtt: number;\n throughput: number;\n serverLatency: number;\n _congestionWindow: number;\n h2OverflowBytesDownloaded: number;\n\n constructor(rtt: number, throughput: number, serverLatency = 0, ssl = true, h2 = false) {\n this.warmed = false;\n this.ssl = ssl;\n this.h2 = h2;\n this.rtt = rtt;\n this.throughput = throughput;\n this.serverLatency = serverLatency;\n this._congestionWindow = INITIAL_CONGESTION_WINDOW;\n this.h2OverflowBytesDownloaded = 0;\n }\n\n static maximumSaturatedConnections(rtt: number, availableThroughput: number): number {\n const roundTripsPerSecond = 1000 / rtt;\n const bytesPerRoundTrip = TCP_SEGMENT_SIZE;\n const bytesPerSecond = roundTripsPerSecond * bytesPerRoundTrip;\n const minimumThroughputRequiredPerRequest = bytesPerSecond * 8;\n return Math.floor(availableThroughput / minimumThroughputRequiredPerRequest);\n }\n\n computeMaximumCongestionWindowInSegments(): number {\n const bytesPerSecond = this.throughput / 8;\n const secondsPerRoundTrip = this.rtt / 1000;\n const bytesPerRoundTrip = bytesPerSecond * secondsPerRoundTrip;\n return Math.floor(bytesPerRoundTrip / TCP_SEGMENT_SIZE);\n }\n\n setThroughput(throughput: number): void {\n this.throughput = throughput;\n }\n\n setCongestionWindow(congestion: number): void {\n this._congestionWindow = congestion;\n }\n\n setWarmed(warmed: boolean): void {\n this.warmed = warmed;\n }\n\n isH2(): boolean {\n return this.h2;\n }\n\n get congestionWindow(): number {\n return this._congestionWindow;\n }\n\n /**\n * Sets the number of excess bytes that are available to this connection on future downloads, only\n * applies to H2 connections.\n */\n setH2OverflowBytesDownloaded(bytes: number): void {\n if (!this.h2) {\n return;\n }\n this.h2OverflowBytesDownloaded = bytes;\n }\n\n clone(): TCPConnection {\n return Object.assign(new TCPConnection(this.rtt, this.throughput), this);\n }\n\n /**\n * Simulates a network download of a particular number of bytes over an optional maximum amount of time\n * and returns information about the ending state.\n *\n * See https://hpbn.co/building-blocks-of-tcp/#three-way-handshake and\n * https://hpbn.co/transport-layer-security-tls/#tls-handshake for details.\n */\n simulateDownloadUntil(bytesToDownload: number, options?: DownloadOptions): DownloadResults {\n const {timeAlreadyElapsed = 0, maximumTimeToElapse = Infinity, dnsResolutionTime = 0} = options || {};\n\n if (this.warmed && this.h2) {\n bytesToDownload -= this.h2OverflowBytesDownloaded;\n }\n const twoWayLatency = this.rtt;\n const oneWayLatency = twoWayLatency / 2;\n const maximumCongestionWindow = this.computeMaximumCongestionWindowInSegments();\n\n let handshakeAndRequest = oneWayLatency;\n if (!this.warmed) {\n handshakeAndRequest =\n // DNS lookup\n dnsResolutionTime +\n // SYN\n oneWayLatency +\n // SYN ACK\n oneWayLatency +\n // ACK + initial request\n oneWayLatency +\n // ClientHello/ServerHello assuming TLS False Start is enabled (https://istlsfastyet.com/#server-performance).\n (this.ssl ? twoWayLatency : 0);\n }\n\n let roundTrips = Math.ceil(handshakeAndRequest / twoWayLatency);\n let timeToFirstByte = handshakeAndRequest + this.serverLatency + oneWayLatency;\n if (this.warmed && this.h2) {\n timeToFirstByte = 0;\n }\n\n const timeElapsedForTTFB = Math.max(timeToFirstByte - timeAlreadyElapsed, 0);\n const maximumDownloadTimeToElapse = maximumTimeToElapse - timeElapsedForTTFB;\n\n let congestionWindow = Math.min(this._congestionWindow, maximumCongestionWindow);\n let totalBytesDownloaded = 0;\n if (timeElapsedForTTFB > 0) {\n totalBytesDownloaded = congestionWindow * TCP_SEGMENT_SIZE;\n } else {\n roundTrips = 0;\n }\n\n let downloadTimeElapsed = 0;\n let bytesRemaining = bytesToDownload - totalBytesDownloaded;\n while (bytesRemaining > 0 && downloadTimeElapsed <= maximumDownloadTimeToElapse) {\n roundTrips++;\n downloadTimeElapsed += twoWayLatency;\n congestionWindow = Math.max(Math.min(maximumCongestionWindow, congestionWindow * 2), 1);\n\n const bytesDownloadedInWindow = congestionWindow * TCP_SEGMENT_SIZE;\n totalBytesDownloaded += bytesDownloadedInWindow;\n bytesRemaining -= bytesDownloadedInWindow;\n }\n\n const timeElapsed = timeElapsedForTTFB + downloadTimeElapsed;\n const extraBytesDownloaded = this.h2 ? Math.max(totalBytesDownloaded - bytesToDownload, 0) : 0;\n const bytesDownloaded = Math.max(Math.min(totalBytesDownloaded, bytesToDownload), 0);\n\n let connectionTiming: ConnectionTiming;\n if (!this.warmed) {\n connectionTiming = {\n dnsResolutionTime,\n connectionTime: handshakeAndRequest - dnsResolutionTime,\n sslTime: this.ssl ? twoWayLatency : undefined,\n timeToFirstByte,\n };\n } else if (this.h2) {\n // TODO: timing information currently difficult to model for warm h2 connections.\n connectionTiming = {\n timeToFirstByte,\n };\n } else {\n connectionTiming = {\n connectionTime: handshakeAndRequest,\n timeToFirstByte,\n };\n }\n\n return {\n roundTrips,\n timeElapsed,\n bytesDownloaded,\n extraBytesDownloaded,\n congestionWindow,\n connectionTiming,\n };\n }\n}\n\nexport {TCPConnection};\n"]}
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
"forceConsistentCasingInFileNames": true,
|
|
9
9
|
"inlineSources": true,
|
|
10
10
|
"lib": [
|
|
11
|
-
"
|
|
11
|
+
"ES2023",
|
|
12
|
+
"ES2024.Promise",
|
|
13
|
+
"ESNext.Iterator",
|
|
14
|
+
"ESNext.Collection",
|
|
15
|
+
"ESNext.Array",
|
|
12
16
|
"dom",
|
|
13
17
|
"dom.iterable"
|
|
14
18
|
],
|
|
@@ -24,7 +28,7 @@
|
|
|
24
28
|
"skipLibCheck": true,
|
|
25
29
|
"sourceMap": true,
|
|
26
30
|
"strict": true,
|
|
27
|
-
"target": "
|
|
31
|
+
"target": "ES2023",
|
|
28
32
|
"tsBuildInfoFile": "devtools_entrypoint-bundle-typescript-tsconfig.json.tsbuildinfo",
|
|
29
33
|
"typeRoots": [],
|
|
30
34
|
"useUnknownInCatchVariables": false
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
"forceConsistentCasingInFileNames": true,
|
|
9
9
|
"inlineSources": true,
|
|
10
10
|
"lib": [
|
|
11
|
-
"
|
|
11
|
+
"ES2023",
|
|
12
|
+
"ES2024.Promise",
|
|
13
|
+
"ESNext.Iterator",
|
|
14
|
+
"ESNext.Collection",
|
|
15
|
+
"ESNext.Array",
|
|
12
16
|
"dom",
|
|
13
17
|
"dom.iterable"
|
|
14
18
|
],
|
|
@@ -24,7 +28,7 @@
|
|
|
24
28
|
"skipLibCheck": true,
|
|
25
29
|
"sourceMap": true,
|
|
26
30
|
"strict": true,
|
|
27
|
-
"target": "
|
|
31
|
+
"target": "ES2023",
|
|
28
32
|
"tsBuildInfoFile": "simulation-tsconfig.json.tsbuildinfo",
|
|
29
33
|
"typeRoots": [],
|
|
30
34
|
"useUnknownInCatchVariables": false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulation.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/simulation/simulation.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"simulation.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/simulation/simulation.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,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 './ConnectionPool.js';\nexport * from './Constants.js';\nexport * from './DNSCache.js';\nexport * from './SimulationTimingMap.js';\nexport * from './Simulator.js';\nexport * from './TCPConnection.js';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lantern.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/types/Lantern.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Lantern.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/types/Lantern.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAI7B,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,cAAc,EAAE,gBAAgB;IAChC,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,kBAAkB,EAAE,oBAAoB;IACxC,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;CACN,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 Protocol from '../../../../generated/protocol.js';\n\nexport const NetworkRequestTypes = {\n XHR: 'XHR',\n Fetch: 'Fetch',\n EventSource: 'EventSource',\n Script: 'Script',\n Stylesheet: 'Stylesheet',\n Image: 'Image',\n Media: 'Media',\n Font: 'Font',\n Document: 'Document',\n TextTrack: 'TextTrack',\n WebSocket: 'WebSocket',\n Other: 'Other',\n Manifest: 'Manifest',\n SignedExchange: 'SignedExchange',\n Ping: 'Ping',\n Preflight: 'Preflight',\n CSPViolationReport: 'CSPViolationReport',\n Prefetch: 'Prefetch',\n FedCM: 'FedCM',\n} as const;\n\nexport interface TraceEvent {\n name: string;\n args: {\n name?: string,\n data?: {\n frame?: string,\n readyState?: number,\n stackTrace?: Array<{\n url: string,\n }>,\n url?: string,\n },\n };\n pid: number;\n tid: number;\n /** Timestamp of the event in microseconds. */\n ts: number;\n dur: number;\n}\nexport interface Trace {\n traceEvents: TraceEvent[];\n}\nexport type ResourcePriority = ('VeryLow'|'Low'|'Medium'|'High'|'VeryHigh');\nexport type ResourceType = keyof typeof NetworkRequestTypes;\ntype InitiatorType = ('parser'|'script'|'preload'|'SignedExchange'|'preflight'|'other');\nexport type ResourceTiming = Protocol.Network.ResourceTiming;\nexport interface CallStack {\n callFrames: Array<{\n scriptId: string,\n url: string,\n lineNumber: number,\n columnNumber: number,\n functionName: string,\n }>;\n parent?: CallStack;\n}\n\nexport interface ParsedURL {\n /**\n * Equivalent to a `new URL(url).protocol` BUT w/o the trailing colon (:)\n */\n scheme: string;\n /**\n * Equivalent to a `new URL(url).hostname`\n */\n host: string;\n securityOrigin: string;\n}\n\n// When Lantern NetworkRequests are constructed, the source-of-truth of the network record is given as `rawRequest`.\n// Internally Lantern doesn't care about the type of this field, so a default type is given to simplify internal code\n// by avoiding unnecessary typescript overhead.\n// If callers want to access the underlying network record, they are expected to make use of this generic on top-level\n// interfaces like Simulator.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyNetworkObject = any;\n\nexport interface NetworkRequest<T = AnyNetworkObject> {\n requestId: string;\n connectionId: number;\n connectionReused: boolean;\n url: string;\n protocol: string;\n parsedURL: ParsedURL;\n documentURL: string;\n /** When the renderer process initially discovers a network request, in milliseconds. */\n rendererStartTime: number;\n /**\n * When the network service is about to handle a request, ie. just before going to the\n * HTTP cache or going to the network for DNS/connection setup, in milliseconds.\n */\n networkRequestTime: number;\n /**\n * When the last byte of the response headers is received, in milliseconds.\n * Equal to networkRequestTime if no data is received over the\n * network (ex: cached requests or data urls).\n */\n responseHeadersEndTime: number;\n /** When the last byte of the response body is received, in milliseconds. */\n networkEndTime: number;\n transferSize: number;\n resourceSize: number;\n fromDiskCache: boolean;\n fromMemoryCache: boolean;\n isLinkPreload: boolean;\n finished: boolean;\n failed: boolean;\n statusCode: number;\n /** The network request that redirected to this one */\n redirectSource: NetworkRequest<T>|undefined;\n /** The network request that this one redirected to */\n redirectDestination: NetworkRequest<T>|undefined;\n // TODO: can't use Protocol.Network.Initiator because of type mismatch in Lighthouse initiator.\n initiator: {\n type: InitiatorType,\n url?: string,\n stack?: CallStack,\n };\n initiatorRequest: NetworkRequest<T>|undefined;\n /** The chain of network requests that redirected to this one */\n redirects: NetworkRequest[]|undefined;\n timing: Protocol.Network.ResourceTiming|undefined;\n resourceType: ResourceType|undefined;\n mimeType: string;\n priority: ResourcePriority;\n frameId: string|undefined;\n fromWorker: boolean;\n /**\n * Optional value for how long the server took to respond to this request, in ms.\n * When not provided, the server response time is derived from the timing object.\n */\n serverResponseTime?: number;\n /**\n * Implementation-specific canonical data structure that this Lantern NetworkRequest\n * was derived from.\n * Users of Lantern create a NetworkRequest matching this interface,\n * but can store the source-of-truth for their network model in this property.\n * This is then accessible as a read-only property on NetworkNode.\n */\n rawRequest?: T;\n}\n\nexport namespace Simulation {\n export interface URL {\n /** URL of the initially requested URL */\n requestedUrl?: string;\n /** URL of the last document request */\n mainDocumentUrl?: string;\n }\n\n /** Simulation settings that control the amount of network & cpu throttling in the run. */\n export interface ThrottlingSettings {\n /** The round trip time in milliseconds. */\n rttMs?: number;\n /** The network throughput in kilobits per second. */\n throughputKbps?: number;\n // devtools settings\n /** The network request latency in milliseconds. */\n requestLatencyMs?: number;\n /** The network download throughput in kilobits per second. */\n downloadThroughputKbps?: number;\n /** The network upload throughput in kilobits per second. */\n uploadThroughputKbps?: number;\n // used by both\n /** The amount of slowdown applied to the cpu (1/<cpuSlowdownMultiplier>). */\n cpuSlowdownMultiplier?: number;\n }\n\n export interface PrecomputedLanternData {\n additionalRttByOrigin: Record<string, number>;\n serverResponseTimeByOrigin: Record<string, number>;\n }\n\n export interface Settings {\n networkAnalysis: {\n rtt: number,\n additionalRttByOrigin: Map<string, number>,\n serverResponseTimeByOrigin: Map<string, number>,\n throughput: number,\n };\n /** The method used to throttle the network. */\n throttlingMethod: 'devtools'|'simulate'|'provided';\n /** The throttling config settings. */\n throttling?: Required<ThrottlingSettings>;\n /** Precomputed lantern estimates to use instead of observed analysis. */\n precomputedLanternData?: PrecomputedLanternData|null;\n }\n\n export interface Options {\n rtt?: number;\n throughput?: number;\n observedThroughput: number;\n maximumConcurrentRequests?: number;\n cpuSlowdownMultiplier?: number;\n layoutTaskMultiplier?: number;\n additionalRttByOrigin?: Map<string, number>;\n serverResponseTimeByOrigin?: Map<string, number>;\n }\n\n export interface ProcessedNavigation {\n timestamps: {\n firstContentfulPaint: number,\n largestContentfulPaint?: number,\n };\n }\n\n export interface NodeTiming {\n startTime: number;\n endTime: number;\n duration: number;\n }\n}\n"]}
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
"forceConsistentCasingInFileNames": true,
|
|
9
9
|
"inlineSources": true,
|
|
10
10
|
"lib": [
|
|
11
|
-
"
|
|
11
|
+
"ES2023",
|
|
12
|
+
"ES2024.Promise",
|
|
13
|
+
"ESNext.Iterator",
|
|
14
|
+
"ESNext.Collection",
|
|
15
|
+
"ESNext.Array",
|
|
12
16
|
"dom",
|
|
13
17
|
"dom.iterable"
|
|
14
18
|
],
|
|
@@ -24,7 +28,7 @@
|
|
|
24
28
|
"skipLibCheck": true,
|
|
25
29
|
"sourceMap": true,
|
|
26
30
|
"strict": true,
|
|
27
|
-
"target": "
|
|
31
|
+
"target": "ES2023",
|
|
28
32
|
"tsBuildInfoFile": "devtools_entrypoint-bundle-typescript-tsconfig.json.tsbuildinfo",
|
|
29
33
|
"typeRoots": [],
|
|
30
34
|
"useUnknownInCatchVariables": false
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
"forceConsistentCasingInFileNames": true,
|
|
9
9
|
"inlineSources": true,
|
|
10
10
|
"lib": [
|
|
11
|
-
"
|
|
11
|
+
"ES2023",
|
|
12
|
+
"ES2024.Promise",
|
|
13
|
+
"ESNext.Iterator",
|
|
14
|
+
"ESNext.Collection",
|
|
15
|
+
"ESNext.Array",
|
|
12
16
|
"dom",
|
|
13
17
|
"dom.iterable"
|
|
14
18
|
],
|
|
@@ -24,7 +28,7 @@
|
|
|
24
28
|
"skipLibCheck": true,
|
|
25
29
|
"sourceMap": true,
|
|
26
30
|
"strict": true,
|
|
27
|
-
"target": "
|
|
31
|
+
"target": "ES2023",
|
|
28
32
|
"tsBuildInfoFile": "types-tsconfig.json.tsbuildinfo",
|
|
29
33
|
"typeRoots": [],
|
|
30
34
|
"useUnknownInCatchVariables": false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/types/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/types/types.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,cAAc,cAAc,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 './Lantern.js';\n"]}
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
"forceConsistentCasingInFileNames": true,
|
|
9
9
|
"inlineSources": true,
|
|
10
10
|
"lib": [
|
|
11
|
-
"
|
|
11
|
+
"ES2023",
|
|
12
|
+
"ES2024.Promise",
|
|
13
|
+
"ESNext.Iterator",
|
|
14
|
+
"ESNext.Collection",
|
|
15
|
+
"ESNext.Array",
|
|
12
16
|
"dom",
|
|
13
17
|
"dom.iterable"
|
|
14
18
|
],
|
|
@@ -24,15 +28,19 @@
|
|
|
24
28
|
"skipLibCheck": true,
|
|
25
29
|
"sourceMap": true,
|
|
26
30
|
"strict": true,
|
|
27
|
-
"target": "
|
|
31
|
+
"target": "ES2023",
|
|
28
32
|
"tsBuildInfoFile": "trace-tsconfig.json.tsbuildinfo",
|
|
29
33
|
"typeRoots": [],
|
|
30
34
|
"useUnknownInCatchVariables": false
|
|
31
35
|
},
|
|
32
36
|
"files": [
|
|
37
|
+
"../../../../../../front_end/models/trace/EntityMapper.ts",
|
|
38
|
+
"../../../../../../front_end/models/trace/EventsSerializer.ts",
|
|
33
39
|
"../../../../../../front_end/models/trace/LanternComputationData.ts",
|
|
34
40
|
"../../../../../../front_end/models/trace/ModelImpl.ts",
|
|
41
|
+
"../../../../../../front_end/models/trace/Name.ts",
|
|
35
42
|
"../../../../../../front_end/models/trace/Processor.ts",
|
|
43
|
+
"../../../../../../front_end/models/trace/Styles.ts",
|
|
36
44
|
"../../../../../../front_end/legacy/legacy-defs.d.ts",
|
|
37
45
|
"../../../../../../front_end/global_typings/global_defs.d.ts",
|
|
38
46
|
"../../../../../../node_modules/@types/filesystem/index.d.ts"
|
package/models/trace/trace.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as EntityMapper from './EntityMapper.js';
|
|
2
|
+
import * as EventsSerializer from './EventsSerializer.js';
|
|
1
3
|
import * as Extras from './extras/extras.js';
|
|
2
4
|
import * as Handlers from './handlers/handlers.js';
|
|
3
5
|
import * as Helpers from './helpers/helpers.js';
|
|
@@ -5,6 +7,8 @@ import * as Insights from './insights/insights.js';
|
|
|
5
7
|
import * as Lantern from './lantern/lantern.js';
|
|
6
8
|
import * as LanternComputationData from './LanternComputationData.js';
|
|
7
9
|
import * as TraceModel from './ModelImpl.js';
|
|
10
|
+
import * as Name from './Name.js';
|
|
8
11
|
import * as Processor from './Processor.js';
|
|
12
|
+
import * as Styles from './Styles.js';
|
|
9
13
|
import * as Types from './types/types.js';
|
|
10
|
-
export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, TraceModel, Types, };
|
|
14
|
+
export { EntityMapper, EventsSerializer, Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Name, Processor, Styles, TraceModel, Types, };
|
package/models/trace/trace.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
// Copyright 2022 The Chromium Authors
|
|
1
|
+
// Copyright 2022 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
+
import * as EntityMapper from './EntityMapper.js';
|
|
5
|
+
import * as EventsSerializer from './EventsSerializer.js';
|
|
4
6
|
import * as Extras from './extras/extras.js';
|
|
5
7
|
import * as Handlers from './handlers/handlers.js';
|
|
6
8
|
import * as Helpers from './helpers/helpers.js';
|
|
@@ -8,7 +10,9 @@ import * as Insights from './insights/insights.js';
|
|
|
8
10
|
import * as Lantern from './lantern/lantern.js';
|
|
9
11
|
import * as LanternComputationData from './LanternComputationData.js';
|
|
10
12
|
import * as TraceModel from './ModelImpl.js';
|
|
13
|
+
import * as Name from './Name.js';
|
|
11
14
|
import * as Processor from './Processor.js';
|
|
15
|
+
import * as Styles from './Styles.js';
|
|
12
16
|
import * as Types from './types/types.js';
|
|
13
|
-
export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, TraceModel, Types, };
|
|
17
|
+
export { EntityMapper, EventsSerializer, Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Name, Processor, Styles, TraceModel, Types, };
|
|
14
18
|
//# sourceMappingURL=trace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../../../../front_end/models/trace/trace.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../../../../front_end/models/trace/trace.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,sBAAsB,EACtB,IAAI,EACJ,SAAS,EACT,MAAM,EACN,UAAU,EACV,KAAK,GACN,CAAC","sourcesContent":["// Copyright 2022 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 EntityMapper from './EntityMapper.js';\nimport * as EventsSerializer from './EventsSerializer.js';\nimport * as Extras from './extras/extras.js';\nimport * as Handlers from './handlers/handlers.js';\nimport * as Helpers from './helpers/helpers.js';\nimport * as Insights from './insights/insights.js';\nimport * as Lantern from './lantern/lantern.js';\nimport * as LanternComputationData from './LanternComputationData.js';\nimport * as TraceModel from './ModelImpl.js';\nimport * as Name from './Name.js';\nimport * as Processor from './Processor.js';\nimport * as Styles from './Styles.js';\nimport * as Types from './types/types.js';\n\nexport {\n EntityMapper,\n EventsSerializer,\n Extras,\n Handlers,\n Helpers,\n Insights,\n Lantern,\n LanternComputationData,\n Name,\n Processor,\n Styles,\n TraceModel,\n Types,\n};\n"]}
|
|
@@ -3,6 +3,7 @@ import type * as Platform from '../../../core/platform/platform.js';
|
|
|
3
3
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
4
4
|
import type * as Lantern from '../lantern/lantern.js';
|
|
5
5
|
import type * as File from './File.js';
|
|
6
|
+
import type { Milli } from './Timing.js';
|
|
6
7
|
export interface Configuration {
|
|
7
8
|
/**
|
|
8
9
|
* Include V8 RCS functions in the JS stacks
|
|
@@ -66,6 +67,16 @@ export interface ParseOptions {
|
|
|
66
67
|
end: (id: string) => void;
|
|
67
68
|
};
|
|
68
69
|
lanternSettings?: Omit<Lantern.Types.Simulation.Settings, 'networkAnalysis'>;
|
|
70
|
+
/**
|
|
71
|
+
* Used when an Insight needs to format a time to string as part of its
|
|
72
|
+
* output. By default we use the i18n.TimeUtilities in DevTools but this
|
|
73
|
+
* enables it to be overridden, which is useful if you are consuming the trace
|
|
74
|
+
* engine outside of DevTools.
|
|
75
|
+
*/
|
|
76
|
+
insightTimeFormatters?: InsightTimeFormatters;
|
|
77
|
+
}
|
|
78
|
+
export interface InsightTimeFormatters {
|
|
79
|
+
milli: (x: Milli) => string;
|
|
69
80
|
}
|
|
70
81
|
export interface ResolveSourceMapParams {
|
|
71
82
|
scriptId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Configuration.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Configuration.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAgD7B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAkB,EAAE,CAAC,CAAC;IAC5C,uBAAuB,EAAE,KAAK;IAC9B,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,KAAK;IAChB,6BAA6B,EAAE,EAAE;IACjC,4BAA4B,EAAE,KAAK;CACpC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAqB;IACpD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC","sourcesContent":["// Copyright 2023 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 Platform from '../../../core/platform/platform.js';\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as Lantern from '../lantern/lantern.js';\n\nimport type * as File from './File.js';\nimport type {Milli} from './Timing.js';\n\nexport interface Configuration {\n /**\n * Include V8 RCS functions in the JS stacks\n */\n includeRuntimeCallStats: boolean;\n /**\n * Show all events: disable the default filtering which hides and excludes some events.\n */\n showAllEvents: boolean;\n /**\n * Extra detail for RPP developers (eg Trace Event json in Summary, and individual JS Sample events)\n */\n debugMode: boolean;\n /**\n * How many invalidation events will be stored for a layout (or similar) event.\n * On large sites with a lot of DOM there can be thousands of invalidations\n * associated with any given event. It is not useful to show the user 1000s of\n * invalidations in the UI, but it is also expensive for us to hold onto them\n * all, and it helps prevents OOM issues when running in NodeJS\n * [https://github.com/GoogleChrome/lighthouse/issues/16111].\n * Therefore, instead, we store only the latest 20 per event. We do also store\n * the total count, so we can show that, but we'll only ever hold on to the\n * last 20 invalidations (in DESC trace order - so the latest 20 in the trace file)\n *\n * If you set this to 0, we will skip the Invalidations processing entirely.\n * 0 effectively disables the InvalidationsHandler and it will not even\n * attempt to gather or track invalidations.\n */\n maxInvalidationEventsPerEvent: number;\n /**\n * Determines if the AnimationFramesHandler should be enabled. Currently in\n * DevTools we do not use it, so we disable it by default to avoid work that\n * we do not use. If you disable it, you will still see `data.AnimationFrames`\n * from the model, but the contents will be empty.\n */\n enableAnimationsFrameHandler: boolean;\n}\n\nexport const defaults = (): Configuration => ({\n includeRuntimeCallStats: false,\n showAllEvents: false,\n debugMode: false,\n maxInvalidationEventsPerEvent: 20,\n enableAnimationsFrameHandler: false,\n});\n\n/**\n * Generates a key that can be used to represent this config in a cache. This is\n * used mainly in tests, where we want to avoid re-parsing a file if we have\n * already processed it with the same configuration.\n */\nexport function configToCacheKey(config: Configuration): string {\n return JSON.stringify(config);\n}\n\nexport interface ParseOptions {\n /**\n * If the trace was just recorded on the current page, rather than an imported file.\n * TODO(paulirish): Maybe remove. This is currently unused by the Processor and Handlers\n * @default false\n */\n isFreshRecording?: boolean;\n /**\n * If the trace is a CPU Profile rather than a Chrome tracing trace.\n * @default false\n */\n isCPUProfile?: boolean;\n metadata?: File.MetaData;\n resolveSourceMap?: (params: ResolveSourceMapParams) => Promise<SDK.SourceMap.SourceMap|null>;\n logger?: {\n start: (id: string) => void,\n end: (id: string) => void,\n };\n lanternSettings?: Omit<Lantern.Types.Simulation.Settings, 'networkAnalysis'>;\n /**\n * Used when an Insight needs to format a time to string as part of its\n * output. By default we use the i18n.TimeUtilities in DevTools but this\n * enables it to be overridden, which is useful if you are consuming the trace\n * engine outside of DevTools.\n */\n insightTimeFormatters?: InsightTimeFormatters;\n}\n\nexport interface InsightTimeFormatters {\n milli: (x: Milli) => string;\n}\n\nexport interface ResolveSourceMapParams {\n scriptId: string;\n scriptUrl: Platform.DevToolsPath.UrlString;\n /** The url as resolved by any sourceUrl comment. */\n sourceUrl: Platform.DevToolsPath.UrlString;\n sourceMapUrl: Platform.DevToolsPath.UrlString;\n frame: Protocol.Page.FrameId;\n /** Set only if the raw source map was found on the provided metadata. Never set for source maps from data urls. */\n cachedRawSourceMap?: SDK.SourceMap.SourceMapV3;\n}\n"]}
|
|
@@ -1,52 +1,64 @@
|
|
|
1
1
|
import type * as Platform from '../../../core/platform/platform.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ConsoleTimeStamp, Event, PerformanceMark, PerformanceMeasureBegin, Phase, SyntheticBased } from './TraceEvents.js';
|
|
3
3
|
export type ExtensionEntryType = 'track-entry' | 'marker';
|
|
4
4
|
export declare const extensionPalette: readonly ["primary", "primary-light", "primary-dark", "secondary", "secondary-light", "secondary-dark", "tertiary", "tertiary-light", "tertiary-dark", "error", "warning"];
|
|
5
5
|
export type ExtensionColorFromPalette = typeof extensionPalette[number];
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Represents any valid value that can be produced by JSON.parse()
|
|
8
|
+
* without a reviver.
|
|
9
|
+
*/
|
|
10
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
11
|
+
[key: string]: JsonValue;
|
|
12
|
+
};
|
|
13
|
+
export interface DevToolsObjBase {
|
|
7
14
|
color?: ExtensionColorFromPalette;
|
|
8
15
|
/**
|
|
9
16
|
* We document to users that we support only string values here, but because
|
|
10
17
|
* this is coming from user code the values could be anything, so we ensure we
|
|
11
18
|
* deal with bad data by typing this as unknown.
|
|
12
19
|
*/
|
|
13
|
-
properties?: Array<[string,
|
|
20
|
+
properties?: Array<[string, JsonValue]>;
|
|
14
21
|
tooltipText?: string;
|
|
15
22
|
}
|
|
16
|
-
export type
|
|
23
|
+
export type DevToolsObj = DevToolsObjEntry | DevToolsObjMarker;
|
|
17
24
|
export interface ExtensionTrackEntryPayloadDeeplink {
|
|
18
25
|
url: Platform.DevToolsPath.UrlString;
|
|
19
26
|
description: string;
|
|
20
27
|
}
|
|
21
|
-
export interface
|
|
28
|
+
export interface DevToolsObjEntry extends DevToolsObjBase {
|
|
22
29
|
dataType?: 'track-entry';
|
|
23
30
|
track: string;
|
|
24
31
|
trackGroup?: string;
|
|
25
|
-
|
|
32
|
+
userDetail?: JsonValue;
|
|
26
33
|
}
|
|
27
|
-
export interface
|
|
34
|
+
export interface DevToolsObjMarker extends DevToolsObjBase {
|
|
28
35
|
dataType: 'marker';
|
|
29
36
|
}
|
|
30
37
|
/**
|
|
31
38
|
* Synthetic events created for extension tracks.
|
|
32
39
|
*/
|
|
33
40
|
export interface SyntheticExtensionTrackEntry extends SyntheticBased<Phase.COMPLETE, PerformanceMeasureBegin | PerformanceMark | ConsoleTimeStamp> {
|
|
34
|
-
|
|
41
|
+
devtoolsObj: DevToolsObjEntry;
|
|
42
|
+
userDetail: JsonValue | null;
|
|
35
43
|
}
|
|
36
44
|
/**
|
|
37
45
|
* Synthetic events created for extension marks.
|
|
38
46
|
*/
|
|
39
47
|
export interface SyntheticExtensionMarker extends SyntheticBased<Phase.INSTANT, PerformanceMark> {
|
|
40
|
-
|
|
48
|
+
devtoolsObj: DevToolsObjMarker;
|
|
49
|
+
userDetail: JsonValue | null;
|
|
41
50
|
}
|
|
42
51
|
export type SyntheticExtensionEntry = SyntheticExtensionTrackEntry | SyntheticExtensionMarker;
|
|
52
|
+
/** Returns true if this is a devtoolsObj for a marker */
|
|
43
53
|
export declare function isExtensionPayloadMarker(payload: {
|
|
44
54
|
dataType?: string;
|
|
45
|
-
}): payload is
|
|
46
|
-
|
|
55
|
+
}): payload is DevToolsObjMarker;
|
|
56
|
+
/** Returns true if this is a devtoolsObj for an entry (non-instant) */
|
|
57
|
+
export declare function isExtensionEntryObj(payload: {
|
|
47
58
|
track?: string;
|
|
48
59
|
dataType?: string;
|
|
49
|
-
}): payload is
|
|
60
|
+
}): payload is DevToolsObjEntry;
|
|
61
|
+
/** Returns true if this is a devtoolsObj for a console.timeStamp */
|
|
50
62
|
export declare function isConsoleTimestampPayloadTrackEntry(payload: {
|
|
51
63
|
description?: string;
|
|
52
64
|
url?: string;
|
|
@@ -56,7 +68,7 @@ export declare function isValidExtensionPayload(payload: {
|
|
|
56
68
|
dataType?: string;
|
|
57
69
|
description?: string;
|
|
58
70
|
url?: string;
|
|
59
|
-
}): payload is
|
|
71
|
+
}): payload is DevToolsObj | ExtensionTrackEntryPayloadDeeplink;
|
|
60
72
|
export declare function isSyntheticExtensionEntry(entry: Event): entry is SyntheticExtensionEntry;
|
|
61
73
|
export interface ExtensionTrackData {
|
|
62
74
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright 2024 The Chromium Authors
|
|
1
|
+
// Copyright 2024 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
export const extensionPalette = [
|
|
@@ -14,19 +14,22 @@ export const extensionPalette = [
|
|
|
14
14
|
'error',
|
|
15
15
|
'warning',
|
|
16
16
|
];
|
|
17
|
+
/** Returns true if this is a devtoolsObj for a marker */
|
|
17
18
|
export function isExtensionPayloadMarker(payload) {
|
|
18
19
|
return payload.dataType === 'marker';
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
/** Returns true if this is a devtoolsObj for an entry (non-instant) */
|
|
22
|
+
export function isExtensionEntryObj(payload) {
|
|
21
23
|
const hasTrack = 'track' in payload && Boolean(payload.track);
|
|
22
24
|
const validEntryType = payload.dataType === 'track-entry' || payload.dataType === undefined;
|
|
23
25
|
return validEntryType && hasTrack;
|
|
24
26
|
}
|
|
27
|
+
/** Returns true if this is a devtoolsObj for a console.timeStamp */
|
|
25
28
|
export function isConsoleTimestampPayloadTrackEntry(payload) {
|
|
26
29
|
return payload.url !== undefined && payload.description !== undefined;
|
|
27
30
|
}
|
|
28
31
|
export function isValidExtensionPayload(payload) {
|
|
29
|
-
return isExtensionPayloadMarker(payload) ||
|
|
32
|
+
return isExtensionPayloadMarker(payload) || isExtensionEntryObj(payload) ||
|
|
30
33
|
isConsoleTimestampPayloadTrackEntry(payload);
|
|
31
34
|
}
|
|
32
35
|
export function isSyntheticExtensionEntry(entry) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Extensions.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Extensions.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAS7B,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS;IACT,eAAe;IACf,cAAc;IACd,WAAW;IACX,iBAAiB;IACjB,gBAAgB;IAChB,UAAU;IACV,gBAAgB;IAChB,eAAe;IACf,OAAO;IACP,SAAS;CACD,CAAC;AA0EX,yDAAyD;AACzD,MAAM,UAAU,wBAAwB,CAAC,OAA4B;IACnE,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACvC,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,mBAAmB,CAAC,OAA4C;IAC9E,MAAM,QAAQ,GAAG,OAAO,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,cAAc,GAAG,OAAO,CAAC,QAAQ,KAAK,aAAa,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;IAC5F,OAAO,cAAc,IAAI,QAAQ,CAAC;AACpC,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,mCAAmC,CAAC,OAA6C;IAE/F,OAAO,OAAO,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,uBAAuB,CACnC,OAAgF;IAElF,OAAO,wBAAwB,CAAC,OAAO,CAAC,IAAI,mBAAmB,CAAC,OAAO,CAAC;QACpE,mCAAmC,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAAY;IACpD,OAAO,KAAK,CAAC,GAAG,KAAK,oBAAoB,CAAC;AAC5C,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 Platform from '../../../core/platform/platform.js';\n\nimport type {\n ConsoleTimeStamp, Event, PerformanceMark, PerformanceMeasureBegin, Phase, SyntheticBased} from './TraceEvents.js';\n\nexport type ExtensionEntryType = 'track-entry'|'marker';\n\nexport const extensionPalette = [\n 'primary',\n 'primary-light',\n 'primary-dark',\n 'secondary',\n 'secondary-light',\n 'secondary-dark',\n 'tertiary',\n 'tertiary-light',\n 'tertiary-dark',\n 'error',\n 'warning',\n] as const;\n\nexport type ExtensionColorFromPalette = typeof extensionPalette[number];\n\n/**\n * Represents any valid value that can be produced by JSON.parse()\n * without a reviver.\n */\nexport type JsonValue = string|number|boolean|null|JsonValue[]|{[key: string]: JsonValue};\n\nexport interface DevToolsObjBase {\n color?: ExtensionColorFromPalette;\n /**\n * We document to users that we support only string values here, but because\n * this is coming from user code the values could be anything, so we ensure we\n * deal with bad data by typing this as unknown.\n */\n properties?: Array<[string, JsonValue]>;\n tooltipText?: string;\n}\n\nexport type DevToolsObj = DevToolsObjEntry|DevToolsObjMarker;\n\nexport interface ExtensionTrackEntryPayloadDeeplink {\n // The URL (deep-link) to show in the summary for the track.\n url: Platform.DevToolsPath.UrlString;\n // The label to show in front of the URL when the deep-link is shown in the\n // graph.\n description: string;\n}\n\nexport interface DevToolsObjEntry extends DevToolsObjBase {\n // Typed as possibly undefined since when no data type is provided\n // the entry is defaulted to a track entry\n dataType?: 'track-entry';\n // The name of the track the entry will be displayed in.\n // Entries intended to be displayed in the same track must contain the\n // same value in this property.\n // If undefined, measurement is added to the Timings track\n track: string;\n // The track group an entry’s track belongs to.\n // Entries intended to be displayed in the same track must contain the\n // same value in this property as well as the same value in the track\n // property.\n trackGroup?: string;\n // Additional data (e.g. deep-link URL) that can be shown in the summary\n // In perf.mark/measure, it's anything in the `detail` object that's not the `devtools` object\n // In console.timestamp, it's the 7th argument to console.timeStamp().\n userDetail?: JsonValue;\n}\n\nexport interface DevToolsObjMarker extends DevToolsObjBase {\n dataType: 'marker';\n}\n\n/**\n * Synthetic events created for extension tracks.\n */\nexport interface SyntheticExtensionTrackEntry extends\n SyntheticBased<Phase.COMPLETE, PerformanceMeasureBegin|PerformanceMark|ConsoleTimeStamp> {\n devtoolsObj: DevToolsObjEntry;\n userDetail: JsonValue|null;\n}\n\n/**\n * Synthetic events created for extension marks.\n */\nexport interface SyntheticExtensionMarker extends SyntheticBased<Phase.INSTANT, PerformanceMark> {\n devtoolsObj: DevToolsObjMarker;\n userDetail: JsonValue|null;\n}\n\nexport type SyntheticExtensionEntry = SyntheticExtensionTrackEntry|SyntheticExtensionMarker;\n\n/** Returns true if this is a devtoolsObj for a marker */\nexport function isExtensionPayloadMarker(payload: {dataType?: string}): payload is DevToolsObjMarker {\n return payload.dataType === 'marker';\n}\n\n/** Returns true if this is a devtoolsObj for an entry (non-instant) */\nexport function isExtensionEntryObj(payload: {track?: string, dataType?: string}): payload is DevToolsObjEntry {\n const hasTrack = 'track' in payload && Boolean(payload.track);\n const validEntryType = payload.dataType === 'track-entry' || payload.dataType === undefined;\n return validEntryType && hasTrack;\n}\n\n/** Returns true if this is a devtoolsObj for a console.timeStamp */\nexport function isConsoleTimestampPayloadTrackEntry(payload: {description?: string, url?: string}):\n payload is ExtensionTrackEntryPayloadDeeplink {\n return payload.url !== undefined && payload.description !== undefined;\n}\n\nexport function isValidExtensionPayload(\n payload: {track?: string, dataType?: string, description?: string, url?: string}): payload is DevToolsObj|\n ExtensionTrackEntryPayloadDeeplink {\n return isExtensionPayloadMarker(payload) || isExtensionEntryObj(payload) ||\n isConsoleTimestampPayloadTrackEntry(payload);\n}\n\nexport function isSyntheticExtensionEntry(entry: Event): entry is SyntheticExtensionEntry {\n return entry.cat === 'devtools.extension';\n}\n\nexport interface ExtensionTrackData {\n // Name of the top level track. If it's a track group then this value\n // has the name of the group, otherwise it has the name of the track.\n name: string;\n isTrackGroup: boolean;\n // If this contains the data of a track group, this property contains\n // the entries of each of the tracks in the the group. If this is a\n // standalone track, then this contains that track's entries only.\n entriesByTrack: Record<string, SyntheticExtensionTrackEntry[]>;\n}\n"]}
|
|
@@ -96,11 +96,18 @@ export type Annotation = EntryLabelAnnotation | TimeRangeAnnotation | EntriesLin
|
|
|
96
96
|
export declare function isTimeRangeAnnotation(annotation: Annotation): annotation is TimeRangeAnnotation;
|
|
97
97
|
export declare function isEntryLabelAnnotation(annotation: Annotation): annotation is EntryLabelAnnotation;
|
|
98
98
|
export declare function isEntriesLinkAnnotation(annotation: Annotation): annotation is EntriesLinkAnnotation;
|
|
99
|
+
/**
|
|
100
|
+
* Serializable keys are created for trace events to be able to save
|
|
101
|
+
* references to timeline events in a trace file. These keys enable
|
|
102
|
+
* user modifications that can be saved. See go/cpq:event-data-json for
|
|
103
|
+
* more details on the key format.
|
|
104
|
+
**/
|
|
99
105
|
export type RawEventKey = `${EventKeyType.RAW_EVENT}-${number}`;
|
|
100
106
|
export type SyntheticEventKey = `${EventKeyType.SYNTHETIC_EVENT}-${number}`;
|
|
101
107
|
export type ProfileCallKey = `${EventKeyType.PROFILE_CALL}-${ProcessID}-${ThreadID}-${SampleIndex}-${Protocol.integer}`;
|
|
102
108
|
export type LegacyTimelineFrameKey = `${EventKeyType.LEGACY_TIMELINE_FRAME}-${number}`;
|
|
103
109
|
export type SerializableKey = RawEventKey | ProfileCallKey | SyntheticEventKey | LegacyTimelineFrameKey;
|
|
110
|
+
/** Serializable keys values objects contain data that maps the keys to original Trace Events **/
|
|
104
111
|
export interface RawEventKeyValues {
|
|
105
112
|
type: EventKeyType.RAW_EVENT;
|
|
106
113
|
rawIndex: number;
|
|
@@ -129,6 +136,11 @@ export interface Modifications {
|
|
|
129
136
|
initialBreadcrumb: Breadcrumb;
|
|
130
137
|
annotations: SerializedAnnotations;
|
|
131
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* IMPORTANT: this is the same as PerfUI.FlameChart.PersistedGroupConfig
|
|
141
|
+
* However, the PerfUI code should not depend on the model/trace, and similarly
|
|
142
|
+
* this model cannot depend on that code, so we duplicate it.
|
|
143
|
+
**/
|
|
132
144
|
export interface TrackVisualConfig {
|
|
133
145
|
hidden: boolean;
|
|
134
146
|
expanded: boolean;
|
|
@@ -167,7 +179,7 @@ export interface MetaData {
|
|
|
167
179
|
visualTrackConfig?: PersistedTraceVisualConfig;
|
|
168
180
|
hostDPR?: number;
|
|
169
181
|
}
|
|
170
|
-
interface MetadataSourceMap {
|
|
182
|
+
export interface MetadataSourceMap {
|
|
171
183
|
url: string;
|
|
172
184
|
/** If not defined, then this was a data url. */
|
|
173
185
|
sourceMapUrl?: string;
|
|
@@ -175,4 +187,3 @@ interface MetadataSourceMap {
|
|
|
175
187
|
}
|
|
176
188
|
export type Contents = TraceFile | Event[];
|
|
177
189
|
export declare function traceEventKeyToValues(key: SerializableKey): SerializableKeyValues;
|
|
178
|
-
export {};
|