@paulirish/trace_engine 0.0.44 → 0.0.45

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.
Files changed (272) hide show
  1. package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
  2. package/core/platform/ArrayUtilities.d.ts +1 -1
  3. package/core/platform/ArrayUtilities.js.map +1 -1
  4. package/core/platform/DOMUtilities.js +1 -1
  5. package/core/platform/DOMUtilities.js.map +1 -1
  6. package/core/platform/MimeType.js.map +1 -1
  7. package/core/platform/NumberUtilities.js.map +1 -1
  8. package/core/platform/ServerTiming.d.ts +2 -2
  9. package/core/platform/ServerTiming.js.map +1 -1
  10. package/core/platform/StringUtilities.js +1 -1
  11. package/core/platform/StringUtilities.js.map +1 -1
  12. package/core/platform/Timing.d.ts +0 -1
  13. package/core/platform/Timing.js +0 -3
  14. package/core/platform/Timing.js.map +1 -1
  15. package/core/platform/TypedArrayUtilities.js +3 -2
  16. package/core/platform/TypedArrayUtilities.js.map +1 -1
  17. package/generated/protocol.d.ts +71 -4
  18. package/locales/af.json +184 -1
  19. package/locales/am.json +184 -1
  20. package/locales/ar.json +184 -1
  21. package/locales/as.json +184 -1
  22. package/locales/az.json +184 -1
  23. package/locales/be.json +184 -1
  24. package/locales/bg.json +184 -1
  25. package/locales/bn.json +184 -1
  26. package/locales/bs.json +184 -1
  27. package/locales/ca.json +184 -1
  28. package/locales/cs.json +184 -1
  29. package/locales/cy.json +184 -1
  30. package/locales/da.json +184 -1
  31. package/locales/de.json +184 -1
  32. package/locales/el.json +184 -1
  33. package/locales/en-GB.json +184 -1
  34. package/locales/en-US.json +201 -15
  35. package/locales/en-XL.json +201 -15
  36. package/locales/es-419.json +184 -1
  37. package/locales/es.json +184 -1
  38. package/locales/et.json +184 -1
  39. package/locales/eu.json +184 -1
  40. package/locales/fa.json +184 -1
  41. package/locales/fi.json +184 -1
  42. package/locales/fil.json +184 -1
  43. package/locales/fr-CA.json +184 -1
  44. package/locales/fr.json +184 -1
  45. package/locales/gl.json +184 -1
  46. package/locales/gu.json +184 -1
  47. package/locales/he.json +185 -2
  48. package/locales/hi.json +184 -1
  49. package/locales/hr.json +184 -1
  50. package/locales/hu.json +184 -1
  51. package/locales/hy.json +184 -1
  52. package/locales/id.json +184 -1
  53. package/locales/is.json +184 -1
  54. package/locales/it.json +184 -1
  55. package/locales/ja.json +184 -1
  56. package/locales/ka.json +184 -1
  57. package/locales/kk.json +184 -1
  58. package/locales/km.json +184 -1
  59. package/locales/kn.json +184 -1
  60. package/locales/ko.json +184 -1
  61. package/locales/ky.json +184 -1
  62. package/locales/lo.json +184 -1
  63. package/locales/lt.json +184 -1
  64. package/locales/lv.json +184 -1
  65. package/locales/mk.json +184 -1
  66. package/locales/ml.json +184 -1
  67. package/locales/mn.json +184 -1
  68. package/locales/mr.json +184 -1
  69. package/locales/ms.json +184 -1
  70. package/locales/my.json +184 -1
  71. package/locales/ne.json +184 -1
  72. package/locales/nl.json +184 -1
  73. package/locales/no.json +184 -1
  74. package/locales/or.json +184 -1
  75. package/locales/pa.json +184 -1
  76. package/locales/pl.json +184 -1
  77. package/locales/pt-PT.json +184 -1
  78. package/locales/pt.json +184 -1
  79. package/locales/ro.json +184 -1
  80. package/locales/ru.json +184 -1
  81. package/locales/si.json +184 -1
  82. package/locales/sk.json +184 -1
  83. package/locales/sl.json +184 -1
  84. package/locales/sq.json +184 -1
  85. package/locales/sr-Latn.json +184 -1
  86. package/locales/sr.json +184 -1
  87. package/locales/sv.json +184 -1
  88. package/locales/sw.json +184 -1
  89. package/locales/ta.json +184 -1
  90. package/locales/te.json +184 -1
  91. package/locales/th.json +184 -1
  92. package/locales/tr.json +184 -1
  93. package/locales/uk.json +184 -1
  94. package/locales/ur.json +184 -1
  95. package/locales/uz.json +184 -1
  96. package/locales/vi.json +184 -1
  97. package/locales/zh-HK.json +184 -1
  98. package/locales/zh-TW.json +184 -1
  99. package/locales/zh.json +184 -1
  100. package/locales/zu.json +184 -1
  101. package/models/cpu_profile/CPUProfileDataModel.js +10 -10
  102. package/models/cpu_profile/CPUProfileDataModel.js.map +1 -1
  103. package/models/trace/LanternComputationData.js.map +1 -1
  104. package/models/trace/ModelImpl.d.ts +1 -0
  105. package/models/trace/ModelImpl.js +1 -0
  106. package/models/trace/ModelImpl.js.map +1 -1
  107. package/models/trace/Processor.js +16 -11
  108. package/models/trace/Processor.js.map +1 -1
  109. package/models/trace/extras/FetchNodes.d.ts +1 -1
  110. package/models/trace/extras/FetchNodes.js +3 -3
  111. package/models/trace/extras/FetchNodes.js.map +1 -1
  112. package/models/trace/extras/ScriptDuplication.d.ts +34 -0
  113. package/models/trace/extras/ScriptDuplication.js +178 -0
  114. package/models/trace/extras/ScriptDuplication.js.map +1 -0
  115. package/models/trace/extras/StackTraceForEvent.js +25 -44
  116. package/models/trace/extras/StackTraceForEvent.js.map +1 -1
  117. package/models/trace/extras/ThirdParties.js +1 -0
  118. package/models/trace/extras/ThirdParties.js.map +1 -1
  119. package/models/trace/extras/TraceTree.d.ts +5 -2
  120. package/models/trace/extras/TraceTree.js +47 -17
  121. package/models/trace/extras/TraceTree.js.map +1 -1
  122. package/models/trace/extras/extras-tsconfig.json +1 -1
  123. package/models/trace/extras/extras.d.ts +1 -0
  124. package/models/trace/extras/extras.js +1 -0
  125. package/models/trace/extras/extras.js.map +1 -1
  126. package/models/trace/handlers/AnimationFramesHandler.js.map +1 -1
  127. package/models/trace/handlers/AsyncJSCallsHandler.js.map +1 -1
  128. package/models/trace/handlers/AuctionWorkletsHandler.js.map +1 -1
  129. package/models/trace/handlers/ExtensionTraceDataHandler.d.ts +1 -1
  130. package/models/trace/handlers/ExtensionTraceDataHandler.js +2 -1
  131. package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -1
  132. package/models/trace/handlers/FramesHandler.js.map +1 -1
  133. package/models/trace/handlers/ImagePaintingHandler.js +1 -1
  134. package/models/trace/handlers/ImagePaintingHandler.js.map +1 -1
  135. package/models/trace/handlers/InitiatorsHandler.js.map +1 -1
  136. package/models/trace/handlers/InvalidationsHandler.js.map +1 -1
  137. package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -1
  138. package/models/trace/handlers/MetaHandler.d.ts +2 -2
  139. package/models/trace/handlers/MetaHandler.js +4 -6
  140. package/models/trace/handlers/MetaHandler.js.map +1 -1
  141. package/models/trace/handlers/ModelHandlers.d.ts +1 -0
  142. package/models/trace/handlers/ModelHandlers.js +1 -0
  143. package/models/trace/handlers/ModelHandlers.js.map +1 -1
  144. package/models/trace/handlers/NetworkRequestsHandler.d.ts +9 -0
  145. package/models/trace/handlers/NetworkRequestsHandler.js +6 -6
  146. package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
  147. package/models/trace/handlers/PageLoadMetricsHandler.js +1 -1
  148. package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -1
  149. package/models/trace/handlers/RendererHandler.js +3 -4
  150. package/models/trace/handlers/RendererHandler.js.map +1 -1
  151. package/models/trace/handlers/ScriptsHandler.d.ts +22 -0
  152. package/models/trace/handlers/ScriptsHandler.js +116 -0
  153. package/models/trace/handlers/ScriptsHandler.js.map +1 -0
  154. package/models/trace/handlers/UserTimingsHandler.d.ts +5 -0
  155. package/models/trace/handlers/UserTimingsHandler.js +16 -0
  156. package/models/trace/handlers/UserTimingsHandler.js.map +1 -1
  157. package/models/trace/handlers/WorkersHandler.js.map +1 -1
  158. package/models/trace/handlers/handlers-tsconfig.json +1 -0
  159. package/models/trace/handlers/helpers.d.ts +5 -1
  160. package/models/trace/handlers/helpers.js +28 -4
  161. package/models/trace/handlers/helpers.js.map +1 -1
  162. package/models/trace/helpers/Network.d.ts +1 -0
  163. package/models/trace/helpers/Network.js +8 -3
  164. package/models/trace/helpers/Network.js.map +1 -1
  165. package/models/trace/helpers/SamplesIntegrator.d.ts +8 -1
  166. package/models/trace/helpers/SamplesIntegrator.js +42 -2
  167. package/models/trace/helpers/SamplesIntegrator.js.map +1 -1
  168. package/models/trace/helpers/Timing.js.map +1 -1
  169. package/models/trace/helpers/Trace.d.ts +7 -10
  170. package/models/trace/helpers/Trace.js +25 -10
  171. package/models/trace/helpers/Trace.js.map +1 -1
  172. package/models/trace/insights/CLSCulprits.d.ts +12 -12
  173. package/models/trace/insights/CLSCulprits.js +15 -4
  174. package/models/trace/insights/CLSCulprits.js.map +1 -1
  175. package/models/trace/insights/Common.d.ts +7 -1
  176. package/models/trace/insights/Common.js +9 -3
  177. package/models/trace/insights/Common.js.map +1 -1
  178. package/models/trace/insights/DOMSize.d.ts +8 -8
  179. package/models/trace/insights/DOMSize.js +2 -1
  180. package/models/trace/insights/DOMSize.js.map +1 -1
  181. package/models/trace/insights/DocumentLatency.d.ts +11 -11
  182. package/models/trace/insights/DocumentLatency.js +2 -1
  183. package/models/trace/insights/DocumentLatency.js.map +1 -1
  184. package/models/trace/insights/DuplicateJavaScript.d.ts +18 -0
  185. package/models/trace/insights/DuplicateJavaScript.js +49 -0
  186. package/models/trace/insights/DuplicateJavaScript.js.map +1 -0
  187. package/models/trace/insights/FontDisplay.d.ts +4 -4
  188. package/models/trace/insights/FontDisplay.js +2 -1
  189. package/models/trace/insights/FontDisplay.js.map +1 -1
  190. package/models/trace/insights/ForcedReflow.d.ts +5 -5
  191. package/models/trace/insights/ForcedReflow.js +4 -1
  192. package/models/trace/insights/ForcedReflow.js.map +1 -1
  193. package/models/trace/insights/ImageDelivery.d.ts +19 -15
  194. package/models/trace/insights/ImageDelivery.js +26 -20
  195. package/models/trace/insights/ImageDelivery.js.map +1 -1
  196. package/models/trace/insights/InteractionToNextPaint.d.ts +8 -8
  197. package/models/trace/insights/InteractionToNextPaint.js +3 -2
  198. package/models/trace/insights/InteractionToNextPaint.js.map +1 -1
  199. package/models/trace/insights/LCPDiscovery.d.ts +9 -9
  200. package/models/trace/insights/LCPDiscovery.js +6 -3
  201. package/models/trace/insights/LCPDiscovery.js.map +1 -1
  202. package/models/trace/insights/LCPPhases.d.ts +15 -10
  203. package/models/trace/insights/LCPPhases.js +11 -4
  204. package/models/trace/insights/LCPPhases.js.map +1 -1
  205. package/models/trace/insights/Models.d.ts +2 -1
  206. package/models/trace/insights/Models.js +2 -1
  207. package/models/trace/insights/Models.js.map +1 -1
  208. package/models/trace/insights/NetworkDependencyTree.d.ts +33 -0
  209. package/models/trace/insights/NetworkDependencyTree.js +141 -0
  210. package/models/trace/insights/NetworkDependencyTree.js.map +1 -0
  211. package/models/trace/insights/RenderBlocking.d.ts +5 -5
  212. package/models/trace/insights/RenderBlocking.js +2 -1
  213. package/models/trace/insights/RenderBlocking.js.map +1 -1
  214. package/models/trace/insights/SlowCSSSelector.d.ts +8 -8
  215. package/models/trace/insights/SlowCSSSelector.js +4 -2
  216. package/models/trace/insights/SlowCSSSelector.js.map +1 -1
  217. package/models/trace/insights/ThirdParties.d.ts +6 -6
  218. package/models/trace/insights/ThirdParties.js +8 -5
  219. package/models/trace/insights/ThirdParties.js.map +1 -1
  220. package/models/trace/insights/Viewport.d.ts +2 -2
  221. package/models/trace/insights/Viewport.js +2 -1
  222. package/models/trace/insights/Viewport.js.map +1 -1
  223. package/models/trace/insights/insights-tsconfig.json +2 -1
  224. package/models/trace/insights/types.d.ts +25 -3
  225. package/models/trace/insights/types.js.map +1 -1
  226. package/models/trace/lantern/core/NetworkAnalyzer.d.ts +2 -2
  227. package/models/trace/lantern/core/NetworkAnalyzer.js +2 -2
  228. package/models/trace/lantern/core/NetworkAnalyzer.js.map +1 -1
  229. package/models/trace/lantern/graph/BaseNode.d.ts +1 -1
  230. package/models/trace/lantern/graph/BaseNode.js.map +1 -1
  231. package/models/trace/lantern/graph/CPUNode.js +1 -1
  232. package/models/trace/lantern/graph/CPUNode.js.map +1 -1
  233. package/models/trace/lantern/graph/NetworkNode.js +1 -1
  234. package/models/trace/lantern/graph/NetworkNode.js.map +1 -1
  235. package/models/trace/lantern/graph/PageDependencyGraph.d.ts +2 -2
  236. package/models/trace/lantern/graph/PageDependencyGraph.js.map +1 -1
  237. package/models/trace/lantern/metrics/Metric.js.map +1 -1
  238. package/models/trace/lantern/metrics/TotalBlockingTime.d.ts +2 -2
  239. package/models/trace/lantern/metrics/TotalBlockingTime.js.map +1 -1
  240. package/models/trace/lantern/types/Lantern.d.ts +2 -2
  241. package/models/trace/lantern/types/Lantern.js.map +1 -1
  242. package/models/trace/trace-tsconfig.json +3 -3
  243. package/models/trace/trace.d.ts +1 -2
  244. package/models/trace/trace.js +1 -2
  245. package/models/trace/trace.js.map +1 -1
  246. package/models/trace/types/Configuration.d.ts +10 -0
  247. package/models/trace/types/Configuration.js.map +1 -1
  248. package/models/trace/types/Extensions.d.ts +1 -1
  249. package/models/trace/types/Extensions.js.map +1 -1
  250. package/models/trace/types/TraceEvents.d.ts +87 -4
  251. package/models/trace/types/TraceEvents.js +20 -0
  252. package/models/trace/types/TraceEvents.js.map +1 -1
  253. package/package.json +1 -1
  254. package/test/test-trace-engine.mjs +3 -2
  255. package/models/trace/extras/TimelineJSProfile.d.ts +0 -13
  256. package/models/trace/extras/TimelineJSProfile.js +0 -60
  257. package/models/trace/extras/TimelineJSProfile.js.map +0 -1
  258. package/models/trace/insights/LongCriticalNetworkTree.d.ts +0 -22
  259. package/models/trace/insights/LongCriticalNetworkTree.js +0 -40
  260. package/models/trace/insights/LongCriticalNetworkTree.js.map +0 -1
  261. package/models/trace/root-causes/LayoutShift.d.ts +0 -125
  262. package/models/trace/root-causes/LayoutShift.js +0 -519
  263. package/models/trace/root-causes/LayoutShift.js.map +0 -1
  264. package/models/trace/root-causes/RootCauses.d.ts +0 -15
  265. package/models/trace/root-causes/RootCauses.js +0 -12
  266. package/models/trace/root-causes/RootCauses.js.map +0 -1
  267. package/models/trace/root-causes/bundle-tsconfig.json +0 -1
  268. package/models/trace/root-causes/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -43
  269. package/models/trace/root-causes/root-causes-tsconfig.json +0 -56
  270. package/models/trace/root-causes/root-causes.d.ts +0 -1
  271. package/models/trace/root-causes/root-causes.js +0 -5
  272. package/models/trace/root-causes/root-causes.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PageDependencyGraph.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/graph/PageDependencyGraph.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAIxC,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE7C,oEAAoE;AACpE,MAAM,yBAAyB,GAAG,SAAS,CAAC;AAC5C,2HAA2H;AAC3H,MAAM,2BAA2B,GAAG,+BAA+B,CAAC;AACpE,sEAAsE;AACtE,MAAM,2BAA2B,GAAG,8BAA8B,CAAC;AACnE,kBAAkB;AAClB,MAAM,2BAA2B,GAAG,4CAA4C,CAAC;AASjF,8DAA8D;AAC9D,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAExC,6FAA6F;AAC7F,gFAAgF;AAChF,MAAM,wBAAwB,GAAG,QAAQ,CAAC;AAE1C,MAAM,mBAAmB;IACvB,MAAM,CAAC,oBAAoB,CAAC,OAA+B;QACzD,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YACvB,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,IAAI,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;YAC1B,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACjC,CAAC;QACD,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACxC,8FAA8F;YAC9F,sGAAsG;YACtG,wDAAwD;YACxD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;YACrC,IAAI,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC;YACpC,OAAO,KAAK,EAAE,CAAC;gBACb,MAAM,UAAU,GAA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AAC,QAAQ,CAAC,GAAG,EAAE,iBAAiB,CAAC,EAAE,KAAK,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,OAAO,EAAC,mBAAmB,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 * as Core from '../core/core.js';\nimport type * as Lantern from '../types/types.js';\n\nimport type {Node} from './BaseNode.js';\nimport {CPUNode} from './CPUNode.js';\nimport {NetworkNode} from './NetworkNode.js';\n\n// COMPAT: m71+ We added RunTask to `disabled-by-default-lighthouse`\nconst SCHEDULABLE_TASK_TITLE_LH = 'RunTask';\n// m69-70 DoWork is different and we now need RunTask, see https://bugs.chromium.org/p/chromium/issues/detail?id=871204#c11\nconst SCHEDULABLE_TASK_TITLE_ALT1 = 'ThreadControllerImpl::RunTask';\n// In m66-68 refactored to this task title, https://crrev.com/c/883346\nconst SCHEDULABLE_TASK_TITLE_ALT2 = 'ThreadControllerImpl::DoWork';\n// m65 and earlier\nconst SCHEDULABLE_TASK_TITLE_ALT3 = 'TaskQueueManager::ProcessTaskFromWorkQueue';\n\ninterface NetworkNodeOutput {\n nodes: Array<NetworkNode>;\n idToNodeMap: Map<string, NetworkNode>;\n urlToNodeMap: Map<string, Array<NetworkNode>>;\n frameIdToNodeMap: Map<string, NetworkNode|null>;\n}\n\n// Shorter tasks have negligible impact on simulation results.\nconst SIGNIFICANT_DUR_THRESHOLD_MS = 10;\n\n// TODO: video files tend to be enormous and throw off all graph traversals, move this ignore\n// into estimation logic when we use the dependency graph for other purposes.\nconst IGNORED_MIME_TYPES_REGEX = /^video/;\n\nclass PageDependencyGraph {\n static getNetworkInitiators(request: Lantern.NetworkRequest): string[] {\n if (!request.initiator) {\n return [];\n }\n if (request.initiator.url) {\n return [request.initiator.url];\n }\n if (request.initiator.type === 'script') {\n // Script initiators have the stack of callFrames from all functions that led to this request.\n // If async stacks are enabled, then the stack will also have the parent functions that asynchronously\n // led to this request chained in the `parent` property.\n const scriptURLs = new Set<string>();\n let stack = request.initiator.stack;\n while (stack) {\n const callFrames = stack.callFrames || [];\n for (const frame of callFrames) {\n if (frame.url) {\n scriptURLs.add(frame.url);\n }\n }\n\n stack = stack.parent;\n }\n\n return Array.from(scriptURLs);\n }\n\n return [];\n }\n\n static getNetworkNodeOutput(networkRequests: Lantern.NetworkRequest[]): NetworkNodeOutput {\n const nodes: Array<NetworkNode> = [];\n const idToNodeMap = new Map<string, NetworkNode>();\n const urlToNodeMap = new Map<string, Array<NetworkNode>>();\n const frameIdToNodeMap = new Map<string, NetworkNode|null>();\n\n networkRequests.forEach(request => {\n if (IGNORED_MIME_TYPES_REGEX.test(request.mimeType)) {\n return;\n }\n if (request.fromWorker) {\n return;\n }\n\n // Network requestIds can be duplicated for an unknown reason\n // Suffix all subsequent requests with `:duplicate` until it's unique\n // NOTE: This should never happen with modern NetworkRequest library, but old fixtures\n // might still have this issue.\n while (idToNodeMap.has(request.requestId)) {\n request.requestId += ':duplicate';\n }\n\n const node = new NetworkNode(request);\n nodes.push(node);\n\n const urlList = urlToNodeMap.get(request.url) || [];\n urlList.push(node);\n\n idToNodeMap.set(request.requestId, node);\n urlToNodeMap.set(request.url, urlList);\n\n // If the request was for the root document of an iframe, save an entry in our\n // map so we can link up the task `args.data.frame` dependencies later in graph creation.\n if (request.frameId && request.resourceType === 'Document' && request.documentURL === request.url) {\n // If there's ever any ambiguity, permanently set the value to `false` to avoid loops in the graph.\n const value = frameIdToNodeMap.has(request.frameId) ? null : node;\n frameIdToNodeMap.set(request.frameId, value);\n }\n });\n\n return {nodes, idToNodeMap, urlToNodeMap, frameIdToNodeMap};\n }\n\n static isScheduleableTask(evt: Lantern.TraceEvent): boolean {\n return evt.name === SCHEDULABLE_TASK_TITLE_LH || evt.name === SCHEDULABLE_TASK_TITLE_ALT1 ||\n evt.name === SCHEDULABLE_TASK_TITLE_ALT2 || evt.name === SCHEDULABLE_TASK_TITLE_ALT3;\n }\n\n /**\n * There should *always* be at least one top level event, having 0 typically means something is\n * drastically wrong with the trace and we should just give up early and loudly.\n */\n static assertHasToplevelEvents(events: Lantern.TraceEvent[]): void {\n const hasToplevelTask = events.some(this.isScheduleableTask);\n if (!hasToplevelTask) {\n throw new Core.LanternError('Could not find any top level events');\n }\n }\n\n static getCPUNodes(mainThreadEvents: Lantern.TraceEvent[]): CPUNode[] {\n const nodes: CPUNode[] = [];\n let i = 0;\n\n PageDependencyGraph.assertHasToplevelEvents(mainThreadEvents);\n\n while (i < mainThreadEvents.length) {\n const evt = mainThreadEvents[i];\n i++;\n\n // Skip all trace events that aren't schedulable tasks with sizable duration\n if (!PageDependencyGraph.isScheduleableTask(evt) || !evt.dur) {\n continue;\n }\n\n let correctedEndTs: number|undefined = undefined;\n\n // Capture all events that occurred within the task\n const children: Lantern.TraceEvent[] = [];\n for (const endTime = evt.ts + evt.dur; i < mainThreadEvents.length && mainThreadEvents[i].ts < endTime; i++) {\n const event = mainThreadEvents[i];\n\n // Temporary fix for a Chrome bug where some RunTask events can be overlapping.\n // We correct that here be ensuring each RunTask ends at least 1 microsecond before the next\n // https://github.com/GoogleChrome/lighthouse/issues/15896\n // https://issues.chromium.org/issues/329678173\n if (PageDependencyGraph.isScheduleableTask(event) && event.dur) {\n correctedEndTs = event.ts - 1;\n break;\n }\n\n children.push(event);\n }\n\n nodes.push(new CPUNode(evt, children, correctedEndTs));\n }\n\n return nodes;\n }\n\n static linkNetworkNodes(rootNode: NetworkNode, networkNodeOutput: NetworkNodeOutput): void {\n networkNodeOutput.nodes.forEach(node => {\n const directInitiatorRequest = node.request.initiatorRequest || rootNode.request;\n const directInitiatorNode = networkNodeOutput.idToNodeMap.get(directInitiatorRequest.requestId) || rootNode;\n const canDependOnInitiator = !directInitiatorNode.isDependentOn(node) && node.canDependOn(directInitiatorNode);\n const initiators = PageDependencyGraph.getNetworkInitiators(node.request);\n if (initiators.length) {\n initiators.forEach(initiator => {\n const parentCandidates = networkNodeOutput.urlToNodeMap.get(initiator) || [];\n // Only add the edge if the parent is unambiguous with valid timing and isn't circular.\n if (parentCandidates.length === 1 && parentCandidates[0].startTime <= node.startTime &&\n !parentCandidates[0].isDependentOn(node)) {\n node.addDependency(parentCandidates[0]);\n } else if (canDependOnInitiator) {\n directInitiatorNode.addDependent(node);\n }\n });\n } else if (canDependOnInitiator) {\n directInitiatorNode.addDependent(node);\n }\n\n // Make sure the nodes are attached to the graph if the initiator information was invalid.\n if (node !== rootNode && node.getDependencies().length === 0 && node.canDependOn(rootNode)) {\n node.addDependency(rootNode);\n }\n\n if (!node.request.redirects) {\n return;\n }\n\n const redirects = [...node.request.redirects, node.request];\n for (let i = 1; i < redirects.length; i++) {\n const redirectNode = networkNodeOutput.idToNodeMap.get(redirects[i - 1].requestId);\n const actualNode = networkNodeOutput.idToNodeMap.get(redirects[i].requestId);\n if (actualNode && redirectNode) {\n actualNode.addDependency(redirectNode);\n }\n }\n });\n }\n\n static linkCPUNodes(rootNode: Node, networkNodeOutput: NetworkNodeOutput, cpuNodes: CPUNode[]): void {\n const linkableResourceTypes = new Set<Lantern.ResourceType|undefined>([\n 'XHR',\n 'Fetch',\n 'Script',\n ]);\n\n function addDependentNetworkRequest(cpuNode: CPUNode, reqId: string): void {\n const networkNode = networkNodeOutput.idToNodeMap.get(reqId);\n if (!networkNode ||\n // Ignore all network nodes that started before this CPU task started\n // A network request that started earlier could not possibly have been started by this task\n networkNode.startTime <= cpuNode.startTime) {\n return;\n }\n const {request} = networkNode;\n const resourceType = request.resourceType || request.redirectDestination?.resourceType;\n if (!linkableResourceTypes.has(resourceType)) {\n // We only link some resources to CPU nodes because we observe LCP simulation\n // regressions when including images, etc.\n return;\n }\n cpuNode.addDependent(networkNode);\n }\n\n /**\n * If the node has an associated frameId, then create a dependency on the root document request\n * for the frame. The task obviously couldn't have started before the frame was even downloaded.\n */\n function addDependencyOnFrame(cpuNode: CPUNode, frameId: string|undefined): void {\n if (!frameId) {\n return;\n }\n const networkNode = networkNodeOutput.frameIdToNodeMap.get(frameId);\n if (!networkNode) {\n return;\n }\n // Ignore all network nodes that started after this CPU task started\n // A network request that started after could not possibly be required this task\n if (networkNode.startTime >= cpuNode.startTime) {\n return;\n }\n cpuNode.addDependency(networkNode);\n }\n\n function addDependencyOnUrl(cpuNode: CPUNode, url: string): void {\n if (!url) {\n return;\n }\n // Allow network requests that end up to 100ms before the task started\n // Some script evaluations can start before the script finishes downloading\n const minimumAllowableTimeSinceNetworkNodeEnd = -100 * 1000;\n const candidates = networkNodeOutput.urlToNodeMap.get(url) || [];\n\n let minCandidate = null;\n let minDistance = Infinity;\n // Find the closest request that finished before this CPU task started\n for (const candidate of candidates) {\n // Explicitly ignore all requests that started after this CPU node\n // A network request that started after this task started cannot possibly be a dependency\n if (cpuNode.startTime <= candidate.startTime) {\n return;\n }\n\n const distance = cpuNode.startTime - candidate.endTime;\n if (distance >= minimumAllowableTimeSinceNetworkNodeEnd && distance < minDistance) {\n minCandidate = candidate;\n minDistance = distance;\n }\n }\n\n if (!minCandidate) {\n return;\n }\n cpuNode.addDependency(minCandidate);\n }\n\n const timers = new Map<string, CPUNode>();\n for (const node of cpuNodes) {\n for (const evt of node.childEvents) {\n if (!evt.args.data) {\n continue;\n }\n\n const argsUrl = evt.args.data.url;\n const stackTraceUrls = (evt.args.data.stackTrace || []).map(l => l.url).filter(Boolean);\n\n switch (evt.name) {\n case 'TimerInstall':\n // @ts-expect-error - 'TimerInstall' event means timerId exists.\n timers.set(evt.args.data.timerId, node);\n stackTraceUrls.forEach(url => addDependencyOnUrl(node, url));\n break;\n case 'TimerFire': {\n // @ts-expect-error - 'TimerFire' event means timerId exists.\n const installer = timers.get(evt.args.data.timerId);\n if (!installer || installer.endTime > node.startTime) {\n break;\n }\n installer.addDependent(node);\n break;\n }\n\n case 'InvalidateLayout':\n case 'ScheduleStyleRecalculation':\n addDependencyOnFrame(node, evt.args.data.frame);\n stackTraceUrls.forEach(url => addDependencyOnUrl(node, url));\n break;\n\n case 'EvaluateScript':\n addDependencyOnFrame(node, evt.args.data.frame);\n // @ts-expect-error - 'EvaluateScript' event means argsUrl is defined.\n addDependencyOnUrl(node, argsUrl);\n stackTraceUrls.forEach(url => addDependencyOnUrl(node, url));\n break;\n\n case 'XHRReadyStateChange':\n // Only create the dependency if the request was completed\n // 'XHRReadyStateChange' event means readyState is defined.\n if (evt.args.data.readyState !== 4) {\n break;\n }\n\n // @ts-expect-error - 'XHRReadyStateChange' event means argsUrl is defined.\n addDependencyOnUrl(node, argsUrl);\n stackTraceUrls.forEach(url => addDependencyOnUrl(node, url));\n break;\n\n case 'FunctionCall':\n case 'v8.compile':\n addDependencyOnFrame(node, evt.args.data.frame);\n // @ts-expect-error - events mean argsUrl is defined.\n addDependencyOnUrl(node, argsUrl);\n break;\n\n case 'ParseAuthorStyleSheet':\n addDependencyOnFrame(node, evt.args.data.frame);\n // @ts-expect-error - 'ParseAuthorStyleSheet' event means styleSheetUrl is defined.\n addDependencyOnUrl(node, evt.args.data.styleSheetUrl);\n break;\n\n case 'ResourceSendRequest':\n addDependencyOnFrame(node, evt.args.data.frame);\n // @ts-expect-error - 'ResourceSendRequest' event means requestId is defined.\n addDependentNetworkRequest(node, evt.args.data.requestId);\n stackTraceUrls.forEach(url => addDependencyOnUrl(node, url));\n break;\n }\n }\n\n // Nodes starting before the root node cannot depend on it.\n if (node.getNumberOfDependencies() === 0 && node.canDependOn(rootNode)) {\n node.addDependency(rootNode);\n }\n }\n\n // Second pass to prune the graph of short tasks.\n const minimumEvtDur = SIGNIFICANT_DUR_THRESHOLD_MS * 1000;\n let foundFirstLayout = false;\n let foundFirstPaint = false;\n let foundFirstParse = false;\n\n for (const node of cpuNodes) {\n // Don't prune if event is the first ParseHTML/Layout/Paint.\n // See https://github.com/GoogleChrome/lighthouse/issues/9627#issuecomment-526699524 for more.\n let isFirst = false;\n if (!foundFirstLayout && node.childEvents.some(evt => evt.name === 'Layout')) {\n isFirst = foundFirstLayout = true;\n }\n if (!foundFirstPaint && node.childEvents.some(evt => evt.name === 'Paint')) {\n isFirst = foundFirstPaint = true;\n }\n if (!foundFirstParse && node.childEvents.some(evt => evt.name === 'ParseHTML')) {\n isFirst = foundFirstParse = true;\n }\n\n if (isFirst || node.duration >= minimumEvtDur) {\n // Don't prune this node. The task is long / important so it will impact simulation.\n continue;\n }\n\n // Prune the node if it isn't highly connected to minimize graph size. Rewiring the graph\n // here replaces O(M + N) edges with (M * N) edges, which is fine if either M or N is at\n // most 1.\n if (node.getNumberOfDependencies() === 1 || node.getNumberOfDependents() <= 1) {\n PageDependencyGraph.pruneNode(node);\n }\n }\n }\n\n /**\n * Removes the given node from the graph, but retains all paths between its dependencies and\n * dependents.\n */\n static pruneNode(node: Node): void {\n const dependencies = node.getDependencies();\n const dependents = node.getDependents();\n for (const dependency of dependencies) {\n node.removeDependency(dependency);\n for (const dependent of dependents) {\n dependency.addDependent(dependent);\n }\n }\n for (const dependent of dependents) {\n node.removeDependent(dependent);\n }\n }\n\n /**\n * TODO: remove when CDT backend in Lighthouse is gone. Until then, this is a useful debugging tool\n * to find delta between using CDP or the trace to create the network requests.\n *\n * When a test fails using the trace backend, I enabled this debug method and copied the network\n * requests when CDP was used, then when trace is used, and diff'd them. This method helped\n * remove non-logical differences from the comparison (order of properties, slight rounding\n * discrepancies, removing object cycles, etc).\n *\n * When using for a unit test, make sure to do `.only` so you are getting what you expect.\n */\n static debugNormalizeRequests(lanternRequests: Lantern.NetworkRequest[]): void {\n for (const request of lanternRequests) {\n request.rendererStartTime = Math.round(request.rendererStartTime * 1000) / 1000;\n request.networkRequestTime = Math.round(request.networkRequestTime * 1000) / 1000;\n request.responseHeadersEndTime = Math.round(request.responseHeadersEndTime * 1000) / 1000;\n request.networkEndTime = Math.round(request.networkEndTime * 1000) / 1000;\n }\n\n for (const r of lanternRequests) {\n delete r.rawRequest;\n if (r.initiatorRequest) {\n // @ts-expect-error\n r.initiatorRequest = {id: r.initiatorRequest.requestId};\n }\n if (r.redirectDestination) {\n // @ts-expect-error\n r.redirectDestination = {id: r.redirectDestination.requestId};\n }\n if (r.redirectSource) {\n // @ts-expect-error\n r.redirectSource = {id: r.redirectSource.requestId};\n }\n if (r.redirects) {\n // @ts-expect-error\n r.redirects = r.redirects.map(r2 => r2.requestId);\n }\n }\n const requests: Lantern.NetworkRequest[] = lanternRequests\n .map(r => ({\n requestId: r.requestId,\n connectionId: r.connectionId,\n connectionReused: r.connectionReused,\n url: r.url,\n protocol: r.protocol,\n parsedURL: r.parsedURL,\n documentURL: r.documentURL,\n rendererStartTime: r.rendererStartTime,\n networkRequestTime: r.networkRequestTime,\n responseHeadersEndTime: r.responseHeadersEndTime,\n networkEndTime: r.networkEndTime,\n transferSize: r.transferSize,\n resourceSize: r.resourceSize,\n fromDiskCache: r.fromDiskCache,\n fromMemoryCache: r.fromMemoryCache,\n finished: r.finished,\n statusCode: r.statusCode,\n redirectSource: r.redirectSource,\n redirectDestination: r.redirectDestination,\n redirects: r.redirects,\n failed: r.failed,\n initiator: r.initiator,\n timing: r.timing ? {\n requestTime: r.timing.requestTime,\n proxyStart: r.timing.proxyStart,\n proxyEnd: r.timing.proxyEnd,\n dnsStart: r.timing.dnsStart,\n dnsEnd: r.timing.dnsEnd,\n connectStart: r.timing.connectStart,\n connectEnd: r.timing.connectEnd,\n sslStart: r.timing.sslStart,\n sslEnd: r.timing.sslEnd,\n workerStart: r.timing.workerStart,\n workerReady: r.timing.workerReady,\n workerFetchStart: r.timing.workerFetchStart,\n workerRespondWithSettled: r.timing.workerRespondWithSettled,\n sendStart: r.timing.sendStart,\n sendEnd: r.timing.sendEnd,\n pushStart: r.timing.pushStart,\n pushEnd: r.timing.pushEnd,\n receiveHeadersStart: r.timing.receiveHeadersStart,\n receiveHeadersEnd: r.timing.receiveHeadersEnd,\n } :\n r.timing,\n resourceType: r.resourceType,\n mimeType: r.mimeType,\n priority: r.priority,\n initiatorRequest: r.initiatorRequest,\n frameId: r.frameId,\n fromWorker: r.fromWorker,\n isLinkPreload: r.isLinkPreload,\n serverResponseTime: r.serverResponseTime,\n }))\n .filter(r => !r.fromWorker);\n\n const debug = requests;\n // Set breakpoint here.\n // Copy `debug` and compare with https://www.diffchecker.com/text-compare/\n // eslint-disable-next-line no-console\n console.log(debug);\n }\n\n static createGraph(\n mainThreadEvents: Lantern.TraceEvent[], networkRequests: Lantern.NetworkRequest[],\n url: Lantern.Simulation.URL): Node {\n // This is for debugging trace/devtoolslog network records.\n // const debug = PageDependencyGraph.debugNormalizeRequests(networkRequests);\n const networkNodeOutput = PageDependencyGraph.getNetworkNodeOutput(networkRequests);\n const cpuNodes = PageDependencyGraph.getCPUNodes(mainThreadEvents);\n const {requestedUrl, mainDocumentUrl} = url;\n if (!requestedUrl) {\n throw new Core.LanternError('requestedUrl is required to get the root request');\n }\n if (!mainDocumentUrl) {\n throw new Core.LanternError('mainDocumentUrl is required to get the main resource');\n }\n\n const rootRequest = Core.NetworkAnalyzer.findResourceForUrl(networkRequests, requestedUrl);\n if (!rootRequest) {\n throw new Core.LanternError('rootRequest not found');\n }\n const rootNode = networkNodeOutput.idToNodeMap.get(rootRequest.requestId);\n if (!rootNode) {\n throw new Core.LanternError('rootNode not found');\n }\n const mainDocumentRequest = Core.NetworkAnalyzer.findLastDocumentForUrl(networkRequests, mainDocumentUrl);\n if (!mainDocumentRequest) {\n throw new Core.LanternError('mainDocumentRequest not found');\n }\n const mainDocumentNode = networkNodeOutput.idToNodeMap.get(mainDocumentRequest.requestId);\n if (!mainDocumentNode) {\n throw new Core.LanternError('mainDocumentNode not found');\n }\n\n PageDependencyGraph.linkNetworkNodes(rootNode, networkNodeOutput);\n PageDependencyGraph.linkCPUNodes(rootNode, networkNodeOutput, cpuNodes);\n mainDocumentNode.setIsMainDocument(true);\n\n if (NetworkNode.hasCycle(rootNode)) {\n throw new Core.LanternError('Invalid dependency graph created, cycle detected');\n }\n\n return rootNode;\n }\n\n // Unused, but useful for debugging.\n static printGraph(rootNode: Node, widthInCharacters = 100): void {\n function padRight(str: string, target: number, padChar = ' '): string {\n return str + padChar.repeat(Math.max(target - str.length, 0));\n }\n\n const nodes: Node[] = [];\n rootNode.traverse(node => nodes.push(node));\n nodes.sort((a, b) => a.startTime - b.startTime);\n\n const min = nodes[0].startTime;\n const max = nodes.reduce((max, node) => Math.max(max, node.endTime), 0);\n\n const totalTime = max - min;\n const timePerCharacter = totalTime / widthInCharacters;\n nodes.forEach(node => {\n const offset = Math.round((node.startTime - min) / timePerCharacter);\n const length = Math.ceil((node.endTime - node.startTime) / timePerCharacter);\n const bar = padRight('', offset) + padRight('', length, '=');\n\n // @ts-expect-error -- disambiguate displayName from across possible Node types.\n const displayName = node.request ? node.request.url : node.type;\n // eslint-disable-next-line\n console.log(padRight(bar, widthInCharacters), `| ${displayName.slice(0, 30)}`);\n });\n }\n}\n\nexport {PageDependencyGraph};\n"]}
1
+ {"version":3,"file":"PageDependencyGraph.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/graph/PageDependencyGraph.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAIxC,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE7C,oEAAoE;AACpE,MAAM,yBAAyB,GAAG,SAAS,CAAC;AAC5C,2HAA2H;AAC3H,MAAM,2BAA2B,GAAG,+BAA+B,CAAC;AACpE,sEAAsE;AACtE,MAAM,2BAA2B,GAAG,8BAA8B,CAAC;AACnE,kBAAkB;AAClB,MAAM,2BAA2B,GAAG,4CAA4C,CAAC;AASjF,8DAA8D;AAC9D,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAExC,6FAA6F;AAC7F,gFAAgF;AAChF,MAAM,wBAAwB,GAAG,QAAQ,CAAC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M,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,gBAAgB,CAAC,CAAC;YACrE,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,gBAAgB,CAAC,CAAC;YAC7E,MAAM,GAAG,GAAG,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;YAE7D,gFAAgF;YAChF,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAChE,2BAA2B;YAC3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,iBAAiB,CAAC,EAAE,KAAK,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,OAAO,EAAC,mBAAmB,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 * as Core from '../core/core.js';\nimport type * as Lantern from '../types/types.js';\n\nimport type {Node} from './BaseNode.js';\nimport {CPUNode} from './CPUNode.js';\nimport {NetworkNode} from './NetworkNode.js';\n\n// COMPAT: m71+ We added RunTask to `disabled-by-default-lighthouse`\nconst SCHEDULABLE_TASK_TITLE_LH = 'RunTask';\n// m69-70 DoWork is different and we now need RunTask, see https://bugs.chromium.org/p/chromium/issues/detail?id=871204#c11\nconst SCHEDULABLE_TASK_TITLE_ALT1 = 'ThreadControllerImpl::RunTask';\n// In m66-68 refactored to this task title, https://crrev.com/c/883346\nconst SCHEDULABLE_TASK_TITLE_ALT2 = 'ThreadControllerImpl::DoWork';\n// m65 and earlier\nconst SCHEDULABLE_TASK_TITLE_ALT3 = 'TaskQueueManager::ProcessTaskFromWorkQueue';\n\ninterface NetworkNodeOutput {\n nodes: NetworkNode[];\n idToNodeMap: Map<string, NetworkNode>;\n urlToNodeMap: Map<string, NetworkNode[]>;\n frameIdToNodeMap: Map<string, NetworkNode|null>;\n}\n\n// Shorter tasks have negligible impact on simulation results.\nconst SIGNIFICANT_DUR_THRESHOLD_MS = 10;\n\n// TODO: video files tend to be enormous and throw off all graph traversals, move this ignore\n// into estimation logic when we use the dependency graph for other purposes.\nconst IGNORED_MIME_TYPES_REGEX = /^video/;\n\nclass PageDependencyGraph {\n static getNetworkInitiators(request: Lantern.NetworkRequest): string[] {\n if (!request.initiator) {\n return [];\n }\n if (request.initiator.url) {\n return [request.initiator.url];\n }\n if (request.initiator.type === 'script') {\n // Script initiators have the stack of callFrames from all functions that led to this request.\n // If async stacks are enabled, then the stack will also have the parent functions that asynchronously\n // led to this request chained in the `parent` property.\n const scriptURLs = new Set<string>();\n let stack = request.initiator.stack;\n while (stack) {\n const callFrames = stack.callFrames || [];\n for (const frame of callFrames) {\n if (frame.url) {\n scriptURLs.add(frame.url);\n }\n }\n\n stack = stack.parent;\n }\n\n return Array.from(scriptURLs);\n }\n\n return [];\n }\n\n static getNetworkNodeOutput(networkRequests: Lantern.NetworkRequest[]): NetworkNodeOutput {\n const nodes: NetworkNode[] = [];\n const idToNodeMap = new Map<string, NetworkNode>();\n const urlToNodeMap = new Map<string, NetworkNode[]>();\n const frameIdToNodeMap = new Map<string, NetworkNode|null>();\n\n networkRequests.forEach(request => {\n if (IGNORED_MIME_TYPES_REGEX.test(request.mimeType)) {\n return;\n }\n if (request.fromWorker) {\n return;\n }\n\n // Network requestIds can be duplicated for an unknown reason\n // Suffix all subsequent requests with `:duplicate` until it's unique\n // NOTE: This should never happen with modern NetworkRequest library, but old fixtures\n // might still have this issue.\n while (idToNodeMap.has(request.requestId)) {\n request.requestId += ':duplicate';\n }\n\n const node = new NetworkNode(request);\n nodes.push(node);\n\n const urlList = urlToNodeMap.get(request.url) || [];\n urlList.push(node);\n\n idToNodeMap.set(request.requestId, node);\n urlToNodeMap.set(request.url, urlList);\n\n // If the request was for the root document of an iframe, save an entry in our\n // map so we can link up the task `args.data.frame` dependencies later in graph creation.\n if (request.frameId && request.resourceType === 'Document' && request.documentURL === request.url) {\n // If there's ever any ambiguity, permanently set the value to `false` to avoid loops in the graph.\n const value = frameIdToNodeMap.has(request.frameId) ? null : node;\n frameIdToNodeMap.set(request.frameId, value);\n }\n });\n\n return {nodes, idToNodeMap, urlToNodeMap, frameIdToNodeMap};\n }\n\n static isScheduleableTask(evt: Lantern.TraceEvent): boolean {\n return evt.name === SCHEDULABLE_TASK_TITLE_LH || evt.name === SCHEDULABLE_TASK_TITLE_ALT1 ||\n evt.name === SCHEDULABLE_TASK_TITLE_ALT2 || evt.name === SCHEDULABLE_TASK_TITLE_ALT3;\n }\n\n /**\n * There should *always* be at least one top level event, having 0 typically means something is\n * drastically wrong with the trace and we should just give up early and loudly.\n */\n static assertHasToplevelEvents(events: Lantern.TraceEvent[]): void {\n const hasToplevelTask = events.some(this.isScheduleableTask);\n if (!hasToplevelTask) {\n throw new Core.LanternError('Could not find any top level events');\n }\n }\n\n static getCPUNodes(mainThreadEvents: Lantern.TraceEvent[]): CPUNode[] {\n const nodes: CPUNode[] = [];\n let i = 0;\n\n PageDependencyGraph.assertHasToplevelEvents(mainThreadEvents);\n\n while (i < mainThreadEvents.length) {\n const evt = mainThreadEvents[i];\n i++;\n\n // Skip all trace events that aren't schedulable tasks with sizable duration\n if (!PageDependencyGraph.isScheduleableTask(evt) || !evt.dur) {\n continue;\n }\n\n let correctedEndTs: number|undefined = undefined;\n\n // Capture all events that occurred within the task\n const children: Lantern.TraceEvent[] = [];\n for (const endTime = evt.ts + evt.dur; i < mainThreadEvents.length && mainThreadEvents[i].ts < endTime; i++) {\n const event = mainThreadEvents[i];\n\n // Temporary fix for a Chrome bug where some RunTask events can be overlapping.\n // We correct that here be ensuring each RunTask ends at least 1 microsecond before the next\n // https://github.com/GoogleChrome/lighthouse/issues/15896\n // https://issues.chromium.org/issues/329678173\n if (PageDependencyGraph.isScheduleableTask(event) && event.dur) {\n correctedEndTs = event.ts - 1;\n break;\n }\n\n children.push(event);\n }\n\n nodes.push(new CPUNode(evt, children, correctedEndTs));\n }\n\n return nodes;\n }\n\n static linkNetworkNodes(rootNode: NetworkNode, networkNodeOutput: NetworkNodeOutput): void {\n networkNodeOutput.nodes.forEach(node => {\n const directInitiatorRequest = node.request.initiatorRequest || rootNode.request;\n const directInitiatorNode = networkNodeOutput.idToNodeMap.get(directInitiatorRequest.requestId) || rootNode;\n const canDependOnInitiator = !directInitiatorNode.isDependentOn(node) && node.canDependOn(directInitiatorNode);\n const initiators = PageDependencyGraph.getNetworkInitiators(node.request);\n if (initiators.length) {\n initiators.forEach(initiator => {\n const parentCandidates = networkNodeOutput.urlToNodeMap.get(initiator) || [];\n // Only add the edge if the parent is unambiguous with valid timing and isn't circular.\n if (parentCandidates.length === 1 && parentCandidates[0].startTime <= node.startTime &&\n !parentCandidates[0].isDependentOn(node)) {\n node.addDependency(parentCandidates[0]);\n } else if (canDependOnInitiator) {\n directInitiatorNode.addDependent(node);\n }\n });\n } else if (canDependOnInitiator) {\n directInitiatorNode.addDependent(node);\n }\n\n // Make sure the nodes are attached to the graph if the initiator information was invalid.\n if (node !== rootNode && node.getDependencies().length === 0 && node.canDependOn(rootNode)) {\n node.addDependency(rootNode);\n }\n\n if (!node.request.redirects) {\n return;\n }\n\n const redirects = [...node.request.redirects, node.request];\n for (let i = 1; i < redirects.length; i++) {\n const redirectNode = networkNodeOutput.idToNodeMap.get(redirects[i - 1].requestId);\n const actualNode = networkNodeOutput.idToNodeMap.get(redirects[i].requestId);\n if (actualNode && redirectNode) {\n actualNode.addDependency(redirectNode);\n }\n }\n });\n }\n\n static linkCPUNodes(rootNode: Node, networkNodeOutput: NetworkNodeOutput, cpuNodes: CPUNode[]): void {\n const linkableResourceTypes = new Set<Lantern.ResourceType|undefined>([\n 'XHR',\n 'Fetch',\n 'Script',\n ]);\n\n function addDependentNetworkRequest(cpuNode: CPUNode, reqId: string): void {\n const networkNode = networkNodeOutput.idToNodeMap.get(reqId);\n if (!networkNode ||\n // Ignore all network nodes that started before this CPU task started\n // A network request that started earlier could not possibly have been started by this task\n networkNode.startTime <= cpuNode.startTime) {\n return;\n }\n const {request} = networkNode;\n const resourceType = request.resourceType || request.redirectDestination?.resourceType;\n if (!linkableResourceTypes.has(resourceType)) {\n // We only link some resources to CPU nodes because we observe LCP simulation\n // regressions when including images, etc.\n return;\n }\n cpuNode.addDependent(networkNode);\n }\n\n /**\n * If the node has an associated frameId, then create a dependency on the root document request\n * for the frame. The task obviously couldn't have started before the frame was even downloaded.\n */\n function addDependencyOnFrame(cpuNode: CPUNode, frameId: string|undefined): void {\n if (!frameId) {\n return;\n }\n const networkNode = networkNodeOutput.frameIdToNodeMap.get(frameId);\n if (!networkNode) {\n return;\n }\n // Ignore all network nodes that started after this CPU task started\n // A network request that started after could not possibly be required this task\n if (networkNode.startTime >= cpuNode.startTime) {\n return;\n }\n cpuNode.addDependency(networkNode);\n }\n\n function addDependencyOnUrl(cpuNode: CPUNode, url: string): void {\n if (!url) {\n return;\n }\n // Allow network requests that end up to 100ms before the task started\n // Some script evaluations can start before the script finishes downloading\n const minimumAllowableTimeSinceNetworkNodeEnd = -100 * 1000;\n const candidates = networkNodeOutput.urlToNodeMap.get(url) || [];\n\n let minCandidate = null;\n let minDistance = Infinity;\n // Find the closest request that finished before this CPU task started\n for (const candidate of candidates) {\n // Explicitly ignore all requests that started after this CPU node\n // A network request that started after this task started cannot possibly be a dependency\n if (cpuNode.startTime <= candidate.startTime) {\n return;\n }\n\n const distance = cpuNode.startTime - candidate.endTime;\n if (distance >= minimumAllowableTimeSinceNetworkNodeEnd && distance < minDistance) {\n minCandidate = candidate;\n minDistance = distance;\n }\n }\n\n if (!minCandidate) {\n return;\n }\n cpuNode.addDependency(minCandidate);\n }\n\n const timers = new Map<string, CPUNode>();\n for (const node of cpuNodes) {\n for (const evt of node.childEvents) {\n if (!evt.args.data) {\n continue;\n }\n\n const argsUrl = evt.args.data.url;\n const stackTraceUrls = (evt.args.data.stackTrace || []).map(l => l.url).filter(Boolean);\n\n switch (evt.name) {\n case 'TimerInstall':\n // @ts-expect-error - 'TimerInstall' event means timerId exists.\n timers.set(evt.args.data.timerId, node);\n stackTraceUrls.forEach(url => addDependencyOnUrl(node, url));\n break;\n case 'TimerFire': {\n // @ts-expect-error - 'TimerFire' event means timerId exists.\n const installer = timers.get(evt.args.data.timerId);\n if (!installer || installer.endTime > node.startTime) {\n break;\n }\n installer.addDependent(node);\n break;\n }\n\n case 'InvalidateLayout':\n case 'ScheduleStyleRecalculation':\n addDependencyOnFrame(node, evt.args.data.frame);\n stackTraceUrls.forEach(url => addDependencyOnUrl(node, url));\n break;\n\n case 'EvaluateScript':\n addDependencyOnFrame(node, evt.args.data.frame);\n // @ts-expect-error - 'EvaluateScript' event means argsUrl is defined.\n addDependencyOnUrl(node, argsUrl);\n stackTraceUrls.forEach(url => addDependencyOnUrl(node, url));\n break;\n\n case 'XHRReadyStateChange':\n // Only create the dependency if the request was completed\n // 'XHRReadyStateChange' event means readyState is defined.\n if (evt.args.data.readyState !== 4) {\n break;\n }\n\n // @ts-expect-error - 'XHRReadyStateChange' event means argsUrl is defined.\n addDependencyOnUrl(node, argsUrl);\n stackTraceUrls.forEach(url => addDependencyOnUrl(node, url));\n break;\n\n case 'FunctionCall':\n case 'v8.compile':\n addDependencyOnFrame(node, evt.args.data.frame);\n // @ts-expect-error - events mean argsUrl is defined.\n addDependencyOnUrl(node, argsUrl);\n break;\n\n case 'ParseAuthorStyleSheet':\n addDependencyOnFrame(node, evt.args.data.frame);\n // @ts-expect-error - 'ParseAuthorStyleSheet' event means styleSheetUrl is defined.\n addDependencyOnUrl(node, evt.args.data.styleSheetUrl);\n break;\n\n case 'ResourceSendRequest':\n addDependencyOnFrame(node, evt.args.data.frame);\n // @ts-expect-error - 'ResourceSendRequest' event means requestId is defined.\n addDependentNetworkRequest(node, evt.args.data.requestId);\n stackTraceUrls.forEach(url => addDependencyOnUrl(node, url));\n break;\n }\n }\n\n // Nodes starting before the root node cannot depend on it.\n if (node.getNumberOfDependencies() === 0 && node.canDependOn(rootNode)) {\n node.addDependency(rootNode);\n }\n }\n\n // Second pass to prune the graph of short tasks.\n const minimumEvtDur = SIGNIFICANT_DUR_THRESHOLD_MS * 1000;\n let foundFirstLayout = false;\n let foundFirstPaint = false;\n let foundFirstParse = false;\n\n for (const node of cpuNodes) {\n // Don't prune if event is the first ParseHTML/Layout/Paint.\n // See https://github.com/GoogleChrome/lighthouse/issues/9627#issuecomment-526699524 for more.\n let isFirst = false;\n if (!foundFirstLayout && node.childEvents.some(evt => evt.name === 'Layout')) {\n isFirst = foundFirstLayout = true;\n }\n if (!foundFirstPaint && node.childEvents.some(evt => evt.name === 'Paint')) {\n isFirst = foundFirstPaint = true;\n }\n if (!foundFirstParse && node.childEvents.some(evt => evt.name === 'ParseHTML')) {\n isFirst = foundFirstParse = true;\n }\n\n if (isFirst || node.duration >= minimumEvtDur) {\n // Don't prune this node. The task is long / important so it will impact simulation.\n continue;\n }\n\n // Prune the node if it isn't highly connected to minimize graph size. Rewiring the graph\n // here replaces O(M + N) edges with (M * N) edges, which is fine if either M or N is at\n // most 1.\n if (node.getNumberOfDependencies() === 1 || node.getNumberOfDependents() <= 1) {\n PageDependencyGraph.pruneNode(node);\n }\n }\n }\n\n /**\n * Removes the given node from the graph, but retains all paths between its dependencies and\n * dependents.\n */\n static pruneNode(node: Node): void {\n const dependencies = node.getDependencies();\n const dependents = node.getDependents();\n for (const dependency of dependencies) {\n node.removeDependency(dependency);\n for (const dependent of dependents) {\n dependency.addDependent(dependent);\n }\n }\n for (const dependent of dependents) {\n node.removeDependent(dependent);\n }\n }\n\n /**\n * TODO: remove when CDT backend in Lighthouse is gone. Until then, this is a useful debugging tool\n * to find delta between using CDP or the trace to create the network requests.\n *\n * When a test fails using the trace backend, I enabled this debug method and copied the network\n * requests when CDP was used, then when trace is used, and diff'd them. This method helped\n * remove non-logical differences from the comparison (order of properties, slight rounding\n * discrepancies, removing object cycles, etc).\n *\n * When using for a unit test, make sure to do `.only` so you are getting what you expect.\n */\n static debugNormalizeRequests(lanternRequests: Lantern.NetworkRequest[]): void {\n for (const request of lanternRequests) {\n request.rendererStartTime = Math.round(request.rendererStartTime * 1000) / 1000;\n request.networkRequestTime = Math.round(request.networkRequestTime * 1000) / 1000;\n request.responseHeadersEndTime = Math.round(request.responseHeadersEndTime * 1000) / 1000;\n request.networkEndTime = Math.round(request.networkEndTime * 1000) / 1000;\n }\n\n for (const r of lanternRequests) {\n delete r.rawRequest;\n if (r.initiatorRequest) {\n // @ts-expect-error\n r.initiatorRequest = {id: r.initiatorRequest.requestId};\n }\n if (r.redirectDestination) {\n // @ts-expect-error\n r.redirectDestination = {id: r.redirectDestination.requestId};\n }\n if (r.redirectSource) {\n // @ts-expect-error\n r.redirectSource = {id: r.redirectSource.requestId};\n }\n if (r.redirects) {\n // @ts-expect-error\n r.redirects = r.redirects.map(r2 => r2.requestId);\n }\n }\n const requests: Lantern.NetworkRequest[] = lanternRequests\n .map(r => ({\n requestId: r.requestId,\n connectionId: r.connectionId,\n connectionReused: r.connectionReused,\n url: r.url,\n protocol: r.protocol,\n parsedURL: r.parsedURL,\n documentURL: r.documentURL,\n rendererStartTime: r.rendererStartTime,\n networkRequestTime: r.networkRequestTime,\n responseHeadersEndTime: r.responseHeadersEndTime,\n networkEndTime: r.networkEndTime,\n transferSize: r.transferSize,\n resourceSize: r.resourceSize,\n fromDiskCache: r.fromDiskCache,\n fromMemoryCache: r.fromMemoryCache,\n finished: r.finished,\n statusCode: r.statusCode,\n redirectSource: r.redirectSource,\n redirectDestination: r.redirectDestination,\n redirects: r.redirects,\n failed: r.failed,\n initiator: r.initiator,\n timing: r.timing ? {\n requestTime: r.timing.requestTime,\n proxyStart: r.timing.proxyStart,\n proxyEnd: r.timing.proxyEnd,\n dnsStart: r.timing.dnsStart,\n dnsEnd: r.timing.dnsEnd,\n connectStart: r.timing.connectStart,\n connectEnd: r.timing.connectEnd,\n sslStart: r.timing.sslStart,\n sslEnd: r.timing.sslEnd,\n workerStart: r.timing.workerStart,\n workerReady: r.timing.workerReady,\n workerFetchStart: r.timing.workerFetchStart,\n workerRespondWithSettled: r.timing.workerRespondWithSettled,\n sendStart: r.timing.sendStart,\n sendEnd: r.timing.sendEnd,\n pushStart: r.timing.pushStart,\n pushEnd: r.timing.pushEnd,\n receiveHeadersStart: r.timing.receiveHeadersStart,\n receiveHeadersEnd: r.timing.receiveHeadersEnd,\n } :\n r.timing,\n resourceType: r.resourceType,\n mimeType: r.mimeType,\n priority: r.priority,\n initiatorRequest: r.initiatorRequest,\n frameId: r.frameId,\n fromWorker: r.fromWorker,\n isLinkPreload: r.isLinkPreload,\n serverResponseTime: r.serverResponseTime,\n }))\n .filter(r => !r.fromWorker);\n\n const debug = requests;\n // Set breakpoint here.\n // Copy `debug` and compare with https://www.diffchecker.com/text-compare/\n // eslint-disable-next-line no-console\n console.log(debug);\n }\n\n static createGraph(\n mainThreadEvents: Lantern.TraceEvent[], networkRequests: Lantern.NetworkRequest[],\n url: Lantern.Simulation.URL): Node {\n // This is for debugging trace/devtoolslog network records.\n // const debug = PageDependencyGraph.debugNormalizeRequests(networkRequests);\n const networkNodeOutput = PageDependencyGraph.getNetworkNodeOutput(networkRequests);\n const cpuNodes = PageDependencyGraph.getCPUNodes(mainThreadEvents);\n const {requestedUrl, mainDocumentUrl} = url;\n if (!requestedUrl) {\n throw new Core.LanternError('requestedUrl is required to get the root request');\n }\n if (!mainDocumentUrl) {\n throw new Core.LanternError('mainDocumentUrl is required to get the main resource');\n }\n\n const rootRequest = Core.NetworkAnalyzer.findResourceForUrl(networkRequests, requestedUrl);\n if (!rootRequest) {\n throw new Core.LanternError('rootRequest not found');\n }\n const rootNode = networkNodeOutput.idToNodeMap.get(rootRequest.requestId);\n if (!rootNode) {\n throw new Core.LanternError('rootNode not found');\n }\n const mainDocumentRequest = Core.NetworkAnalyzer.findLastDocumentForUrl(networkRequests, mainDocumentUrl);\n if (!mainDocumentRequest) {\n throw new Core.LanternError('mainDocumentRequest not found');\n }\n const mainDocumentNode = networkNodeOutput.idToNodeMap.get(mainDocumentRequest.requestId);\n if (!mainDocumentNode) {\n throw new Core.LanternError('mainDocumentNode not found');\n }\n\n PageDependencyGraph.linkNetworkNodes(rootNode, networkNodeOutput);\n PageDependencyGraph.linkCPUNodes(rootNode, networkNodeOutput, cpuNodes);\n mainDocumentNode.setIsMainDocument(true);\n\n if (NetworkNode.hasCycle(rootNode)) {\n throw new Core.LanternError('Invalid dependency graph created, cycle detected');\n }\n\n return rootNode;\n }\n\n // Unused, but useful for debugging.\n static printGraph(rootNode: Node, widthInCharacters = 100): void {\n function padRight(str: string, target: number, padChar = ' '): string {\n return str + padChar.repeat(Math.max(target - str.length, 0));\n }\n\n const nodes: Node[] = [];\n rootNode.traverse(node => nodes.push(node));\n nodes.sort((a, b) => a.startTime - b.startTime);\n\n const min = nodes[0].startTime;\n const max = nodes.reduce((max, node) => Math.max(max, node.endTime), 0);\n\n const totalTime = max - min;\n const timePerCharacter = totalTime / widthInCharacters;\n nodes.forEach(node => {\n const offset = Math.round((node.startTime - min) / timePerCharacter);\n const length = Math.ceil((node.endTime - node.startTime) / timePerCharacter);\n const bar = padRight('', offset) + padRight('', length, '=');\n\n // @ts-expect-error -- disambiguate displayName from across possible Node types.\n const displayName = node.request ? node.request.url : node.type;\n // eslint-disable-next-line\n console.log(padRight(bar, widthInCharacters), `| ${displayName.slice(0, 30)}`);\n });\n }\n}\n\nexport {PageDependencyGraph};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Metric.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/metrics/Metric.ts"],"names":[],"mappings":"AAA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,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7G,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,GAAG,mBAAmB;YACvD,YAAY,CAAC,UAAU,GAAG,kBAAkB,CAAC,QAAQ,GAAG,YAAY,CAAC,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC;QAEpH,OAAO;YACL,MAAM;YACN,kBAAkB;YAClB,mBAAmB;YACnB,eAAe;YACf,gBAAgB;SACjB,CAAC;IACJ,CAAC;CACF;AAED,OAAO,EAAC,MAAM,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 * as Core from '../core/core.js';\nimport * as Graph from '../graph/graph.js';\nimport type * as Simulation from '../simulation/simulation.js';\nimport type * as Types from '../types/types.js';\n\nexport interface MetricComputationDataInput {\n simulator: Simulation.Simulator;\n graph: Graph.Node<unknown>;\n processedNavigation: Types.Simulation.ProcessedNavigation;\n}\n\nexport interface MetricCoefficients {\n intercept: number;\n optimistic: number;\n pessimistic: number;\n}\n\nexport interface MetricResult<T = Types.AnyNetworkObject> {\n timing: number;\n timestamp?: never;\n optimisticEstimate: Simulation.Result<T>;\n pessimisticEstimate: Simulation.Result<T>;\n optimisticGraph: Graph.Node<T>;\n pessimisticGraph: Graph.Node;\n}\n\nexport interface Extras {\n optimistic: boolean;\n fcpResult?: MetricResult;\n lcpResult?: MetricResult;\n interactiveResult?: MetricResult;\n observedSpeedIndex?: number;\n}\n\nclass Metric {\n static getScriptUrls(dependencyGraph: Graph.Node, treatNodeAsRenderBlocking?: (node: Graph.NetworkNode) => boolean):\n Set<string> {\n const scriptUrls: Set<string> = new Set();\n\n dependencyGraph.traverse(node => {\n if (node.type !== Graph.BaseNode.types.NETWORK) {\n return;\n }\n if (node.request.resourceType !== 'Script') {\n return;\n }\n if (treatNodeAsRenderBlocking?.(node)) {\n scriptUrls.add(node.request.url);\n }\n });\n\n return scriptUrls;\n }\n\n static get coefficients(): MetricCoefficients {\n throw new Core.LanternError('coefficients unimplemented!');\n }\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n\n /**\n * Returns the coefficients, scaled by the throttling settings if needed by the metric.\n * Some lantern metrics (speed-index) use components in their estimate that are not\n * from the simulator. In this case, we need to adjust the coefficients as the target throttling\n * settings change.\n */\n static getScaledCoefficients(rttMs: number): MetricCoefficients {\n return this.coefficients;\n }\n\n static getOptimisticGraph(dependencyGraph: Graph.Node, processedNavigation: Types.Simulation.ProcessedNavigation):\n Graph.Node {\n throw new Core.LanternError('Optimistic graph unimplemented!');\n }\n\n static getPessimisticGraph(dependencyGraph: Graph.Node, processedNavigation: Types.Simulation.ProcessedNavigation):\n Graph.Node {\n throw new Core.LanternError('Pessmistic graph unimplemented!');\n }\n\n static getEstimateFromSimulation(simulationResult: Simulation.Result, extras: Extras): Simulation.Result {\n return simulationResult;\n }\n\n /* eslint-enable @typescript-eslint/no-unused-vars */\n\n static compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult {\n const {simulator, graph, processedNavigation} = data;\n\n const metricName = this.name.replace('Lantern', '');\n const optimisticGraph = this.getOptimisticGraph(graph, processedNavigation);\n const pessimisticGraph = this.getPessimisticGraph(graph, processedNavigation);\n\n let simulateOptions = {label: `optimistic${metricName}`};\n const optimisticSimulation = simulator.simulate(optimisticGraph, simulateOptions);\n\n simulateOptions = {label: `pessimistic${metricName}`};\n const pessimisticSimulation = simulator.simulate(pessimisticGraph, simulateOptions);\n\n const optimisticEstimate = this.getEstimateFromSimulation(\n optimisticSimulation,\n {...extras, optimistic: true},\n );\n\n const pessimisticEstimate = this.getEstimateFromSimulation(\n pessimisticSimulation,\n {...extras, optimistic: false},\n );\n\n const coefficients = this.getScaledCoefficients(simulator.rtt);\n // Estimates under 1s don't really follow the normal curve fit, minimize the impact of the intercept\n const interceptMultiplier = coefficients.intercept > 0 ? Math.min(1, optimisticEstimate.timeInMs / 1000) : 1;\n const timing = coefficients.intercept * interceptMultiplier +\n coefficients.optimistic * optimisticEstimate.timeInMs + coefficients.pessimistic * pessimisticEstimate.timeInMs;\n\n return {\n timing,\n optimisticEstimate,\n pessimisticEstimate,\n optimisticGraph,\n pessimisticGraph,\n };\n }\n}\n\nexport {Metric};\n"]}
1
+ {"version":3,"file":"Metric.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/metrics/Metric.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAiC3C,MAAM,MAAM;IACV,MAAM,CAAC,aAAa,CAAC,eAA2B,EAAE,yBAAgE;QAEhH,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;QAErC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC9B,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBAC/C,OAAO;YACT,CAAC;YACD,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;gBAC3C,OAAO;YACT,CAAC;YACD,IAAI,yBAAyB,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBACtC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACnC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,KAAK,YAAY;QACrB,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAC;IAC7D,CAAC;IAED,sDAAsD;IAEtD;;;;;OAKG;IACH,MAAM,CAAC,qBAAqB,CAAC,KAAa;QACxC,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,M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AqB,EACrB,EAAC,GAAG,MAAM,EAAE,UAAU,EAAE,KAAK,EAAC,CACjC,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC/D,oGAAoG;QACpG,MAAM,mBAAmB,GAAG,YAAY,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAkB,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7G,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,GAAG,mBAAmB;YACvD,YAAY,CAAC,UAAU,GAAG,kBAAkB,CAAC,QAAQ,GAAG,YAAY,CAAC,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC;QAEpH,OAAO;YACL,MAAM;YACN,kBAAkB;YAClB,mBAAmB;YACnB,eAAe;YACf,gBAAgB;SACjB,CAAC;IACJ,CAAC;CACF;AAED,OAAO,EAAC,MAAM,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 * as Core from '../core/core.js';\nimport * as Graph from '../graph/graph.js';\nimport type * as Simulation from '../simulation/simulation.js';\nimport type * as Types from '../types/types.js';\n\nexport interface MetricComputationDataInput {\n simulator: Simulation.Simulator;\n graph: Graph.Node<unknown>;\n processedNavigation: Types.Simulation.ProcessedNavigation;\n}\n\nexport interface MetricCoefficients {\n intercept: number;\n optimistic: number;\n pessimistic: number;\n}\n\nexport interface MetricResult<T = Types.AnyNetworkObject> {\n timing: number;\n timestamp?: never;\n optimisticEstimate: Simulation.Result<T>;\n pessimisticEstimate: Simulation.Result<T>;\n optimisticGraph: Graph.Node<T>;\n pessimisticGraph: Graph.Node;\n}\n\nexport interface Extras {\n optimistic: boolean;\n fcpResult?: MetricResult;\n lcpResult?: MetricResult;\n interactiveResult?: MetricResult;\n observedSpeedIndex?: number;\n}\n\nclass Metric {\n static getScriptUrls(dependencyGraph: Graph.Node, treatNodeAsRenderBlocking?: (node: Graph.NetworkNode) => boolean):\n Set<string> {\n const scriptUrls = new Set<string>();\n\n dependencyGraph.traverse(node => {\n if (node.type !== Graph.BaseNode.types.NETWORK) {\n return;\n }\n if (node.request.resourceType !== 'Script') {\n return;\n }\n if (treatNodeAsRenderBlocking?.(node)) {\n scriptUrls.add(node.request.url);\n }\n });\n\n return scriptUrls;\n }\n\n static get coefficients(): MetricCoefficients {\n throw new Core.LanternError('coefficients unimplemented!');\n }\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n\n /**\n * Returns the coefficients, scaled by the throttling settings if needed by the metric.\n * Some lantern metrics (speed-index) use components in their estimate that are not\n * from the simulator. In this case, we need to adjust the coefficients as the target throttling\n * settings change.\n */\n static getScaledCoefficients(rttMs: number): MetricCoefficients {\n return this.coefficients;\n }\n\n static getOptimisticGraph(dependencyGraph: Graph.Node, processedNavigation: Types.Simulation.ProcessedNavigation):\n Graph.Node {\n throw new Core.LanternError('Optimistic graph unimplemented!');\n }\n\n static getPessimisticGraph(dependencyGraph: Graph.Node, processedNavigation: Types.Simulation.ProcessedNavigation):\n Graph.Node {\n throw new Core.LanternError('Pessmistic graph unimplemented!');\n }\n\n static getEstimateFromSimulation(simulationResult: Simulation.Result, extras: Extras): Simulation.Result {\n return simulationResult;\n }\n\n /* eslint-enable @typescript-eslint/no-unused-vars */\n\n static compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult {\n const {simulator, graph, processedNavigation} = data;\n\n const metricName = this.name.replace('Lantern', '');\n const optimisticGraph = this.getOptimisticGraph(graph, processedNavigation);\n const pessimisticGraph = this.getPessimisticGraph(graph, processedNavigation);\n\n let simulateOptions = {label: `optimistic${metricName}`};\n const optimisticSimulation = simulator.simulate(optimisticGraph, simulateOptions);\n\n simulateOptions = {label: `pessimistic${metricName}`};\n const pessimisticSimulation = simulator.simulate(pessimisticGraph, simulateOptions);\n\n const optimisticEstimate = this.getEstimateFromSimulation(\n optimisticSimulation,\n {...extras, optimistic: true},\n );\n\n const pessimisticEstimate = this.getEstimateFromSimulation(\n pessimisticSimulation,\n {...extras, optimistic: false},\n );\n\n const coefficients = this.getScaledCoefficients(simulator.rtt);\n // Estimates under 1s don't really follow the normal curve fit, minimize the impact of the intercept\n const interceptMultiplier = coefficients.intercept > 0 ? Math.min(1, optimisticEstimate.timeInMs / 1000) : 1;\n const timing = coefficients.intercept * interceptMultiplier +\n coefficients.optimistic * optimisticEstimate.timeInMs + coefficients.pessimistic * pessimisticEstimate.timeInMs;\n\n return {\n timing,\n optimisticEstimate,\n pessimisticEstimate,\n optimisticGraph,\n pessimisticGraph,\n };\n }\n}\n\nexport {Metric};\n"]}
@@ -7,10 +7,10 @@ declare class TotalBlockingTime extends Metric {
7
7
  static getPessimisticGraph(dependencyGraph: Graph.Node): Graph.Node;
8
8
  static getEstimateFromSimulation(simulation: Simulation.Result, extras: Extras): Simulation.Result;
9
9
  static compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult;
10
- static getTopLevelEvents(nodeTimings: Simulation.Result['nodeTimings'], minDurationMs: number): {
10
+ static getTopLevelEvents(nodeTimings: Simulation.Result['nodeTimings'], minDurationMs: number): Array<{
11
11
  start: number;
12
12
  end: number;
13
13
  duration: number;
14
- }[];
14
+ }>;
15
15
  }
16
16
  export { TotalBlockingTime };
@@ -1 +1 @@
1
- {"version":3,"file":"TotalBlockingTime.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/metrics/TotalBlockingTime.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAEL,MAAM,GAIP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,uB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F;AAED,OAAO,EAAC,iBAAiB,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 * as Core from '../core/core.js';\nimport * as Graph from '../graph/graph.js';\nimport type * as Simulation from '../simulation/simulation.js';\n\nimport {\n type Extras,\n Metric,\n type MetricCoefficients,\n type MetricComputationDataInput,\n type MetricResult,\n} from './Metric.js';\nimport {BLOCKING_TIME_THRESHOLD, calculateSumOfBlockingTime} from './TBTUtils.js';\n\nclass TotalBlockingTime extends Metric {\n static override get coefficients(): MetricCoefficients {\n return {\n intercept: 0,\n optimistic: 0.5,\n pessimistic: 0.5,\n };\n }\n\n static override getOptimisticGraph(dependencyGraph: Graph.Node): Graph.Node {\n return dependencyGraph;\n }\n\n static override getPessimisticGraph(dependencyGraph: Graph.Node): Graph.Node {\n return dependencyGraph;\n }\n\n static override getEstimateFromSimulation(simulation: Simulation.Result, extras: Extras): Simulation.Result {\n if (!extras.fcpResult) {\n throw new Core.LanternError('missing fcpResult');\n }\n if (!extras.interactiveResult) {\n throw new Core.LanternError('missing interactiveResult');\n }\n\n // Intentionally use the opposite FCP estimate. A pessimistic FCP is higher than equal to an\n // optimistic FCP, which means potentially more tasks are excluded from the Total Blocking Time\n // computation. So a more pessimistic FCP gives a more optimistic Total Blocking Time for the\n // same work.\n const fcpTimeInMs = extras.optimistic ? extras.fcpResult.pessimisticEstimate.timeInMs :\n extras.fcpResult.optimisticEstimate.timeInMs;\n\n // Similarly, we always have pessimistic TTI >= optimistic TTI. Therefore, picking optimistic\n // TTI means our window of interest is smaller and thus potentially more tasks are excluded from\n // Total Blocking Time computation, yielding a lower (more optimistic) Total Blocking Time value\n // for the same work.\n const interactiveTimeMs = extras.optimistic ? extras.interactiveResult.optimisticEstimate.timeInMs :\n extras.interactiveResult.pessimisticEstimate.timeInMs;\n\n const minDurationMs = BLOCKING_TIME_THRESHOLD;\n\n const events = TotalBlockingTime.getTopLevelEvents(\n simulation.nodeTimings,\n minDurationMs,\n );\n\n return {\n timeInMs: calculateSumOfBlockingTime(\n events,\n fcpTimeInMs,\n interactiveTimeMs,\n ),\n nodeTimings: simulation.nodeTimings,\n };\n }\n\n static override compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult {\n const fcpResult = extras?.fcpResult;\n if (!fcpResult) {\n throw new Core.LanternError('FCP is required to calculate the TBT metric');\n }\n\n const interactiveResult = extras?.fcpResult;\n if (!interactiveResult) {\n throw new Core.LanternError('Interactive is required to calculate the TBT metric');\n }\n\n return super.compute(data, extras);\n }\n\n static getTopLevelEvents(nodeTimings: Simulation.Result['nodeTimings'], minDurationMs: number):\n {start: number, end: number, duration: number}[] {\n const events: Array<{start: number, end: number, duration: number}> = [];\n\n for (const [node, timing] of nodeTimings.entries()) {\n if (node.type !== Graph.BaseNode.types.CPU) {\n continue;\n }\n // Filtering out events below minimum duration.\n if (timing.duration < minDurationMs) {\n continue;\n }\n\n events.push({\n start: timing.startTime,\n end: timing.endTime,\n duration: timing.duration,\n });\n }\n\n return events;\n }\n}\n\nexport {TotalBlockingTime};\n"]}
1
+ {"version":3,"file":"TotalBlockingTime.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/metrics/TotalBlockingTime.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAEL,MAAM,GAIP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,uBAAuB,EAAE,0BAA0B,EAAC,MAAM,eAAe,CAAC;AAElF,MAAM,iBAAkB,SAAQ,MAAM;IACpC,MAAM,KAAc,YAAY;QAC9B,OAAO;YACL,SAAS,EAAE,CAAC;YACZ,UAAU,EAAE,GAAG;YACf,WAAW,EAAE,GAAG;SACjB,CAAC;IACJ,CAA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C,IAAgC,EAAE,MAAmC;QAC3F,MAAM,SAAS,GAAG,MAAM,EAAE,SAAS,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,6CAA6C,CAAC,CAAC;QAC7E,CAAC;QAED,MAAM,iBAAiB,GAAG,MAAM,EAAE,SAAS,CAAC;QAC5C,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,qDAAqD,CAAC,CAAC;QACrF,CAAC;QAED,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,WAA6C,EAAE,aAAqB;QAE3F,MAAM,MAAM,GAA0D,EAAE,CAAC;QAEzE,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;YACnD,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;gBAC3C,SAAS;YACX,CAAC;YACD,+CAA+C;YAC/C,IAAI,MAAM,CAAC,QAAQ,GAAG,aAAa,EAAE,CAAC;gBACpC,SAAS;YACX,CAAC;YAED,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,MAAM,CAAC,SAAS;gBACvB,GAAG,EAAE,MAAM,CAAC,OAAO;gBACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;aAC1B,CAAC,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,OAAO,EAAC,iBAAiB,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 * as Core from '../core/core.js';\nimport * as Graph from '../graph/graph.js';\nimport type * as Simulation from '../simulation/simulation.js';\n\nimport {\n type Extras,\n Metric,\n type MetricCoefficients,\n type MetricComputationDataInput,\n type MetricResult,\n} from './Metric.js';\nimport {BLOCKING_TIME_THRESHOLD, calculateSumOfBlockingTime} from './TBTUtils.js';\n\nclass TotalBlockingTime extends Metric {\n static override get coefficients(): MetricCoefficients {\n return {\n intercept: 0,\n optimistic: 0.5,\n pessimistic: 0.5,\n };\n }\n\n static override getOptimisticGraph(dependencyGraph: Graph.Node): Graph.Node {\n return dependencyGraph;\n }\n\n static override getPessimisticGraph(dependencyGraph: Graph.Node): Graph.Node {\n return dependencyGraph;\n }\n\n static override getEstimateFromSimulation(simulation: Simulation.Result, extras: Extras): Simulation.Result {\n if (!extras.fcpResult) {\n throw new Core.LanternError('missing fcpResult');\n }\n if (!extras.interactiveResult) {\n throw new Core.LanternError('missing interactiveResult');\n }\n\n // Intentionally use the opposite FCP estimate. A pessimistic FCP is higher than equal to an\n // optimistic FCP, which means potentially more tasks are excluded from the Total Blocking Time\n // computation. So a more pessimistic FCP gives a more optimistic Total Blocking Time for the\n // same work.\n const fcpTimeInMs = extras.optimistic ? extras.fcpResult.pessimisticEstimate.timeInMs :\n extras.fcpResult.optimisticEstimate.timeInMs;\n\n // Similarly, we always have pessimistic TTI >= optimistic TTI. Therefore, picking optimistic\n // TTI means our window of interest is smaller and thus potentially more tasks are excluded from\n // Total Blocking Time computation, yielding a lower (more optimistic) Total Blocking Time value\n // for the same work.\n const interactiveTimeMs = extras.optimistic ? extras.interactiveResult.optimisticEstimate.timeInMs :\n extras.interactiveResult.pessimisticEstimate.timeInMs;\n\n const minDurationMs = BLOCKING_TIME_THRESHOLD;\n\n const events = TotalBlockingTime.getTopLevelEvents(\n simulation.nodeTimings,\n minDurationMs,\n );\n\n return {\n timeInMs: calculateSumOfBlockingTime(\n events,\n fcpTimeInMs,\n interactiveTimeMs,\n ),\n nodeTimings: simulation.nodeTimings,\n };\n }\n\n static override compute(data: MetricComputationDataInput, extras?: Omit<Extras, 'optimistic'>): MetricResult {\n const fcpResult = extras?.fcpResult;\n if (!fcpResult) {\n throw new Core.LanternError('FCP is required to calculate the TBT metric');\n }\n\n const interactiveResult = extras?.fcpResult;\n if (!interactiveResult) {\n throw new Core.LanternError('Interactive is required to calculate the TBT metric');\n }\n\n return super.compute(data, extras);\n }\n\n static getTopLevelEvents(nodeTimings: Simulation.Result['nodeTimings'], minDurationMs: number):\n Array<{start: number, end: number, duration: number}> {\n const events: Array<{start: number, end: number, duration: number}> = [];\n\n for (const [node, timing] of nodeTimings.entries()) {\n if (node.type !== Graph.BaseNode.types.CPU) {\n continue;\n }\n // Filtering out events below minimum duration.\n if (timing.duration < minDurationMs) {\n continue;\n }\n\n events.push({\n start: timing.startTime,\n end: timing.endTime,\n duration: timing.duration,\n });\n }\n\n return events;\n }\n}\n\nexport {TotalBlockingTime};\n"]}
@@ -26,9 +26,9 @@ export interface TraceEvent {
26
26
  data?: {
27
27
  frame?: string;
28
28
  readyState?: number;
29
- stackTrace?: {
29
+ stackTrace?: Array<{
30
30
  url: string;
31
- }[];
31
+ }>;
32
32
  url?: string;
33
33
  };
34
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Lantern.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/types/Lantern.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,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;CACZ,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 * 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} as const;\n\nexport interface TraceEvent {\n name: string;\n args: {\n name?: string,\n data?: {\n frame?: string,\n readyState?: number,\n stackTrace?: {\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.\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: {[origin: string]: number};\n serverResponseTimeByOrigin: {[origin: 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"]}
1
+ {"version":3,"file":"Lantern.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/types/Lantern.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,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;CACZ,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 * 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} 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.\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: {[origin: string]: number};\n serverResponseTimeByOrigin: {[origin: 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"]}
@@ -45,6 +45,9 @@
45
45
  {
46
46
  "path": "../../core/platform/bundle-tsconfig.json"
47
47
  },
48
+ {
49
+ "path": "../../core/root/bundle-tsconfig.json"
50
+ },
48
51
  {
49
52
  "path": "../../core/sdk/bundle-tsconfig.json"
50
53
  },
@@ -69,9 +72,6 @@
69
72
  {
70
73
  "path": "lantern/bundle-tsconfig.json"
71
74
  },
72
- {
73
- "path": "root-causes/bundle-tsconfig.json"
74
- },
75
75
  {
76
76
  "path": "types/bundle-tsconfig.json"
77
77
  }
@@ -6,7 +6,6 @@ import * as Lantern from './lantern/lantern.js';
6
6
  import * as LanternComputationData from './LanternComputationData.js';
7
7
  import * as TraceModel from './ModelImpl.js';
8
8
  import * as Processor from './Processor.js';
9
- import * as RootCauses from './root-causes/root-causes.js';
10
9
  import * as TracingManager from './TracingManager.js';
11
10
  import * as Types from './types/types.js';
12
- export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, RootCauses, TraceModel, TracingManager, Types, };
11
+ export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, TraceModel, TracingManager, Types, };
@@ -9,8 +9,7 @@ import * as Lantern from './lantern/lantern.js';
9
9
  import * as LanternComputationData from './LanternComputationData.js';
10
10
  import * as TraceModel from './ModelImpl.js';
11
11
  import * as Processor from './Processor.js';
12
- import * as RootCauses from './root-causes/root-causes.js';
13
12
  import * as TracingManager from './TracingManager.js';
14
13
  import * as Types from './types/types.js';
15
- export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, RootCauses, TraceModel, TracingManager, Types, };
14
+ export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, TraceModel, TracingManager, Types, };
16
15
  //# sourceMappingURL=trace.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../../../../front_end/models/trace/trace.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,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,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,UAAU,EACV,cAAc,EACd,KAAK,GACN,CAAC","sourcesContent":["// Copyright 2022 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 * 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 Processor from './Processor.js';\nimport * as RootCauses from './root-causes/root-causes.js';\nimport * as TracingManager from './TracingManager.js';\nimport * as Types from './types/types.js';\n\nexport {\n Extras,\n Handlers,\n Helpers,\n Insights,\n Lantern,\n LanternComputationData,\n Processor,\n RootCauses,\n TraceModel,\n TracingManager,\n Types,\n};\n"]}
1
+ {"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../../../../front_end/models/trace/trace.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,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,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,cAAc,EACd,KAAK,GACN,CAAC","sourcesContent":["// Copyright 2022 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 * 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 Processor from './Processor.js';\nimport * as TracingManager from './TracingManager.js';\nimport * as Types from './types/types.js';\n\nexport {\n Extras,\n Handlers,\n Helpers,\n Insights,\n Lantern,\n LanternComputationData,\n Processor,\n TraceModel,\n TracingManager,\n Types,\n};\n"]}
@@ -1,3 +1,6 @@
1
+ import type * as Platform from '../../../core/platform/platform.js';
2
+ // import type * as SDK from '../../../core/sdk/sdk.js';
3
+ import type * as Protocol from '../../../generated/protocol.js';
1
4
  import type * as File from './File.js';
2
5
  export interface Configuration {
3
6
  /**
@@ -49,4 +52,11 @@ export interface ParseOptions {
49
52
  */
50
53
  isCPUProfile?: boolean;
51
54
  metadata?: File.MetaData;
55
+ resolveSourceMap?: (params: ResolveSourceMapParams) => Promise<any | null>;
56
+ }
57
+ export interface ResolveSourceMapParams {
58
+ scriptId: string;
59
+ scriptUrl: Platform.DevToolsPath.UrlString;
60
+ sourceMapUrl: Platform.DevToolsPath.UrlString;
61
+ frame: Protocol.Page.FrameId;
52
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Configuration.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAmC7B,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;CAClC,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. 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 * as File from './File.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\nexport const defaults = (): Configuration => ({\n includeRuntimeCallStats: false,\n showAllEvents: false,\n debugMode: false,\n maxInvalidationEventsPerEvent: 20,\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}\n"]}
1
+ {"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Configuration.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAuC7B,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;CAClC,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. 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 * as Platform from '../../../core/platform/platform.js';\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\n\nimport type * as File from './File.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\nexport const defaults = (): Configuration => ({\n includeRuntimeCallStats: false,\n showAllEvents: false,\n debugMode: false,\n maxInvalidationEventsPerEvent: 20,\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}\n\nexport interface ResolveSourceMapParams {\n scriptId: string;\n scriptUrl: Platform.DevToolsPath.UrlString;\n sourceMapUrl: Platform.DevToolsPath.UrlString;\n frame: Protocol.Page.FrameId;\n}\n"]}
@@ -4,7 +4,7 @@ export declare const extensionPalette: readonly ["primary", "primary-light", "pr
4
4
  export type ExtensionColorFromPalette = typeof extensionPalette[number];
5
5
  export interface ExtensionDataPayloadBase {
6
6
  color?: ExtensionColorFromPalette;
7
- properties?: [string, string][];
7
+ properties?: Array<[string, string]>;
8
8
  tooltipText?: string;
9
9
  }
10
10
  export type ExtensionDataPayload = ExtensionTrackEntryPayload | ExtensionMarkerPayload;
@@ -1 +1 @@
1
- {"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Extensions.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAQ7B,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;AAiDX,MAAM,UAAU,wBAAwB,CAAC,OAA4B;IACnE,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,OAA4C;IAEvF,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,MAAM,UAAU,uBAAuB,CAAC,OAA4C;IAClF,OAAO,wBAAwB,CAAC,OAAO,CAAC,IAAI,4BAA4B,CAAC,OAAO,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAAY;IACpD,OAAO,KAAK,CAAC,GAAG,KAAK,oBAAoB,CAAC;AAC5C,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 {\n Args, ConsoleTimeStamp, Event, PerformanceMark, PerformanceMeasureBegin, Phase, SyntheticBased} from\n './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\nexport interface ExtensionDataPayloadBase {\n color?: ExtensionColorFromPalette;\n properties?: [string, string][];\n tooltipText?: string;\n}\n\nexport type ExtensionDataPayload = ExtensionTrackEntryPayload|ExtensionMarkerPayload;\n\nexport interface ExtensionTrackEntryPayload extends ExtensionDataPayloadBase {\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}\n\nexport interface ExtensionMarkerPayload extends ExtensionDataPayloadBase {\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 args: Args&ExtensionTrackEntryPayload;\n}\n\n/**\n * Synthetic events created for extension marks.\n */\nexport interface SyntheticExtensionMarker extends SyntheticBased<Phase.COMPLETE, PerformanceMark> {\n args: Args&ExtensionMarkerPayload;\n}\n\nexport type SyntheticExtensionEntry = SyntheticExtensionTrackEntry|SyntheticExtensionMarker;\n\nexport function isExtensionPayloadMarker(payload: {dataType?: string}): payload is ExtensionMarkerPayload {\n return payload.dataType === 'marker';\n}\n\nexport function isExtensionPayloadTrackEntry(payload: {track?: string, dataType?: string}):\n payload is ExtensionTrackEntryPayload {\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\nexport function isValidExtensionPayload(payload: {track?: string, dataType?: string}): payload is ExtensionDataPayload {\n return isExtensionPayloadMarker(payload) || isExtensionPayloadTrackEntry(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: {\n [x: string]: SyntheticExtensionTrackEntry[],\n };\n}\n"]}
1
+ {"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Extensions.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAQ7B,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;AAiDX,MAAM,UAAU,wBAAwB,CAAC,OAA4B;IACnE,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,OAA4C;IAEvF,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,MAAM,UAAU,uBAAuB,CAAC,OAA4C;IAClF,OAAO,wBAAwB,CAAC,OAAO,CAAC,IAAI,4BAA4B,CAAC,OAAO,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAAY;IACpD,OAAO,KAAK,CAAC,GAAG,KAAK,oBAAoB,CAAC;AAC5C,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 {\n Args, ConsoleTimeStamp, Event, PerformanceMark, PerformanceMeasureBegin, Phase, SyntheticBased} from\n './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\nexport interface ExtensionDataPayloadBase {\n color?: ExtensionColorFromPalette;\n properties?: Array<[string, string]>;\n tooltipText?: string;\n}\n\nexport type ExtensionDataPayload = ExtensionTrackEntryPayload|ExtensionMarkerPayload;\n\nexport interface ExtensionTrackEntryPayload extends ExtensionDataPayloadBase {\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}\n\nexport interface ExtensionMarkerPayload extends ExtensionDataPayloadBase {\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 args: Args&ExtensionTrackEntryPayload;\n}\n\n/**\n * Synthetic events created for extension marks.\n */\nexport interface SyntheticExtensionMarker extends SyntheticBased<Phase.COMPLETE, PerformanceMark> {\n args: Args&ExtensionMarkerPayload;\n}\n\nexport type SyntheticExtensionEntry = SyntheticExtensionTrackEntry|SyntheticExtensionMarker;\n\nexport function isExtensionPayloadMarker(payload: {dataType?: string}): payload is ExtensionMarkerPayload {\n return payload.dataType === 'marker';\n}\n\nexport function isExtensionPayloadTrackEntry(payload: {track?: string, dataType?: string}):\n payload is ExtensionTrackEntryPayload {\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\nexport function isValidExtensionPayload(payload: {track?: string, dataType?: string}): payload is ExtensionDataPayload {\n return isExtensionPayloadMarker(payload) || isExtensionPayloadTrackEntry(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: {\n [x: string]: SyntheticExtensionTrackEntry[],\n };\n}\n"]}