@paulirish/trace_engine 0.0.60 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +1 -1
- package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
- package/analyze-inspector-issues.mjs +1 -1
- package/analyze-trace.mjs +1 -2
- package/core/platform/ArrayUtilities.d.ts +2 -0
- package/core/platform/ArrayUtilities.js +11 -1
- package/core/platform/ArrayUtilities.js.map +1 -1
- package/core/platform/HostRuntime.d.ts +4 -0
- package/core/platform/HostRuntime.js +25 -0
- package/core/platform/HostRuntime.js.map +1 -0
- package/core/platform/KeyboardUtilities.d.ts +6 -2
- package/core/platform/KeyboardUtilities.js.map +1 -1
- package/core/platform/StringUtilities.d.ts +2 -0
- package/core/platform/StringUtilities.js +64 -13
- package/core/platform/StringUtilities.js.map +1 -1
- package/core/platform/api/HostRuntime.d.ts +36 -0
- package/core/platform/api/HostRuntime.js +5 -0
- package/core/platform/api/HostRuntime.js.map +1 -0
- package/core/platform/api/api-tsconfig.json +43 -0
- package/core/platform/api/api.d.ts +2 -0
- package/core/platform/api/api.js +6 -0
- package/core/platform/api/api.js.map +1 -0
- package/core/platform/api/api_node_typecheck-tsconfig.json +48 -0
- package/core/platform/api/bundle-tsconfig.json +1 -0
- package/core/platform/api/devtools_entrypoint-bundle-typescript-tsconfig.json +48 -0
- package/core/platform/browser/HostRuntime.d.ts +2 -0
- package/core/platform/browser/HostRuntime.js +64 -0
- package/core/platform/browser/HostRuntime.js.map +1 -0
- package/core/platform/browser/browser-tsconfig.json +48 -0
- package/core/platform/browser/browser.d.ts +2 -0
- package/core/platform/browser/browser.js +6 -0
- package/core/platform/browser/browser.js.map +1 -0
- package/core/platform/browser/bundle-tsconfig.json +1 -0
- package/core/platform/browser/devtools_entrypoint-bundle-typescript-tsconfig.json +48 -0
- package/core/platform/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/core/platform/node/HostRuntime.d.ts +2 -0
- package/core/platform/node/HostRuntime.js +73 -0
- package/core/platform/node/HostRuntime.js.map +1 -0
- package/core/platform/node/bundle-tsconfig.json +1 -0
- package/core/platform/node/devtools_entrypoint-bundle-typescript-tsconfig.json +48 -0
- package/core/platform/node/node-tsconfig.json +52 -0
- package/core/platform/node/node.d.ts +2 -0
- package/core/platform/node/node.js +6 -0
- package/core/platform/node/node.js.map +1 -0
- package/core/platform/platform-tsconfig.json +17 -5
- package/core/platform/platform.d.ts +2 -2
- package/core/platform/platform.js +2 -2
- package/core/platform/platform.js.map +1 -1
- package/core/platform/platform_node_typecheck-tsconfig.json +74 -0
- package/generated/protocol.d.ts +1517 -592
- package/locales/af.json +83 -38
- package/locales/am.json +83 -38
- package/locales/ar.json +86 -41
- package/locales/as.json +83 -38
- package/locales/az.json +83 -38
- package/locales/be.json +81 -36
- package/locales/bg.json +81 -36
- package/locales/bn.json +83 -38
- package/locales/bs.json +82 -37
- package/locales/ca.json +81 -36
- package/locales/cs.json +81 -36
- package/locales/cy.json +83 -38
- package/locales/da.json +83 -38
- package/locales/de.json +81 -36
- package/locales/el.json +82 -37
- package/locales/en-GB.json +83 -38
- package/locales/en-US.json +104 -35
- package/locales/en-XL.json +104 -35
- package/locales/es-419.json +81 -36
- package/locales/es.json +82 -37
- package/locales/et.json +83 -38
- package/locales/eu.json +81 -36
- package/locales/fa.json +84 -39
- package/locales/fi.json +81 -36
- package/locales/fil.json +83 -38
- package/locales/fr-CA.json +82 -37
- package/locales/fr.json +168 -123
- package/locales/gl.json +82 -37
- package/locales/gu.json +82 -37
- package/locales/he.json +96 -51
- package/locales/hi.json +82 -37
- package/locales/hr.json +81 -36
- package/locales/hu.json +82 -37
- package/locales/hy.json +82 -37
- package/locales/id.json +83 -38
- package/locales/is.json +82 -37
- package/locales/it.json +81 -36
- package/locales/ja.json +81 -36
- package/locales/ka.json +83 -38
- package/locales/kk.json +81 -36
- package/locales/km.json +83 -38
- package/locales/kn.json +82 -37
- package/locales/ko.json +82 -37
- package/locales/ky.json +81 -36
- package/locales/lo.json +82 -37
- package/locales/lt.json +81 -36
- package/locales/lv.json +81 -36
- package/locales/mk.json +84 -39
- package/locales/ml.json +82 -37
- package/locales/mn.json +82 -37
- package/locales/mr.json +83 -38
- package/locales/ms.json +81 -36
- package/locales/my.json +82 -37
- package/locales/ne.json +82 -37
- package/locales/nl.json +82 -37
- package/locales/no.json +81 -36
- package/locales/or.json +81 -36
- package/locales/pa.json +81 -36
- package/locales/pl.json +81 -36
- package/locales/pt-PT.json +81 -36
- package/locales/pt.json +83 -38
- package/locales/ro.json +82 -37
- package/locales/ru.json +81 -36
- package/locales/si.json +81 -36
- package/locales/sk.json +81 -36
- package/locales/sl.json +81 -36
- package/locales/sq.json +82 -37
- package/locales/sr-Latn.json +82 -37
- package/locales/sr.json +82 -37
- package/locales/sv.json +84 -39
- package/locales/sw.json +83 -38
- package/locales/ta.json +82 -37
- package/locales/te.json +82 -37
- package/locales/th.json +82 -37
- package/locales/tr.json +81 -36
- package/locales/uk.json +81 -36
- package/locales/ur.json +82 -37
- package/locales/uz.json +82 -37
- package/locales/vi.json +83 -38
- package/locales/zh-HK.json +81 -36
- package/locales/zh-TW.json +84 -39
- package/locales/zh.json +84 -39
- package/locales/zu.json +82 -37
- package/models/cpu_profile/CPUProfileDataModel.d.ts +9 -0
- package/models/cpu_profile/CPUProfileDataModel.js +9 -7
- package/models/cpu_profile/CPUProfileDataModel.js.map +1 -1
- package/models/cpu_profile/ProfileTreeModel.d.ts +3 -2
- package/models/cpu_profile/ProfileTreeModel.js +6 -7
- package/models/cpu_profile/ProfileTreeModel.js.map +1 -1
- package/models/cpu_profile/cpu_profile-tsconfig.json +4 -3
- package/models/cpu_profile/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/EntityMapper.d.ts +1 -0
- package/models/trace/EntityMapper.js +10 -0
- package/models/trace/EntityMapper.js.map +1 -1
- package/models/trace/EventsSerializer.js +10 -2
- package/models/trace/EventsSerializer.js.map +1 -1
- package/models/trace/LanternComputationData.d.ts +1 -1
- package/models/trace/LanternComputationData.js +3 -8
- package/models/trace/LanternComputationData.js.map +1 -1
- package/models/trace/ModelImpl.d.ts +1 -0
- package/models/trace/ModelImpl.js +9 -6
- package/models/trace/ModelImpl.js.map +1 -1
- package/models/trace/Processor.js +23 -23
- package/models/trace/Processor.js.map +1 -1
- package/models/trace/Styles.js +13 -5
- package/models/trace/Styles.js.map +1 -1
- package/models/trace/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/extras/Initiators.d.ts +12 -0
- package/models/trace/extras/Initiators.js +47 -0
- package/models/trace/extras/Initiators.js.map +1 -0
- package/models/trace/extras/TraceTree.js +13 -5
- package/models/trace/extras/TraceTree.js.map +1 -1
- package/models/trace/extras/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/extras/extras-tsconfig.json +11 -3
- package/models/trace/extras/extras.d.ts +0 -3979
- package/models/trace/extras/extras.js +0 -3979
- package/models/trace/extras/extras.js.map +1 -1
- package/models/trace/handlers/LargestImagePaintHandler.js +2 -2
- package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -1
- package/models/trace/handlers/LayoutShiftsHandler.js +1 -1
- package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -1
- package/models/trace/handlers/MetaHandler.d.ts +12 -1
- package/models/trace/handlers/MetaHandler.js +10 -1
- package/models/trace/handlers/MetaHandler.js.map +1 -1
- package/models/trace/handlers/NetworkRequestsHandler.d.ts +8 -1
- package/models/trace/handlers/NetworkRequestsHandler.js +22 -4
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
- package/models/trace/handlers/PageLoadMetricsHandler.d.ts +13 -3
- package/models/trace/handlers/PageLoadMetricsHandler.js +71 -27
- package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -1
- package/models/trace/handlers/SamplesHandler.js +59 -6
- package/models/trace/handlers/SamplesHandler.js.map +1 -1
- package/models/trace/handlers/ScriptsHandler.js +24 -0
- package/models/trace/handlers/ScriptsHandler.js.map +1 -1
- package/models/trace/handlers/UserTimingsHandler.d.ts +1 -1
- package/models/trace/handlers/UserTimingsHandler.js +1 -1
- package/models/trace/handlers/UserTimingsHandler.js.map +1 -1
- package/models/trace/handlers/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/handlers/handlers-tsconfig.json +13 -3
- package/models/trace/helpers/Network.js +1 -1
- package/models/trace/helpers/Network.js.map +1 -1
- package/models/trace/helpers/SamplesIntegrator.js +1 -8
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -1
- package/models/trace/helpers/Timing.d.ts +1 -1
- package/models/trace/helpers/Timing.js +9 -2
- package/models/trace/helpers/Timing.js.map +1 -1
- package/models/trace/helpers/Trace.d.ts +1 -0
- package/models/trace/helpers/Trace.js +12 -5
- package/models/trace/helpers/Trace.js.map +1 -1
- package/models/trace/helpers/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/helpers/helpers-tsconfig.json +7 -3
- package/models/trace/insights/CLSCulprits.d.ts +1 -1
- package/models/trace/insights/CLSCulprits.js +2 -1
- package/models/trace/insights/CLSCulprits.js.map +1 -1
- package/models/trace/insights/Cache.d.ts +1 -1
- package/models/trace/insights/Cache.js +2 -1
- package/models/trace/insights/Cache.js.map +1 -1
- package/models/trace/insights/CharacterSet.d.ts +49 -0
- package/models/trace/insights/CharacterSet.js +132 -0
- package/models/trace/insights/CharacterSet.js.map +1 -0
- package/models/trace/insights/Common.d.ts +2 -2
- package/models/trace/insights/Common.js +1 -6
- package/models/trace/insights/Common.js.map +1 -1
- package/models/trace/insights/DOMSize.d.ts +1 -1
- package/models/trace/insights/DOMSize.js +2 -1
- package/models/trace/insights/DOMSize.js.map +1 -1
- package/models/trace/insights/DocumentLatency.d.ts +1 -1
- package/models/trace/insights/DocumentLatency.js +2 -1
- package/models/trace/insights/DocumentLatency.js.map +1 -1
- package/models/trace/insights/DuplicatedJavaScript.d.ts +1 -1
- package/models/trace/insights/DuplicatedJavaScript.js +2 -1
- package/models/trace/insights/DuplicatedJavaScript.js.map +1 -1
- package/models/trace/insights/FontDisplay.d.ts +1 -1
- package/models/trace/insights/FontDisplay.js +2 -1
- package/models/trace/insights/FontDisplay.js.map +1 -1
- package/models/trace/insights/ForcedReflow.d.ts +2 -2
- package/models/trace/insights/ForcedReflow.js +3 -2
- package/models/trace/insights/ForcedReflow.js.map +1 -1
- package/models/trace/insights/INPBreakdown.d.ts +1 -1
- package/models/trace/insights/INPBreakdown.js +2 -1
- package/models/trace/insights/INPBreakdown.js.map +1 -1
- package/models/trace/insights/ImageDelivery.d.ts +1 -1
- package/models/trace/insights/ImageDelivery.js +2 -1
- package/models/trace/insights/ImageDelivery.js.map +1 -1
- package/models/trace/insights/LCPBreakdown.d.ts +2 -2
- package/models/trace/insights/LCPBreakdown.js +4 -3
- package/models/trace/insights/LCPBreakdown.js.map +1 -1
- package/models/trace/insights/LCPDiscovery.d.ts +8 -4
- package/models/trace/insights/LCPDiscovery.js +18 -11
- package/models/trace/insights/LCPDiscovery.js.map +1 -1
- package/models/trace/insights/LegacyJavaScript.d.ts +1 -1
- package/models/trace/insights/LegacyJavaScript.js +2 -1
- package/models/trace/insights/LegacyJavaScript.js.map +1 -1
- package/models/trace/insights/Models.d.ts +1 -0
- package/models/trace/insights/Models.js +1 -0
- package/models/trace/insights/Models.js.map +1 -1
- package/models/trace/insights/ModernHTTP.d.ts +1 -1
- package/models/trace/insights/ModernHTTP.js +2 -1
- package/models/trace/insights/ModernHTTP.js.map +1 -1
- package/models/trace/insights/NetworkDependencyTree.d.ts +1 -1
- package/models/trace/insights/NetworkDependencyTree.js +6 -4
- package/models/trace/insights/NetworkDependencyTree.js.map +1 -1
- package/models/trace/insights/RenderBlocking.d.ts +2 -2
- package/models/trace/insights/RenderBlocking.js +8 -7
- package/models/trace/insights/RenderBlocking.js.map +1 -1
- package/models/trace/insights/SlowCSSSelector.d.ts +1 -1
- package/models/trace/insights/SlowCSSSelector.js +2 -1
- package/models/trace/insights/SlowCSSSelector.js.map +1 -1
- package/models/trace/insights/ThirdParties.js +2 -1
- package/models/trace/insights/ThirdParties.js.map +1 -1
- package/models/trace/insights/Viewport.d.ts +1 -1
- package/models/trace/insights/Viewport.js +2 -1
- package/models/trace/insights/Viewport.js.map +1 -1
- package/models/trace/insights/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/insights/insights-tsconfig.json +26 -3
- package/models/trace/insights/types.d.ts +17 -6
- package/models/trace/insights/types.js +1 -0
- package/models/trace/insights/types.js.map +1 -1
- package/models/trace/lantern/core/core-tsconfig.json +4 -3
- package/models/trace/lantern/core/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/lantern/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/lantern/graph/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/lantern/graph/graph-tsconfig.json +4 -3
- package/models/trace/lantern/lantern-tsconfig.json +4 -3
- package/models/trace/lantern/metrics/FirstContentfulPaint.js +6 -6
- package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +1 -1
- package/models/trace/lantern/metrics/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/lantern/metrics/metrics-tsconfig.json +4 -3
- package/models/trace/lantern/simulation/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/lantern/simulation/simulation-tsconfig.json +4 -3
- package/models/trace/lantern/types/Lantern.d.ts +7 -7
- package/models/trace/lantern/types/Lantern.js.map +1 -1
- package/models/trace/lantern/types/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/lantern/types/types-tsconfig.json +4 -3
- package/models/trace/trace-tsconfig.json +7 -3
- package/models/trace/types/Configuration.d.ts +1 -4
- package/models/trace/types/Configuration.js +0 -1
- package/models/trace/types/Configuration.js.map +1 -1
- package/models/trace/types/File.d.ts +8 -0
- package/models/trace/types/File.js.map +1 -1
- package/models/trace/types/TraceEvents.d.ts +97 -15
- package/models/trace/types/TraceEvents.js +44 -11
- package/models/trace/types/TraceEvents.js.map +1 -1
- package/models/trace/types/devtools_entrypoint-bundle-typescript-tsconfig.json +4 -3
- package/models/trace/types/types-tsconfig.json +10 -3
- package/package.json +1 -1
- package/test/test-trace-engine.mjs +8 -9
- package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts +0 -4
- package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts.map +0 -1
- package/core/platform/DOMUtilities.d.ts +0 -16
- package/core/platform/DOMUtilities.js +0 -123
- package/core/platform/DOMUtilities.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extras.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/extras/extras.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport * as FilmStrip from './FilmStrip.js';\nexport * as MainThreadActivity from './MainThreadActivity.js';\nexport * as ScriptDuplication from './ScriptDuplication.js';\nexport * as StackTraceForEvent from './StackTraceForEvent.js';\nexport * as ThirdParties from './ThirdParties.js';\nexport * as TraceFilter from './TraceFilter.js';\nexport * as TraceTree from './TraceTree.js';\n"]}
|
|
1
|
+
{"version":3,"file":"extras.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/extras/extras.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport * as FilmStrip from './FilmStrip.js';\nexport * as Initiators from './Initiators.js';\nexport * as MainThreadActivity from './MainThreadActivity.js';\nexport * as ScriptDuplication from './ScriptDuplication.js';\nexport * as StackTraceForEvent from './StackTraceForEvent.js';\nexport * as ThirdParties from './ThirdParties.js';\nexport * as TraceFilter from './TraceFilter.js';\nexport * as TraceTree from './TraceTree.js';\n"]}
|
|
@@ -43,9 +43,9 @@ export async function finalize() {
|
|
|
43
43
|
const { traceBounds, navigationsByNavigationId } = metaData();
|
|
44
44
|
const metricScoresByFrameId = pageLoadMetricsData().metricScoresByFrameId;
|
|
45
45
|
for (const [navigationId, navigation] of navigationsByNavigationId) {
|
|
46
|
-
const lcpMetric = metricScoresByFrameId.get(navigation.args.frame)?.get(
|
|
46
|
+
const lcpMetric = metricScoresByFrameId.get(navigation.args.frame)?.get(navigation)?.get(MetricName.LCP);
|
|
47
47
|
const lcpEvent = lcpMetric?.event;
|
|
48
|
-
if (!lcpEvent || !Types.Events.
|
|
48
|
+
if (!lcpEvent || !Types.Events.isAnyLargestContentfulPaintCandidate(lcpEvent)) {
|
|
49
49
|
continue;
|
|
50
50
|
}
|
|
51
51
|
const nodeId = lcpEvent.args.data?.nodeId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LargestImagePaintHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/LargestImagePaintHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,IAAI,IAAI,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAC,IAAI,IAAI,mBAAmB,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAGpF;;;;;;;;;;;;;;;;;;IAkBI;AACJ,IAAI,6BAA6B,GAC7B,IAAI,GAAG,EAAoG,CAAC;AAChH,IAAI,wBAAwB,GAAG,IAAI,GAAG,EAAgD,CAAC;AAEvF,MAAM,UAAU,KAAK;IACnB,6BAA6B,GAAG,IAAI,GAAG,EAAE,CAAC;IAC1C,wBAAwB,GAAG,IAAI,GAAG,EAAE,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAyB;IACnD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,4BAA4B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC1E,OAAO;IACT,CAAC;IAED,MAAM,mBAAmB,GACrB,QAAQ,CAAC,YAAY,CAAC,cAAc,CAAC,6BAA6B,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IACpG,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAC,WAAW,EAAE,yBAAyB,EAAC,GAAG,QAAQ,EAAE,CAAC;IAC5D,MAAM,qBAAqB,GAAG,mBAAmB,EAAE,CAAC,qBAAqB,CAAC;IAE1E,KAAK,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,IAAI,yBAAyB,EAAE,CAAC;QACnE,MAAM,SAAS,GAAG,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"LargestImagePaintHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/LargestImagePaintHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,IAAI,IAAI,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAC,IAAI,IAAI,mBAAmB,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAGpF;;;;;;;;;;;;;;;;;;IAkBI;AACJ,IAAI,6BAA6B,GAC7B,IAAI,GAAG,EAAoG,CAAC;AAChH,IAAI,wBAAwB,GAAG,IAAI,GAAG,EAAgD,CAAC;AAEvF,MAAM,UAAU,KAAK;IACnB,6BAA6B,GAAG,IAAI,GAAG,EAAE,CAAC;IAC1C,wBAAwB,GAAG,IAAI,GAAG,EAAE,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAyB;IACnD,IAAI,CAAC,KAAK,CAAC,MAAM,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AAG,CAAC,MAAM,CAAC,CAAC;QACxF,MAAM,MAAM,GAAG,kBAAkB,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;QACvD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,SAAS;QACX,CAAC;QAED,MAAM,SAAS,GAAG,UAAU,EAAE,EAAE,IAAI,WAAW,CAAC,GAAG,CAAC;QACpD,MAAM,OAAO,GAAG,kBAAkB,CAAC,EAAE,CAAC;QAEtC,IAAI,UAAU,CAAC;QACf,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,IAAI,OAAO,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC;gBAC3B,SAAS;YACX,CAAC;YACD,IAAI,OAAO,CAAC,EAAE,IAAI,OAAO,EAAE,CAAC;gBAC1B,MAAM;YACR,CAAC;YAED,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,EAAE,CAAC;gBAChG,UAAU,GAAG,OAAO,CAAC;gBACrB,MAAM;YACR,CAAC;QACH,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,wBAAwB,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;AACH,CAAC;AAMD,MAAM,UAAU,IAAI;IAClB,OAAO,EAAC,wBAAwB,EAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;AACxD,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as Types from '../types/types.js';\n\nimport {data as metaData} from './MetaHandler.js';\nimport {data as networkRequestsData} from './NetworkRequestsHandler.js';\nimport {data as pageLoadMetricsData, MetricName} from './PageLoadMetricsHandler.js';\nimport type {HandlerName} from './types.js';\n\n/**\n * If the LCP resource was an image, and that image was fetched over the\n * network, we want to be able to find the network request in order to construct\n * the critical path for an LCP image.\n * Within the trace file there are `LargestImagePaint::Candidate` events.\n * Within their data object, they contain a `DOMNodeId` property, which maps to\n * the DOM Node ID for that image.\n *\n * This id maps exactly to the `data.nodeId` property that a\n * `LargestContentfulPaint::Candidate` will have. So, when we find an image\n * paint candidate, we can store it, keying it on the node ID.\n * Then, when it comes to finding the network request for an LCP image, we can\n * use the nodeId from the LCP candidate to find the image candidate. That image\n * candidate also contains a `imageUrl` property, which will have the full URL\n * to the image.\n *\n * `BackendNodeId`s are only unique within a given renderer process, so this is\n * also keyed on `ProcessId`.\n **/\nlet imagePaintsByNodeIdAndProcess =\n new Map<Types.Events.ProcessID, Map<Protocol.DOM.BackendNodeId, Types.Events.LargestImagePaintCandidate>>();\nlet lcpRequestByNavigationId = new Map<string, Types.Events.SyntheticNetworkRequest>();\n\nexport function reset(): void {\n imagePaintsByNodeIdAndProcess = new Map();\n lcpRequestByNavigationId = new Map();\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n if (!Types.Events.isLargestImagePaintCandidate(event) || !event.args.data) {\n return;\n }\n\n const imagePaintsByNodeId =\n Platform.MapUtilities.getWithDefault(imagePaintsByNodeIdAndProcess, event.pid, () => new Map());\n imagePaintsByNodeId.set(event.args.data.DOMNodeId, event);\n}\n\nexport async function finalize(): Promise<void> {\n const requests = networkRequestsData().byTime;\n const {traceBounds, navigationsByNavigationId} = metaData();\n const metricScoresByFrameId = pageLoadMetricsData().metricScoresByFrameId;\n\n for (const [navigationId, navigation] of navigationsByNavigationId) {\n const lcpMetric = metricScoresByFrameId.get(navigation.args.frame)?.get(navigation)?.get(MetricName.LCP);\n const lcpEvent = lcpMetric?.event;\n if (!lcpEvent || !Types.Events.isAnyLargestContentfulPaintCandidate(lcpEvent)) {\n continue;\n }\n\n const nodeId = lcpEvent.args.data?.nodeId;\n if (!nodeId) {\n continue;\n }\n\n const lcpImagePaintEvent = imagePaintsByNodeIdAndProcess.get(lcpEvent.pid)?.get(nodeId);\n const lcpUrl = lcpImagePaintEvent?.args.data?.imageUrl;\n if (!lcpUrl) {\n continue;\n }\n\n const startTime = navigation?.ts ?? traceBounds.min;\n const endTime = lcpImagePaintEvent.ts;\n\n let lcpRequest;\n for (const request of requests) {\n if (request.ts < startTime) {\n continue;\n }\n if (request.ts >= endTime) {\n break;\n }\n\n if (request.args.data.url === lcpUrl || request.args.data.redirects.some(r => r.url === lcpUrl)) {\n lcpRequest = request;\n break;\n }\n }\n\n if (lcpRequest) {\n lcpRequestByNavigationId.set(navigationId, lcpRequest);\n }\n }\n}\n\nexport interface LargestImagePaintData {\n lcpRequestByNavigationId: Map<string, Types.Events.SyntheticNetworkRequest>;\n}\n\nexport function data(): LargestImagePaintData {\n return {lcpRequestByNavigationId};\n}\n\nexport function deps(): HandlerName[] {\n return ['Meta', 'NetworkRequests', 'PageLoadMetrics'];\n}\n"]}
|
|
@@ -396,7 +396,7 @@ async function buildLayoutShiftsClusters() {
|
|
|
396
396
|
// Update the cluster's worst layout shift.
|
|
397
397
|
if (worstShiftEvent) {
|
|
398
398
|
cluster.worstShiftEvent = worstShiftEvent;
|
|
399
|
-
cluster.rawSourceEvent = worstShiftEvent;
|
|
399
|
+
cluster.rawSourceEvent = worstShiftEvent.rawSourceEvent;
|
|
400
400
|
}
|
|
401
401
|
// layout shifts are already sorted by time ascending.
|
|
402
402
|
// Capture the time range of the cluster.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutShiftsHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/LayoutShiftsHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7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,KAAK,CAAC;AACf,CAAC;AAED,qCAAqC;AACrC,MAAM,CAAN,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,iEAAQ,CAAA;IACR,6FAAuB,CAAA;IACvB,kEAAU,CAAA;AACZ,CAAC,EAJW,qBAAqB,KAArB,qBAAqB,QAIhC","sourcesContent":["// Copyright 2022 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport {data as metaHandlerData} from './MetaHandler.js';\nimport {ScoreClassification} from './PageLoadMetricsHandler.js';\nimport {data as screenshotsHandlerData} from './ScreenshotsHandler.js';\nimport type {HandlerName} from './types.js';\n\n// We start with a score of zero and step through all Layout Shift records from\n// all renderers. Each record not only tells us which renderer it is, but also\n// the unweighted and weighted scores. The unweighted score is the score we would\n// get if the renderer were the only one in the viewport. The weighted score, on\n// the other hand, accounts for how much of the viewport that particular render\n// takes up when the shift happened. An ad frame in the corner of the viewport\n// that shifts is considered less disruptive, therefore, than if it were taking\n// up the whole viewport.\n//\n// Next, we step through all the records from all renderers and add the weighted\n// score to a running total across all of the renderers. We create a new \"cluster\"\n// and reset the running total when:\n//\n// 1. We observe a outermost frame navigation, or\n// 2. When there's a gap between records of > 1s, or\n// 3. When there's more than 5 seconds of continuous layout shifting.\n//\n// Note that for it to be Cumulative Layout Shift in the sense described in the\n// documentation we would need to guarantee that we are tracking from navigation\n// to unload. However, we don't make any such guarantees here (since a developer\n// can record and stop when they please), so we support the cluster approach,\n// and we can give them a score, but it is effectively a \"session\" score, a\n// score for the given recording, and almost certainly not the\n// navigation-to-unload CLS score.\n\ninterface LayoutShiftsData {\n clusters: readonly Types.Events.SyntheticLayoutShiftCluster[];\n clustersByNavigationId: Map<Types.Events.NavigationId, Types.Events.SyntheticLayoutShiftCluster[]>;\n sessionMaxScore: number;\n // The session window which contains the SessionMaxScore\n clsWindowID: number;\n // We use these to calculate root causes for a given LayoutShift\n prePaintEvents: readonly Types.Events.PrePaint[];\n paintImageEvents: Types.Events.PaintImage[];\n layoutInvalidationEvents: readonly Types.Events.LayoutInvalidationTracking[];\n scheduleStyleInvalidationEvents: readonly Types.Events.ScheduleStyleInvalidationTracking[];\n styleRecalcInvalidationEvents: readonly Types.Events.StyleRecalcInvalidationTracking[];\n renderFrameImplCreateChildFrameEvents: readonly Types.Events.RenderFrameImplCreateChildFrame[];\n domLoadingEvents: readonly Types.Events.DomLoading[];\n layoutImageUnsizedEvents: readonly Types.Events.LayoutImageUnsized[];\n remoteFonts: readonly RemoteFont[];\n scoreRecords: readonly ScoreRecord[];\n backendNodeIds: Set<Protocol.DOM.BackendNodeId>;\n}\n\ninterface RemoteFont {\n display: string;\n url?: string;\n name?: string;\n beginRemoteFontLoadEvent: Types.Events.BeginRemoteFontLoad;\n}\n\n/**\n * This represents the maximum #time we will allow a cluster to go before we\n * reset it.\n **/\nexport const MAX_CLUSTER_DURATION = Helpers.Timing.milliToMicro(Types.Timing.Milli(5000));\n\n/**\n * This represents the maximum #time we will allow between layout shift events\n * before considering it to be the start of a new cluster.\n **/\nexport const MAX_SHIFT_TIME_DELTA = Helpers.Timing.milliToMicro(Types.Timing.Milli(1000));\n\n// Layout shifts are reported globally to the developer, irrespective of which\n// frame they originated in. However, each process does have its own individual\n// CLS score, so we need to segment by process. This means Layout Shifts from\n// sites with one process (no subframes, or subframes from the same origin)\n// will be reported together. In the case of multiple renderers (frames across\n// different origins), we offer the developer the ability to switch renderer in\n// the UI.\nlet layoutShiftEvents: Types.Events.LayoutShift[] = [];\n\n// These events denote potential node resizings. We store them to link captured\n// layout shifts to the resizing of unsized elements.\nlet layoutInvalidationEvents: Types.Events.LayoutInvalidationTracking[] = [];\nlet scheduleStyleInvalidationEvents: Types.Events.ScheduleStyleInvalidationTracking[] = [];\nlet styleRecalcInvalidationEvents: Types.Events.StyleRecalcInvalidationTracking[] = [];\nlet renderFrameImplCreateChildFrameEvents: Types.Events.RenderFrameImplCreateChildFrame[] = [];\nlet domLoadingEvents: Types.Events.DomLoading[] = [];\nlet layoutImageUnsizedEvents: Types.Events.LayoutImageUnsized[] = [];\nlet remoteFonts: RemoteFont[] = [];\n\nlet backendNodeIds = new Set<Protocol.DOM.BackendNodeId>();\n\n// Layout shifts happen during PrePaint as part of the rendering lifecycle.\n// We determine if a LayoutInvalidation event is a potential root cause of a layout\n// shift if the next PrePaint after the LayoutInvalidation is the parent\n// node of such shift.\nlet prePaintEvents: Types.Events.PrePaint[] = [];\n\nlet paintImageEvents: Types.Events.PaintImage[] = [];\n\nlet sessionMaxScore = 0;\n\nlet clsWindowID = -1;\n\nlet clusters: Types.Events.SyntheticLayoutShiftCluster[] = [];\nlet clustersByNavigationId = new Map<Types.Events.NavigationId, Types.Events.SyntheticLayoutShiftCluster[]>();\n\n/**\n * Represents a point in time in which a LS score change\n * was recorded.\n **/\ninterface ScoreRecord {\n ts: number;\n score: number;\n}\n\n// The complete timeline of LS score changes in a trace.\n// Includes drops to 0 when session windows end.\nlet scoreRecords: ScoreRecord[] = [];\n\nexport function reset(): void {\n layoutShiftEvents = [];\n layoutInvalidationEvents = [];\n scheduleStyleInvalidationEvents = [];\n styleRecalcInvalidationEvents = [];\n prePaintEvents = [];\n paintImageEvents = [];\n renderFrameImplCreateChildFrameEvents = [];\n layoutImageUnsizedEvents = [];\n domLoadingEvents = [];\n remoteFonts = [];\n backendNodeIds = new Set();\n clusters = [];\n sessionMaxScore = 0;\n scoreRecords = [];\n clsWindowID = -1;\n clustersByNavigationId = new Map();\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n if (Types.Events.isLayoutShift(event) && !event.args.data?.had_recent_input) {\n layoutShiftEvents.push(event);\n return;\n }\n if (Types.Events.isLayoutInvalidationTracking(event)) {\n layoutInvalidationEvents.push(event);\n return;\n }\n if (Types.Events.isScheduleStyleInvalidationTracking(event)) {\n scheduleStyleInvalidationEvents.push(event);\n }\n if (Types.Events.isStyleRecalcInvalidationTracking(event)) {\n styleRecalcInvalidationEvents.push(event);\n }\n if (Types.Events.isPrePaint(event)) {\n prePaintEvents.push(event);\n return;\n }\n if (Types.Events.isRenderFrameImplCreateChildFrame(event)) {\n renderFrameImplCreateChildFrameEvents.push(event);\n }\n if (Types.Events.isDomLoading(event)) {\n domLoadingEvents.push(event);\n }\n if (Types.Events.isLayoutImageUnsized(event)) {\n layoutImageUnsizedEvents.push(event);\n }\n if (Types.Events.isBeginRemoteFontLoad(event)) {\n remoteFonts.push({\n display: event.args.display,\n url: event.args.url,\n beginRemoteFontLoadEvent: event,\n });\n }\n if (Types.Events.isRemoteFontLoaded(event)) {\n for (const remoteFont of remoteFonts) {\n if (remoteFont.url === event.args.url) {\n remoteFont.name = event.args.name;\n }\n }\n }\n if (Types.Events.isPaintImage(event)) {\n paintImageEvents.push(event);\n }\n}\n\nfunction traceWindowFromTime(time: Types.Timing.Micro): Types.Timing.TraceWindowMicro {\n return {\n min: time,\n max: time,\n range: Types.Timing.Micro(0),\n };\n}\n\nfunction updateTraceWindowMax(traceWindow: Types.Timing.TraceWindowMicro, newMax: Types.Timing.Micro): void {\n traceWindow.max = newMax;\n traceWindow.range = Types.Timing.Micro(traceWindow.max - traceWindow.min);\n}\n\nfunction findScreenshots(timestamp: Types.Timing.Micro): Types.Events.LayoutShiftParsedData['screenshots'] {\n const data = screenshotsHandlerData();\n if (data.screenshots) {\n const before = Helpers.Trace.findPreviousEventBeforeTimestamp(data.screenshots, timestamp);\n const after = before ? data.screenshots[data.screenshots.indexOf(before) + 1] : null;\n return {before, after};\n }\n if (data.legacySyntheticScreenshots) {\n const before = Helpers.Trace.findPreviousEventBeforeTimestamp(data.legacySyntheticScreenshots, timestamp);\n const after = before ? data.legacySyntheticScreenshots[data.legacySyntheticScreenshots.indexOf(before) + 1] : null;\n return {before, after};\n }\n // No screenshots\n return {before: null, after: null};\n}\n\nfunction buildScoreRecords(): void {\n const {traceBounds} = metaHandlerData();\n scoreRecords.push({ts: traceBounds.min, score: 0});\n\n for (const cluster of clusters) {\n let clusterScore = 0;\n if (cluster.events[0].args.data) {\n scoreRecords.push({ts: cluster.clusterWindow.min, score: cluster.events[0].args.data.weighted_score_delta});\n }\n for (let i = 0; i < cluster.events.length; i++) {\n const event = cluster.events[i];\n if (!event.args.data) {\n continue;\n }\n clusterScore += event.args.data.weighted_score_delta;\n scoreRecords.push({ts: event.ts, score: clusterScore});\n }\n scoreRecords.push({ts: cluster.clusterWindow.max, score: 0});\n }\n}\n\n/**\n * Collects backend node ids coming from LayoutShift and LayoutInvalidation\n * events.\n */\nfunction collectNodes(): void {\n backendNodeIds.clear();\n\n // Collect the node ids present in the shifts.\n for (const layoutShift of layoutShiftEvents) {\n if (!layoutShift.args.data?.impacted_nodes) {\n continue;\n }\n for (const node of layoutShift.args.data.impacted_nodes) {\n backendNodeIds.add(node.node_id);\n }\n }\n\n // Collect the node ids present in LayoutInvalidation & scheduleStyleInvalidation events.\n for (const layoutInvalidation of layoutInvalidationEvents) {\n if (!layoutInvalidation.args.data?.nodeId) {\n continue;\n }\n backendNodeIds.add(layoutInvalidation.args.data.nodeId);\n }\n for (const scheduleStyleInvalidation of scheduleStyleInvalidationEvents) {\n if (!scheduleStyleInvalidation.args.data?.nodeId) {\n continue;\n }\n backendNodeIds.add(scheduleStyleInvalidation.args.data.nodeId);\n }\n}\n\nexport async function finalize(): Promise<void> {\n // Ensure the events are sorted by #time ascending.\n layoutShiftEvents.sort((a, b) => a.ts - b.ts);\n prePaintEvents.sort((a, b) => a.ts - b.ts);\n layoutInvalidationEvents.sort((a, b) => a.ts - b.ts);\n renderFrameImplCreateChildFrameEvents.sort((a, b) => a.ts - b.ts);\n domLoadingEvents.sort((a, b) => a.ts - b.ts);\n layoutImageUnsizedEvents.sort((a, b) => a.ts - b.ts);\n remoteFonts.sort((a, b) => a.beginRemoteFontLoadEvent.ts - b.beginRemoteFontLoadEvent.ts);\n paintImageEvents.sort((a, b) => a.ts - b.ts);\n\n // Each function transforms the data used by the next, as such the invoke order\n // is important.\n await buildLayoutShiftsClusters();\n buildScoreRecords();\n collectNodes();\n}\n\nasync function buildLayoutShiftsClusters(): Promise<void> {\n const {navigationsByFrameId, mainFrameId, traceBounds} = metaHandlerData();\n const navigations = navigationsByFrameId.get(mainFrameId) || [];\n if (layoutShiftEvents.length === 0) {\n return;\n }\n let firstShiftTime = layoutShiftEvents[0].ts;\n let lastShiftTime = layoutShiftEvents[0].ts;\n let lastShiftNavigation = null;\n // Now step through each and create clusters.\n // A cluster is equivalent to a session window (see https://web.dev/cls/#what-is-cls).\n // To make the line chart clear, we explicitly demark the limits of each session window\n // by starting the cumulative score of the window at the time of the first layout shift\n // and ending it (dropping the line back to 0) when the window ends according to the\n // thresholds (MAX_CLUSTER_DURATION, MAX_SHIFT_TIME_DELTA).\n for (const event of layoutShiftEvents) {\n // First detect if either the cluster duration or the #time between this and\n // the last shift has been exceeded.\n const clusterDurationExceeded = event.ts - firstShiftTime > MAX_CLUSTER_DURATION;\n const maxTimeDeltaSinceLastShiftExceeded = event.ts - lastShiftTime > MAX_SHIFT_TIME_DELTA;\n\n // Next take a look at navigations. If between this and the last shift we have navigated,\n // note it.\n const currentShiftNavigation = Platform.ArrayUtilities.nearestIndexFromEnd(navigations, nav => nav.ts < event.ts);\n const hasNavigated = lastShiftNavigation !== currentShiftNavigation && currentShiftNavigation !== null;\n\n // If any of the above criteria are met or if we don't have any cluster yet we should\n // start a new one.\n if (clusterDurationExceeded || maxTimeDeltaSinceLastShiftExceeded || hasNavigated || !clusters.length) {\n // The cluster starts #time should be the timestamp of the first layout shift in it.\n const clusterStartTime = event.ts;\n\n // If the last session window ended because the max delta time between shifts\n // was exceeded set the endtime to MAX_SHIFT_TIME_DELTA microseconds after the\n // last shift in the session.\n const endTimeByMaxSessionDuration = clusterDurationExceeded ? firstShiftTime + MAX_CLUSTER_DURATION : Infinity;\n\n // If the last session window ended because the max session duration was\n // surpassed, set the endtime so that the window length = MAX_CLUSTER_DURATION;\n const endTimeByMaxShiftGap = maxTimeDeltaSinceLastShiftExceeded ? lastShiftTime + MAX_SHIFT_TIME_DELTA : Infinity;\n\n // If there was a navigation during the last window, close it at the time\n // of the navigation.\n const endTimeByNavigation = hasNavigated ? navigations[currentShiftNavigation].ts : Infinity;\n\n // End the previous cluster at the time of the first of the criteria above that was met.\n const previousClusterEndTime = Math.min(endTimeByMaxSessionDuration, endTimeByMaxShiftGap, endTimeByNavigation);\n\n // If there is an existing cluster update its closing time.\n if (clusters.length > 0) {\n const currentCluster = clusters[clusters.length - 1];\n updateTraceWindowMax(currentCluster.clusterWindow, Types.Timing.Micro(previousClusterEndTime));\n }\n\n // If this cluster happened after a navigation, set the navigationId to\n // the current navigation. This lets us easily group clusters by\n // navigation.\n const navigationId = currentShiftNavigation === null ?\n Types.Events.NO_NAVIGATION :\n navigations[currentShiftNavigation].args.data?.navigationId;\n // TODO: `navigationId` is `string | undefined`, but the undefined portion\n // comes from `data.navigationId`. I don't think that is possible for this\n // event type. Can we make this typing stronger? In the meantime, we allow\n // `navigationId` to include undefined values.\n\n clusters.push(Helpers.SyntheticEvents.SyntheticEventsManager\n .registerSyntheticEvent<Types.Events.SyntheticLayoutShiftCluster>({\n name: 'SyntheticLayoutShiftCluster',\n // Will be replaced by the worst layout shift in the next for loop.\n rawSourceEvent: event,\n events: [],\n clusterWindow: traceWindowFromTime(clusterStartTime),\n clusterCumulativeScore: 0,\n scoreWindows: {\n good: traceWindowFromTime(clusterStartTime),\n },\n navigationId,\n // Set default Event so that this event is treated accordingly for the track appender.\n ts: event.ts,\n pid: event.pid,\n tid: event.tid,\n ph: Types.Events.Phase.COMPLETE,\n cat: '',\n dur: Types.Timing.Micro(-1), // This `cluster.dur` is updated below.\n }));\n\n firstShiftTime = clusterStartTime;\n }\n\n // Given the above we should have a cluster available, so pick the most\n // recent one and append the shift, bump its score and window values accordingly.\n const currentCluster = clusters[clusters.length - 1];\n const timeFromNavigation = currentShiftNavigation !== null ?\n Types.Timing.Micro(event.ts - navigations[currentShiftNavigation].ts) :\n undefined;\n\n currentCluster.clusterCumulativeScore += event.args.data ? event.args.data.weighted_score_delta : 0;\n if (!event.args.data) {\n continue;\n }\n const shift =\n Helpers.SyntheticEvents.SyntheticEventsManager.registerSyntheticEvent<Types.Events.SyntheticLayoutShift>({\n rawSourceEvent: event,\n ...event,\n name: Types.Events.Name.SYNTHETIC_LAYOUT_SHIFT,\n args: {\n frame: event.args.frame,\n data: {\n ...event.args.data,\n rawEvent: event,\n navigationId: currentCluster.navigationId ?? undefined,\n },\n },\n parsedData: {\n timeFromNavigation,\n screenshots: findScreenshots(event.ts),\n cumulativeWeightedScoreInWindow: currentCluster.clusterCumulativeScore,\n // The score of the session window is temporarily set to 0 just\n // to initialize it. Since we need to get the score of all shifts\n // in the session window to determine its value, its definite\n // value is set when stepping through the built clusters.\n sessionWindowData: {cumulativeWindowScore: 0, id: clusters.length},\n },\n });\n currentCluster.events.push(shift);\n updateTraceWindowMax(currentCluster.clusterWindow, event.ts);\n\n lastShiftTime = event.ts;\n lastShiftNavigation = currentShiftNavigation;\n }\n\n // Now step through each cluster and set up the times at which the value\n // goes from Good, to needs improvement, to Bad. Note that if there is a\n // large jump we may go from Good to Bad without ever creating a Needs\n // Improvement window at all.\n for (const cluster of clusters) {\n let weightedScore = 0;\n let windowID = -1;\n // If this is the last cluster update its window. The cluster duration is determined\n // by the minimum between: time to next navigation, trace end time, time to maximum\n // cluster duration and time to maximum gap between layout shifts.\n if (cluster === clusters[clusters.length - 1]) {\n const clusterEndByMaxDuration = MAX_CLUSTER_DURATION + cluster.clusterWindow.min;\n const clusterEndByMaxGap = cluster.clusterWindow.max + MAX_SHIFT_TIME_DELTA;\n const nextNavigationIndex =\n Platform.ArrayUtilities.nearestIndexFromBeginning(navigations, nav => nav.ts > cluster.clusterWindow.max);\n const nextNavigationTime = nextNavigationIndex ? navigations[nextNavigationIndex].ts : Infinity;\n const clusterEnd = Math.min(clusterEndByMaxDuration, clusterEndByMaxGap, traceBounds.max, nextNavigationTime);\n updateTraceWindowMax(cluster.clusterWindow, Types.Timing.Micro(clusterEnd));\n }\n\n let largestScore = 0;\n let worstShiftEvent: Types.Events.Event|null = null;\n\n for (const shift of cluster.events) {\n weightedScore += shift.args.data ? shift.args.data.weighted_score_delta : 0;\n windowID = shift.parsedData.sessionWindowData.id;\n const ts = shift.ts;\n // Update the the CLS score of this shift's session window now that\n // we have it.\n shift.parsedData.sessionWindowData.cumulativeWindowScore = cluster.clusterCumulativeScore;\n if (weightedScore < LayoutShiftsThreshold.NEEDS_IMPROVEMENT) {\n // Expand the Good window.\n updateTraceWindowMax(cluster.scoreWindows.good, ts);\n } else if (\n weightedScore >= LayoutShiftsThreshold.NEEDS_IMPROVEMENT && weightedScore < LayoutShiftsThreshold.BAD) {\n if (!cluster.scoreWindows.needsImprovement) {\n // Close the Good window, and open the needs improvement window.\n updateTraceWindowMax(cluster.scoreWindows.good, Types.Timing.Micro(ts - 1));\n cluster.scoreWindows.needsImprovement = traceWindowFromTime(ts);\n }\n\n // Expand the needs improvement window.\n updateTraceWindowMax(cluster.scoreWindows.needsImprovement, ts);\n } else if (weightedScore >= LayoutShiftsThreshold.BAD) {\n if (!cluster.scoreWindows.bad) {\n // We may jump from Good to Bad here, so update whichever window is open.\n if (cluster.scoreWindows.needsImprovement) {\n updateTraceWindowMax(cluster.scoreWindows.needsImprovement, Types.Timing.Micro(ts - 1));\n } else {\n updateTraceWindowMax(cluster.scoreWindows.good, Types.Timing.Micro(ts - 1));\n }\n\n cluster.scoreWindows.bad = traceWindowFromTime(shift.ts);\n }\n\n // Expand the Bad window.\n updateTraceWindowMax(cluster.scoreWindows.bad, ts);\n }\n\n // At this point the windows are set by the timestamps of the events, but the\n // next cluster begins at the timestamp of its first event. As such we now\n // need to expand the score window to the end of the cluster, and we do so\n // by using the Bad widow if it's there, or the NI window, or finally the\n // Good window.\n if (cluster.scoreWindows.bad) {\n updateTraceWindowMax(cluster.scoreWindows.bad, cluster.clusterWindow.max);\n } else if (cluster.scoreWindows.needsImprovement) {\n updateTraceWindowMax(cluster.scoreWindows.needsImprovement, cluster.clusterWindow.max);\n } else {\n updateTraceWindowMax(cluster.scoreWindows.good, cluster.clusterWindow.max);\n }\n\n // Find the worst layout shift of the cluster.\n const score = shift.args.data?.weighted_score_delta;\n if (score !== undefined && score > largestScore) {\n largestScore = score;\n worstShiftEvent = shift;\n }\n }\n // Update the cluster's worst layout shift.\n if (worstShiftEvent) {\n cluster.worstShiftEvent = worstShiftEvent;\n cluster.rawSourceEvent = worstShiftEvent;\n }\n\n // layout shifts are already sorted by time ascending.\n // Capture the time range of the cluster.\n cluster.ts = cluster.events[0].ts;\n const lastShiftTimings = Helpers.Timing.eventTimingsMicroSeconds(cluster.events[cluster.events.length - 1]);\n // Add MAX_SHIFT_TIME_DELTA, the section gap after the last layout shift. This marks the end of the cluster.\n cluster.dur = Types.Timing.Micro((lastShiftTimings.endTime - cluster.events[0].ts) + MAX_SHIFT_TIME_DELTA);\n\n if (weightedScore > sessionMaxScore) {\n clsWindowID = windowID;\n sessionMaxScore = weightedScore;\n }\n\n if (cluster.navigationId) {\n const clustersForId = Platform.MapUtilities.getWithDefault(clustersByNavigationId, cluster.navigationId, () => {\n return [];\n });\n clustersForId.push(cluster);\n }\n }\n}\n\nexport function data(): LayoutShiftsData {\n return {\n clusters,\n sessionMaxScore,\n clsWindowID,\n prePaintEvents,\n layoutInvalidationEvents,\n scheduleStyleInvalidationEvents,\n styleRecalcInvalidationEvents,\n renderFrameImplCreateChildFrameEvents,\n domLoadingEvents,\n layoutImageUnsizedEvents,\n remoteFonts,\n scoreRecords,\n backendNodeIds,\n clustersByNavigationId,\n paintImageEvents,\n };\n}\n\nexport function deps(): HandlerName[] {\n return ['Screenshots', 'Meta'];\n}\n\nexport function scoreClassificationForLayoutShift(score: number): ScoreClassification {\n let state = ScoreClassification.GOOD;\n if (score >= LayoutShiftsThreshold.NEEDS_IMPROVEMENT) {\n state = ScoreClassification.OK;\n }\n\n if (score >= LayoutShiftsThreshold.BAD) {\n state = ScoreClassification.BAD;\n }\n\n return state;\n}\n\n/** Based on https://web.dev/cls/ **/\nexport enum LayoutShiftsThreshold {\n GOOD = 0,\n NEEDS_IMPROVEMENT = 0.1,\n BAD = 0.25,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LayoutShiftsHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/LayoutShiftsHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,IAAI,IAAI,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,IAAI,IAAI,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAuDvE;;;IAGI;AACJ,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAE1F;;;IAGI;AACJ,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAE1F,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,UAAU;AACV,IAAI,iBAAiB,GAA+B,EAAE,CAAC;AAEvD,+EAA+E;AAC/E,qDAAqD;AACrD,IAAI,wBAAwB,GAA8C,EAAE,CAAC;AAC7E,IAAI,+BAA+B,GA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;IAClB,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,KAAa;IAC7D,IAAI,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC;IACrC,IAAI,KAAK,IAAI,qBAAqB,CAAC,iBAAiB,EAAE,CAAC;QACrD,KAAK,GAAG,mBAAmB,CAAC,EAAE,CAAC;IACjC,CAAC;IAED,IAAI,KAAK,IAAI,qBAAqB,CAAC,GAAG,EAAE,CAAC;QACvC,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC;IAClC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,qCAAqC;AACrC,MAAM,CAAN,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,iEAAQ,CAAA;IACR,6FAAuB,CAAA;IACvB,kEAAU,CAAA;AACZ,CAAC,EAJW,qBAAqB,KAArB,qBAAqB,QAIhC","sourcesContent":["// Copyright 2022 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport {data as metaHandlerData} from './MetaHandler.js';\nimport {ScoreClassification} from './PageLoadMetricsHandler.js';\nimport {data as screenshotsHandlerData} from './ScreenshotsHandler.js';\nimport type {HandlerName} from './types.js';\n\n// We start with a score of zero and step through all Layout Shift records from\n// all renderers. Each record not only tells us which renderer it is, but also\n// the unweighted and weighted scores. The unweighted score is the score we would\n// get if the renderer were the only one in the viewport. The weighted score, on\n// the other hand, accounts for how much of the viewport that particular render\n// takes up when the shift happened. An ad frame in the corner of the viewport\n// that shifts is considered less disruptive, therefore, than if it were taking\n// up the whole viewport.\n//\n// Next, we step through all the records from all renderers and add the weighted\n// score to a running total across all of the renderers. We create a new \"cluster\"\n// and reset the running total when:\n//\n// 1. We observe a outermost frame navigation, or\n// 2. When there's a gap between records of > 1s, or\n// 3. When there's more than 5 seconds of continuous layout shifting.\n//\n// Note that for it to be Cumulative Layout Shift in the sense described in the\n// documentation we would need to guarantee that we are tracking from navigation\n// to unload. However, we don't make any such guarantees here (since a developer\n// can record and stop when they please), so we support the cluster approach,\n// and we can give them a score, but it is effectively a \"session\" score, a\n// score for the given recording, and almost certainly not the\n// navigation-to-unload CLS score.\n\ninterface LayoutShiftsData {\n clusters: readonly Types.Events.SyntheticLayoutShiftCluster[];\n clustersByNavigationId: Map<Types.Events.NavigationId, Types.Events.SyntheticLayoutShiftCluster[]>;\n sessionMaxScore: number;\n // The session window which contains the SessionMaxScore\n clsWindowID: number;\n // We use these to calculate root causes for a given LayoutShift\n prePaintEvents: readonly Types.Events.PrePaint[];\n paintImageEvents: Types.Events.PaintImage[];\n layoutInvalidationEvents: readonly Types.Events.LayoutInvalidationTracking[];\n scheduleStyleInvalidationEvents: readonly Types.Events.ScheduleStyleInvalidationTracking[];\n styleRecalcInvalidationEvents: readonly Types.Events.StyleRecalcInvalidationTracking[];\n renderFrameImplCreateChildFrameEvents: readonly Types.Events.RenderFrameImplCreateChildFrame[];\n domLoadingEvents: readonly Types.Events.DomLoading[];\n layoutImageUnsizedEvents: readonly Types.Events.LayoutImageUnsized[];\n remoteFonts: readonly RemoteFont[];\n scoreRecords: readonly ScoreRecord[];\n backendNodeIds: Set<Protocol.DOM.BackendNodeId>;\n}\n\ninterface RemoteFont {\n display: string;\n url?: string;\n name?: string;\n beginRemoteFontLoadEvent: Types.Events.BeginRemoteFontLoad;\n}\n\n/**\n * This represents the maximum #time we will allow a cluster to go before we\n * reset it.\n **/\nexport const MAX_CLUSTER_DURATION = Helpers.Timing.milliToMicro(Types.Timing.Milli(5000));\n\n/**\n * This represents the maximum #time we will allow between layout shift events\n * before considering it to be the start of a new cluster.\n **/\nexport const MAX_SHIFT_TIME_DELTA = Helpers.Timing.milliToMicro(Types.Timing.Milli(1000));\n\n// Layout shifts are reported globally to the developer, irrespective of which\n// frame they originated in. However, each process does have its own individual\n// CLS score, so we need to segment by process. This means Layout Shifts from\n// sites with one process (no subframes, or subframes from the same origin)\n// will be reported together. In the case of multiple renderers (frames across\n// different origins), we offer the developer the ability to switch renderer in\n// the UI.\nlet layoutShiftEvents: Types.Events.LayoutShift[] = [];\n\n// These events denote potential node resizings. We store them to link captured\n// layout shifts to the resizing of unsized elements.\nlet layoutInvalidationEvents: Types.Events.LayoutInvalidationTracking[] = [];\nlet scheduleStyleInvalidationEvents: Types.Events.ScheduleStyleInvalidationTracking[] = [];\nlet styleRecalcInvalidationEvents: Types.Events.StyleRecalcInvalidationTracking[] = [];\nlet renderFrameImplCreateChildFrameEvents: Types.Events.RenderFrameImplCreateChildFrame[] = [];\nlet domLoadingEvents: Types.Events.DomLoading[] = [];\nlet layoutImageUnsizedEvents: Types.Events.LayoutImageUnsized[] = [];\nlet remoteFonts: RemoteFont[] = [];\n\nlet backendNodeIds = new Set<Protocol.DOM.BackendNodeId>();\n\n// Layout shifts happen during PrePaint as part of the rendering lifecycle.\n// We determine if a LayoutInvalidation event is a potential root cause of a layout\n// shift if the next PrePaint after the LayoutInvalidation is the parent\n// node of such shift.\nlet prePaintEvents: Types.Events.PrePaint[] = [];\n\nlet paintImageEvents: Types.Events.PaintImage[] = [];\n\nlet sessionMaxScore = 0;\n\nlet clsWindowID = -1;\n\nlet clusters: Types.Events.SyntheticLayoutShiftCluster[] = [];\nlet clustersByNavigationId = new Map<Types.Events.NavigationId, Types.Events.SyntheticLayoutShiftCluster[]>();\n\n/**\n * Represents a point in time in which a LS score change\n * was recorded.\n **/\ninterface ScoreRecord {\n ts: number;\n score: number;\n}\n\n// The complete timeline of LS score changes in a trace.\n// Includes drops to 0 when session windows end.\nlet scoreRecords: ScoreRecord[] = [];\n\nexport function reset(): void {\n layoutShiftEvents = [];\n layoutInvalidationEvents = [];\n scheduleStyleInvalidationEvents = [];\n styleRecalcInvalidationEvents = [];\n prePaintEvents = [];\n paintImageEvents = [];\n renderFrameImplCreateChildFrameEvents = [];\n layoutImageUnsizedEvents = [];\n domLoadingEvents = [];\n remoteFonts = [];\n backendNodeIds = new Set();\n clusters = [];\n sessionMaxScore = 0;\n scoreRecords = [];\n clsWindowID = -1;\n clustersByNavigationId = new Map();\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n if (Types.Events.isLayoutShift(event) && !event.args.data?.had_recent_input) {\n layoutShiftEvents.push(event);\n return;\n }\n if (Types.Events.isLayoutInvalidationTracking(event)) {\n layoutInvalidationEvents.push(event);\n return;\n }\n if (Types.Events.isScheduleStyleInvalidationTracking(event)) {\n scheduleStyleInvalidationEvents.push(event);\n }\n if (Types.Events.isStyleRecalcInvalidationTracking(event)) {\n styleRecalcInvalidationEvents.push(event);\n }\n if (Types.Events.isPrePaint(event)) {\n prePaintEvents.push(event);\n return;\n }\n if (Types.Events.isRenderFrameImplCreateChildFrame(event)) {\n renderFrameImplCreateChildFrameEvents.push(event);\n }\n if (Types.Events.isDomLoading(event)) {\n domLoadingEvents.push(event);\n }\n if (Types.Events.isLayoutImageUnsized(event)) {\n layoutImageUnsizedEvents.push(event);\n }\n if (Types.Events.isBeginRemoteFontLoad(event)) {\n remoteFonts.push({\n display: event.args.display,\n url: event.args.url,\n beginRemoteFontLoadEvent: event,\n });\n }\n if (Types.Events.isRemoteFontLoaded(event)) {\n for (const remoteFont of remoteFonts) {\n if (remoteFont.url === event.args.url) {\n remoteFont.name = event.args.name;\n }\n }\n }\n if (Types.Events.isPaintImage(event)) {\n paintImageEvents.push(event);\n }\n}\n\nfunction traceWindowFromTime(time: Types.Timing.Micro): Types.Timing.TraceWindowMicro {\n return {\n min: time,\n max: time,\n range: Types.Timing.Micro(0),\n };\n}\n\nfunction updateTraceWindowMax(traceWindow: Types.Timing.TraceWindowMicro, newMax: Types.Timing.Micro): void {\n traceWindow.max = newMax;\n traceWindow.range = Types.Timing.Micro(traceWindow.max - traceWindow.min);\n}\n\nfunction findScreenshots(timestamp: Types.Timing.Micro): Types.Events.LayoutShiftParsedData['screenshots'] {\n const data = screenshotsHandlerData();\n if (data.screenshots) {\n const before = Helpers.Trace.findPreviousEventBeforeTimestamp(data.screenshots, timestamp);\n const after = before ? data.screenshots[data.screenshots.indexOf(before) + 1] : null;\n return {before, after};\n }\n if (data.legacySyntheticScreenshots) {\n const before = Helpers.Trace.findPreviousEventBeforeTimestamp(data.legacySyntheticScreenshots, timestamp);\n const after = before ? data.legacySyntheticScreenshots[data.legacySyntheticScreenshots.indexOf(before) + 1] : null;\n return {before, after};\n }\n // No screenshots\n return {before: null, after: null};\n}\n\nfunction buildScoreRecords(): void {\n const {traceBounds} = metaHandlerData();\n scoreRecords.push({ts: traceBounds.min, score: 0});\n\n for (const cluster of clusters) {\n let clusterScore = 0;\n if (cluster.events[0].args.data) {\n scoreRecords.push({ts: cluster.clusterWindow.min, score: cluster.events[0].args.data.weighted_score_delta});\n }\n for (let i = 0; i < cluster.events.length; i++) {\n const event = cluster.events[i];\n if (!event.args.data) {\n continue;\n }\n clusterScore += event.args.data.weighted_score_delta;\n scoreRecords.push({ts: event.ts, score: clusterScore});\n }\n scoreRecords.push({ts: cluster.clusterWindow.max, score: 0});\n }\n}\n\n/**\n * Collects backend node ids coming from LayoutShift and LayoutInvalidation\n * events.\n */\nfunction collectNodes(): void {\n backendNodeIds.clear();\n\n // Collect the node ids present in the shifts.\n for (const layoutShift of layoutShiftEvents) {\n if (!layoutShift.args.data?.impacted_nodes) {\n continue;\n }\n for (const node of layoutShift.args.data.impacted_nodes) {\n backendNodeIds.add(node.node_id);\n }\n }\n\n // Collect the node ids present in LayoutInvalidation & scheduleStyleInvalidation events.\n for (const layoutInvalidation of layoutInvalidationEvents) {\n if (!layoutInvalidation.args.data?.nodeId) {\n continue;\n }\n backendNodeIds.add(layoutInvalidation.args.data.nodeId);\n }\n for (const scheduleStyleInvalidation of scheduleStyleInvalidationEvents) {\n if (!scheduleStyleInvalidation.args.data?.nodeId) {\n continue;\n }\n backendNodeIds.add(scheduleStyleInvalidation.args.data.nodeId);\n }\n}\n\nexport async function finalize(): Promise<void> {\n // Ensure the events are sorted by #time ascending.\n layoutShiftEvents.sort((a, b) => a.ts - b.ts);\n prePaintEvents.sort((a, b) => a.ts - b.ts);\n layoutInvalidationEvents.sort((a, b) => a.ts - b.ts);\n renderFrameImplCreateChildFrameEvents.sort((a, b) => a.ts - b.ts);\n domLoadingEvents.sort((a, b) => a.ts - b.ts);\n layoutImageUnsizedEvents.sort((a, b) => a.ts - b.ts);\n remoteFonts.sort((a, b) => a.beginRemoteFontLoadEvent.ts - b.beginRemoteFontLoadEvent.ts);\n paintImageEvents.sort((a, b) => a.ts - b.ts);\n\n // Each function transforms the data used by the next, as such the invoke order\n // is important.\n await buildLayoutShiftsClusters();\n buildScoreRecords();\n collectNodes();\n}\n\nasync function buildLayoutShiftsClusters(): Promise<void> {\n const {navigationsByFrameId, mainFrameId, traceBounds} = metaHandlerData();\n const navigations = navigationsByFrameId.get(mainFrameId) || [];\n if (layoutShiftEvents.length === 0) {\n return;\n }\n let firstShiftTime = layoutShiftEvents[0].ts;\n let lastShiftTime = layoutShiftEvents[0].ts;\n let lastShiftNavigation = null;\n // Now step through each and create clusters.\n // A cluster is equivalent to a session window (see https://web.dev/cls/#what-is-cls).\n // To make the line chart clear, we explicitly demark the limits of each session window\n // by starting the cumulative score of the window at the time of the first layout shift\n // and ending it (dropping the line back to 0) when the window ends according to the\n // thresholds (MAX_CLUSTER_DURATION, MAX_SHIFT_TIME_DELTA).\n for (const event of layoutShiftEvents) {\n // First detect if either the cluster duration or the #time between this and\n // the last shift has been exceeded.\n const clusterDurationExceeded = event.ts - firstShiftTime > MAX_CLUSTER_DURATION;\n const maxTimeDeltaSinceLastShiftExceeded = event.ts - lastShiftTime > MAX_SHIFT_TIME_DELTA;\n\n // Next take a look at navigations. If between this and the last shift we have navigated,\n // note it.\n const currentShiftNavigation = Platform.ArrayUtilities.nearestIndexFromEnd(navigations, nav => nav.ts < event.ts);\n const hasNavigated = lastShiftNavigation !== currentShiftNavigation && currentShiftNavigation !== null;\n\n // If any of the above criteria are met or if we don't have any cluster yet we should\n // start a new one.\n if (clusterDurationExceeded || maxTimeDeltaSinceLastShiftExceeded || hasNavigated || !clusters.length) {\n // The cluster starts #time should be the timestamp of the first layout shift in it.\n const clusterStartTime = event.ts;\n\n // If the last session window ended because the max delta time between shifts\n // was exceeded set the endtime to MAX_SHIFT_TIME_DELTA microseconds after the\n // last shift in the session.\n const endTimeByMaxSessionDuration = clusterDurationExceeded ? firstShiftTime + MAX_CLUSTER_DURATION : Infinity;\n\n // If the last session window ended because the max session duration was\n // surpassed, set the endtime so that the window length = MAX_CLUSTER_DURATION;\n const endTimeByMaxShiftGap = maxTimeDeltaSinceLastShiftExceeded ? lastShiftTime + MAX_SHIFT_TIME_DELTA : Infinity;\n\n // If there was a navigation during the last window, close it at the time\n // of the navigation.\n const endTimeByNavigation = hasNavigated ? navigations[currentShiftNavigation].ts : Infinity;\n\n // End the previous cluster at the time of the first of the criteria above that was met.\n const previousClusterEndTime = Math.min(endTimeByMaxSessionDuration, endTimeByMaxShiftGap, endTimeByNavigation);\n\n // If there is an existing cluster update its closing time.\n if (clusters.length > 0) {\n const currentCluster = clusters[clusters.length - 1];\n updateTraceWindowMax(currentCluster.clusterWindow, Types.Timing.Micro(previousClusterEndTime));\n }\n\n // If this cluster happened after a navigation, set the navigationId to\n // the current navigation. This lets us easily group clusters by\n // navigation.\n const navigationId = currentShiftNavigation === null ?\n Types.Events.NO_NAVIGATION :\n navigations[currentShiftNavigation].args.data?.navigationId;\n // TODO: `navigationId` is `string | undefined`, but the undefined portion\n // comes from `data.navigationId`. I don't think that is possible for this\n // event type. Can we make this typing stronger? In the meantime, we allow\n // `navigationId` to include undefined values.\n\n clusters.push(Helpers.SyntheticEvents.SyntheticEventsManager\n .registerSyntheticEvent<Types.Events.SyntheticLayoutShiftCluster>({\n name: 'SyntheticLayoutShiftCluster',\n // Will be replaced by the worst layout shift in the next for loop.\n rawSourceEvent: event,\n events: [],\n clusterWindow: traceWindowFromTime(clusterStartTime),\n clusterCumulativeScore: 0,\n scoreWindows: {\n good: traceWindowFromTime(clusterStartTime),\n },\n navigationId,\n // Set default Event so that this event is treated accordingly for the track appender.\n ts: event.ts,\n pid: event.pid,\n tid: event.tid,\n ph: Types.Events.Phase.COMPLETE,\n cat: '',\n dur: Types.Timing.Micro(-1), // This `cluster.dur` is updated below.\n }));\n\n firstShiftTime = clusterStartTime;\n }\n\n // Given the above we should have a cluster available, so pick the most\n // recent one and append the shift, bump its score and window values accordingly.\n const currentCluster = clusters[clusters.length - 1];\n const timeFromNavigation = currentShiftNavigation !== null ?\n Types.Timing.Micro(event.ts - navigations[currentShiftNavigation].ts) :\n undefined;\n\n currentCluster.clusterCumulativeScore += event.args.data ? event.args.data.weighted_score_delta : 0;\n if (!event.args.data) {\n continue;\n }\n const shift =\n Helpers.SyntheticEvents.SyntheticEventsManager.registerSyntheticEvent<Types.Events.SyntheticLayoutShift>({\n rawSourceEvent: event,\n ...event,\n name: Types.Events.Name.SYNTHETIC_LAYOUT_SHIFT,\n args: {\n frame: event.args.frame,\n data: {\n ...event.args.data,\n rawEvent: event,\n navigationId: currentCluster.navigationId ?? undefined,\n },\n },\n parsedData: {\n timeFromNavigation,\n screenshots: findScreenshots(event.ts),\n cumulativeWeightedScoreInWindow: currentCluster.clusterCumulativeScore,\n // The score of the session window is temporarily set to 0 just\n // to initialize it. Since we need to get the score of all shifts\n // in the session window to determine its value, its definite\n // value is set when stepping through the built clusters.\n sessionWindowData: {cumulativeWindowScore: 0, id: clusters.length},\n },\n });\n currentCluster.events.push(shift);\n updateTraceWindowMax(currentCluster.clusterWindow, event.ts);\n\n lastShiftTime = event.ts;\n lastShiftNavigation = currentShiftNavigation;\n }\n\n // Now step through each cluster and set up the times at which the value\n // goes from Good, to needs improvement, to Bad. Note that if there is a\n // large jump we may go from Good to Bad without ever creating a Needs\n // Improvement window at all.\n for (const cluster of clusters) {\n let weightedScore = 0;\n let windowID = -1;\n // If this is the last cluster update its window. The cluster duration is determined\n // by the minimum between: time to next navigation, trace end time, time to maximum\n // cluster duration and time to maximum gap between layout shifts.\n if (cluster === clusters[clusters.length - 1]) {\n const clusterEndByMaxDuration = MAX_CLUSTER_DURATION + cluster.clusterWindow.min;\n const clusterEndByMaxGap = cluster.clusterWindow.max + MAX_SHIFT_TIME_DELTA;\n const nextNavigationIndex =\n Platform.ArrayUtilities.nearestIndexFromBeginning(navigations, nav => nav.ts > cluster.clusterWindow.max);\n const nextNavigationTime = nextNavigationIndex ? navigations[nextNavigationIndex].ts : Infinity;\n const clusterEnd = Math.min(clusterEndByMaxDuration, clusterEndByMaxGap, traceBounds.max, nextNavigationTime);\n updateTraceWindowMax(cluster.clusterWindow, Types.Timing.Micro(clusterEnd));\n }\n\n let largestScore = 0;\n let worstShiftEvent: Types.Events.SyntheticLayoutShift|null = null;\n\n for (const shift of cluster.events) {\n weightedScore += shift.args.data ? shift.args.data.weighted_score_delta : 0;\n windowID = shift.parsedData.sessionWindowData.id;\n const ts = shift.ts;\n // Update the the CLS score of this shift's session window now that\n // we have it.\n shift.parsedData.sessionWindowData.cumulativeWindowScore = cluster.clusterCumulativeScore;\n if (weightedScore < LayoutShiftsThreshold.NEEDS_IMPROVEMENT) {\n // Expand the Good window.\n updateTraceWindowMax(cluster.scoreWindows.good, ts);\n } else if (\n weightedScore >= LayoutShiftsThreshold.NEEDS_IMPROVEMENT && weightedScore < LayoutShiftsThreshold.BAD) {\n if (!cluster.scoreWindows.needsImprovement) {\n // Close the Good window, and open the needs improvement window.\n updateTraceWindowMax(cluster.scoreWindows.good, Types.Timing.Micro(ts - 1));\n cluster.scoreWindows.needsImprovement = traceWindowFromTime(ts);\n }\n\n // Expand the needs improvement window.\n updateTraceWindowMax(cluster.scoreWindows.needsImprovement, ts);\n } else if (weightedScore >= LayoutShiftsThreshold.BAD) {\n if (!cluster.scoreWindows.bad) {\n // We may jump from Good to Bad here, so update whichever window is open.\n if (cluster.scoreWindows.needsImprovement) {\n updateTraceWindowMax(cluster.scoreWindows.needsImprovement, Types.Timing.Micro(ts - 1));\n } else {\n updateTraceWindowMax(cluster.scoreWindows.good, Types.Timing.Micro(ts - 1));\n }\n\n cluster.scoreWindows.bad = traceWindowFromTime(shift.ts);\n }\n\n // Expand the Bad window.\n updateTraceWindowMax(cluster.scoreWindows.bad, ts);\n }\n\n // At this point the windows are set by the timestamps of the events, but the\n // next cluster begins at the timestamp of its first event. As such we now\n // need to expand the score window to the end of the cluster, and we do so\n // by using the Bad widow if it's there, or the NI window, or finally the\n // Good window.\n if (cluster.scoreWindows.bad) {\n updateTraceWindowMax(cluster.scoreWindows.bad, cluster.clusterWindow.max);\n } else if (cluster.scoreWindows.needsImprovement) {\n updateTraceWindowMax(cluster.scoreWindows.needsImprovement, cluster.clusterWindow.max);\n } else {\n updateTraceWindowMax(cluster.scoreWindows.good, cluster.clusterWindow.max);\n }\n\n // Find the worst layout shift of the cluster.\n const score = shift.args.data?.weighted_score_delta;\n if (score !== undefined && score > largestScore) {\n largestScore = score;\n worstShiftEvent = shift;\n }\n }\n // Update the cluster's worst layout shift.\n if (worstShiftEvent) {\n cluster.worstShiftEvent = worstShiftEvent;\n cluster.rawSourceEvent = worstShiftEvent.rawSourceEvent;\n }\n\n // layout shifts are already sorted by time ascending.\n // Capture the time range of the cluster.\n cluster.ts = cluster.events[0].ts;\n const lastShiftTimings = Helpers.Timing.eventTimingsMicroSeconds(cluster.events[cluster.events.length - 1]);\n // Add MAX_SHIFT_TIME_DELTA, the section gap after the last layout shift. This marks the end of the cluster.\n cluster.dur = Types.Timing.Micro((lastShiftTimings.endTime - cluster.events[0].ts) + MAX_SHIFT_TIME_DELTA);\n\n if (weightedScore > sessionMaxScore) {\n clsWindowID = windowID;\n sessionMaxScore = weightedScore;\n }\n\n if (cluster.navigationId) {\n const clustersForId = Platform.MapUtilities.getWithDefault(clustersByNavigationId, cluster.navigationId, () => {\n return [];\n });\n clustersForId.push(cluster);\n }\n }\n}\n\nexport function data(): LayoutShiftsData {\n return {\n clusters,\n sessionMaxScore,\n clsWindowID,\n prePaintEvents,\n layoutInvalidationEvents,\n scheduleStyleInvalidationEvents,\n styleRecalcInvalidationEvents,\n renderFrameImplCreateChildFrameEvents,\n domLoadingEvents,\n layoutImageUnsizedEvents,\n remoteFonts,\n scoreRecords,\n backendNodeIds,\n clustersByNavigationId,\n paintImageEvents,\n };\n}\n\nexport function deps(): HandlerName[] {\n return ['Screenshots', 'Meta'];\n}\n\nexport function scoreClassificationForLayoutShift(score: number): ScoreClassification {\n let state = ScoreClassification.GOOD;\n if (score >= LayoutShiftsThreshold.NEEDS_IMPROVEMENT) {\n state = ScoreClassification.OK;\n }\n\n if (score >= LayoutShiftsThreshold.BAD) {\n state = ScoreClassification.BAD;\n }\n\n return state;\n}\n\n/** Based on https://web.dev/cls/ **/\nexport enum LayoutShiftsThreshold {\n GOOD = 0,\n NEEDS_IMPROVEMENT = 0.1,\n BAD = 0.25,\n}\n"]}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as Types from '../types/types.js';
|
|
2
|
+
import type { FinalizeOptions } from './types.js';
|
|
2
3
|
export declare function reset(): void;
|
|
3
4
|
export declare function handleEvent(event: Types.Events.Event): void;
|
|
4
|
-
export declare function finalize(): Promise<void>;
|
|
5
|
+
export declare function finalize(options?: FinalizeOptions): Promise<void>;
|
|
5
6
|
export interface MetaHandlerData {
|
|
7
|
+
config: {
|
|
8
|
+
showAllEvents: boolean;
|
|
9
|
+
};
|
|
6
10
|
traceIsGeneric: boolean;
|
|
7
11
|
traceBounds: Types.Timing.TraceWindowMicro;
|
|
8
12
|
browserProcessId: Types.Events.ProcessID;
|
|
@@ -10,7 +14,14 @@ export interface MetaHandlerData {
|
|
|
10
14
|
browserThreadId: Types.Events.ThreadID;
|
|
11
15
|
gpuProcessId: Types.Events.ProcessID;
|
|
12
16
|
navigationsByFrameId: Map<string, Types.Events.NavigationStart[]>;
|
|
17
|
+
/**
|
|
18
|
+
* This does not include soft navigations.
|
|
19
|
+
*
|
|
20
|
+
* TODO(crbug.com/414468047): include soft navs here, so that
|
|
21
|
+
* PageLoadMetricsHandler and insights can use this map for all navigation types.
|
|
22
|
+
*/
|
|
13
23
|
navigationsByNavigationId: Map<string, Types.Events.NavigationStart>;
|
|
24
|
+
softNavigationsById: Map<number, Types.Events.SoftNavigationStart>;
|
|
14
25
|
/**
|
|
15
26
|
* The user-visible URL displayed to users in the address bar.
|
|
16
27
|
* This captures:
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as Platform from '../../../core/platform/platform.js';
|
|
5
5
|
import * as Helpers from '../helpers/helpers.js';
|
|
6
6
|
import * as Types from '../types/types.js';
|
|
7
|
+
let config;
|
|
7
8
|
// We track the renderer processes we see in each frame on the way through the trace.
|
|
8
9
|
let rendererProcessesByFrameId = new Map();
|
|
9
10
|
// We will often want to key data by Frame IDs, and commonly we'll care most
|
|
@@ -46,6 +47,7 @@ let traceBounds = makeNewTraceBounds();
|
|
|
46
47
|
*/
|
|
47
48
|
let navigationsByFrameId = new Map();
|
|
48
49
|
let navigationsByNavigationId = new Map();
|
|
50
|
+
let softNavigationsById = new Map();
|
|
49
51
|
let finalDisplayUrlByNavigationId = new Map();
|
|
50
52
|
let mainFrameNavigations = [];
|
|
51
53
|
// Represents all the threads in the trace, organized by process. This is mostly for internal
|
|
@@ -75,6 +77,7 @@ const CHROME_WEB_TRACE_EVENTS = new Set([
|
|
|
75
77
|
export function reset() {
|
|
76
78
|
navigationsByFrameId = new Map();
|
|
77
79
|
navigationsByNavigationId = new Map();
|
|
80
|
+
softNavigationsById = new Map();
|
|
78
81
|
finalDisplayUrlByNavigationId = new Map();
|
|
79
82
|
processNames = new Map();
|
|
80
83
|
mainFrameNavigations = [];
|
|
@@ -275,6 +278,9 @@ export function handleEvent(event) {
|
|
|
275
278
|
}
|
|
276
279
|
return;
|
|
277
280
|
}
|
|
281
|
+
if (Types.Events.isSoftNavigationStart(event)) {
|
|
282
|
+
softNavigationsById.set(event.args.context.performanceTimelineNavigationId, event);
|
|
283
|
+
}
|
|
278
284
|
// Update `finalDisplayUrlByNavigationId` to reflect the latest redirect for each navigation.
|
|
279
285
|
if (Types.Events.isResourceSendRequest(event)) {
|
|
280
286
|
if (event.args.data.resourceType !== 'Document') {
|
|
@@ -299,7 +305,8 @@ export function handleEvent(event) {
|
|
|
299
305
|
return;
|
|
300
306
|
}
|
|
301
307
|
}
|
|
302
|
-
export async function finalize() {
|
|
308
|
+
export async function finalize(options) {
|
|
309
|
+
config = { showAllEvents: Boolean(options?.showAllEvents) };
|
|
303
310
|
// We try to set the minimum time by finding the event with the smallest
|
|
304
311
|
// timestamp. However, if we also got a timestamp from the
|
|
305
312
|
// TracingStartedInBrowser event, we should always use that.
|
|
@@ -378,6 +385,7 @@ export async function finalize() {
|
|
|
378
385
|
}
|
|
379
386
|
export function data() {
|
|
380
387
|
return {
|
|
388
|
+
config,
|
|
381
389
|
traceBounds,
|
|
382
390
|
browserProcessId,
|
|
383
391
|
browserThreadId,
|
|
@@ -390,6 +398,7 @@ export function data() {
|
|
|
390
398
|
mainFrameURL,
|
|
391
399
|
navigationsByFrameId,
|
|
392
400
|
navigationsByNavigationId,
|
|
401
|
+
softNavigationsById,
|
|
393
402
|
finalDisplayUrlByNavigationId,
|
|
394
403
|
threadsInProcess,
|
|
395
404
|
rendererProcessesByFrame: rendererProcessesByFrameId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/MetaHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,qFAAqF;AACrF,IAAI,0BAA0B,GAAqB,I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G,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACvF,IAAI,iBAAiB,EAAE,CAAC;QACtB,MAAM,2BAA2B,GAAG,iBAAiB,CAAC,EAAE,GAAG,WAAW,CAAC,GAAG,GAAG,qBAAqB,CAAC;QACnG,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB;YACnG,2BAA2B,EAAE,CAAC;YAChC,YAAY,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;QAC/D,CAAC;IACH,CAAC;AACH,CAAC;AAgED,MAAM,UAAU,IAAI;IAClB,OAAO;QACL,WAAW;QACX,gBAAgB;QAChB,eAAe;QACf,YAAY;QACZ,YAAY;QACZ,WAAW,EAAE,WAAW,KAAK,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW;QAChF,YAAY,EAAE,YAAY,IAAI,SAAS;QACvC,gBAAgB,EAAE,gBAAgB,IAAI,SAAS;QAC/C,WAAW;QACX,YAAY;QACZ,oBAAoB;QACpB,yBAAyB;QACzB,6BAA6B;QAC7B,gBAAgB;QAChB,wBAAwB,EAAE,0BAA0B;QACpD,mBAAmB;QACnB,gBAAgB,EAAE,iBAAiB;QACnC,oBAAoB;QACpB,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\n// We track the renderer processes we see in each frame on the way through the trace.\nlet rendererProcessesByFrameId: FrameProcessData = new Map();\n\n// We will often want to key data by Frame IDs, and commonly we'll care most\n// about the main frame's ID, so we store and expose that.\nlet mainFrameId = '';\nlet mainFrameURL = '';\n\nlet framesByProcessId = new Map<Types.Events.ProcessID, Map<string, Types.Events.TraceFrame>>();\n\n// We will often want to key data by the browser process, GPU process and top\n// level renderer IDs, so keep a track on those.\nlet browserProcessId: Types.Events.ProcessID = Types.Events.ProcessID(-1);\nlet browserThreadId: Types.Events.ThreadID = Types.Events.ThreadID(-1);\nlet gpuProcessId: Types.Events.ProcessID = Types.Events.ProcessID(-1);\nlet gpuThreadId: Types.Events.ThreadID = Types.Events.ThreadID(-1);\nlet viewportRect: {x: number, y: number, width: number, height: number}|null = null;\nlet devicePixelRatio: number|null = null;\n\nlet processNames = new Map<Types.Events.ProcessID, Types.Events.ProcessName>();\n\nlet topLevelRendererIds = new Set<Types.Events.ProcessID>();\n\nfunction makeNewTraceBounds(): Types.Timing.TraceWindowMicro {\n return {\n min: Types.Timing.Micro(Number.POSITIVE_INFINITY),\n max: Types.Timing.Micro(Number.NEGATIVE_INFINITY),\n range: Types.Timing.Micro(Number.POSITIVE_INFINITY),\n };\n}\nlet traceBounds: Types.Timing.TraceWindowMicro = makeNewTraceBounds();\n\n/**\n * These represent the user navigating. Values such as First Contentful Paint,\n * etc, are relative to the navigation.\n *\n * We store navigation events both by the frame and navigation ID. This means\n * when we need to look them up, we can use whichever ID we have.\n *\n * Note that these Maps will have the same values in them; these are just keyed\n * differently to make look-ups easier.\n *\n * We also additionally maintain an array of only navigations that occurred on\n * the main frame. In many places in the UI we only care about highlighting\n * main frame navigations, so calculating this list here is better than\n * filtering either of the below maps over and over again at the UI layer.\n */\nlet navigationsByFrameId = new Map<string, Types.Events.NavigationStart[]>();\nlet navigationsByNavigationId = new Map<string, Types.Events.NavigationStart>();\nlet finalDisplayUrlByNavigationId = new Map<string, string>();\nlet mainFrameNavigations: Types.Events.NavigationStart[] = [];\n\n// Represents all the threads in the trace, organized by process. This is mostly for internal\n// bookkeeping so that during the finalize pass we can obtain the main and browser thread IDs.\nlet threadsInProcess = new Map<Types.Events.ProcessID, Map<Types.Events.ThreadID, Types.Events.ThreadName>>();\n\nlet traceStartedTimeFromTracingStartedEvent = Types.Timing.Micro(-1);\nconst eventPhasesOfInterestForTraceBounds = new Set([\n Types.Events.Phase.BEGIN,\n Types.Events.Phase.END,\n Types.Events.Phase.COMPLETE,\n Types.Events.Phase.INSTANT,\n]);\n\n// Tracks if the trace is a generic trace, which here means that it did not come from athe DevTools Performance Panel recording.\n// We assume a trace is generic, and mark it as not generic if we see any of:\n// - TracingStartedInPage\n// - TracingStartedInBrowser\n// - TracingSessionIdForWorker\n// - CpuProfile\n// These are all events which indicate this is a Chrome browser trace.\nlet traceIsGeneric = true;\nconst CHROME_WEB_TRACE_EVENTS = new Set([\n Types.Events.Name.TRACING_STARTED_IN_PAGE,\n Types.Events.Name.TRACING_SESSION_ID_FOR_WORKER,\n Types.Events.Name.TRACING_STARTED_IN_BROWSER,\n Types.Events.Name.CPU_PROFILE,\n]);\n\nexport function reset(): void {\n navigationsByFrameId = new Map();\n navigationsByNavigationId = new Map();\n finalDisplayUrlByNavigationId = new Map();\n processNames = new Map();\n mainFrameNavigations = [];\n\n browserProcessId = Types.Events.ProcessID(-1);\n browserThreadId = Types.Events.ThreadID(-1);\n gpuProcessId = Types.Events.ProcessID(-1);\n gpuThreadId = Types.Events.ThreadID(-1);\n viewportRect = null;\n topLevelRendererIds = new Set();\n threadsInProcess = new Map();\n rendererProcessesByFrameId = new Map();\n framesByProcessId = new Map();\n\n traceBounds = makeNewTraceBounds();\n traceStartedTimeFromTracingStartedEvent = Types.Timing.Micro(-1);\n\n traceIsGeneric = true;\n}\n\nfunction updateRendererProcessByFrame(event: Types.Events.Event, frame: Types.Events.TraceFrame): void {\n const framesInProcessById = Platform.MapUtilities.getWithDefault(framesByProcessId, frame.processId, () => new Map());\n framesInProcessById.set(frame.frame, frame);\n\n const rendererProcessInFrame = Platform.MapUtilities.getWithDefault(\n rendererProcessesByFrameId, frame.frame,\n () => new Map<\n Types.Events.ProcessID, Array<{frame: Types.Events.TraceFrame, window: Types.Timing.TraceWindowMicro}>>());\n const rendererProcessInfo = Platform.MapUtilities.getWithDefault(rendererProcessInFrame, frame.processId, () => {\n return [];\n });\n const lastProcessData = rendererProcessInfo.at(-1);\n\n // Only store a new entry if the URL changed, otherwise it's just\n // redundant information.\n if (lastProcessData && lastProcessData.frame.url === frame.url) {\n return;\n }\n // For now we store the time of the event as the min. In the finalize we step\n // through each of these windows and update their max and range values.\n rendererProcessInfo.push({\n frame,\n window: {\n min: event.ts,\n max: Types.Timing.Micro(0),\n range: Types.Timing.Micro(0),\n },\n });\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n if (traceIsGeneric && CHROME_WEB_TRACE_EVENTS.has(event.name as Types.Events.Name)) {\n traceIsGeneric = false;\n }\n\n if (Types.Events.isProcessName(event)) {\n processNames.set(event.pid, event);\n }\n\n // If there is a timestamp (which meta events do not have), and the event does\n // not end with ::UMA then it, and the event is in the set of valid phases,\n // then it should be included for the purposes of calculating the trace bounds.\n // The UMA events in particular seem to be reported on page unloading, which\n // often extends the bounds of the trace unhelpfully.\n if (event.ts !== 0 && !event.name.endsWith('::UMA') && eventPhasesOfInterestForTraceBounds.has(event.ph)) {\n traceBounds.min = Types.Timing.Micro(Math.min(event.ts, traceBounds.min));\n const eventDuration = event.dur ?? Types.Timing.Micro(0);\n traceBounds.max = Types.Timing.Micro(Math.max(event.ts + eventDuration, traceBounds.max));\n }\n\n if (Types.Events.isProcessName(event) && (event.args.name === 'Browser' || event.args.name === 'HeadlessBrowser')) {\n browserProcessId = event.pid;\n return;\n }\n\n if (Types.Events.isProcessName(event) && (event.args.name === 'Gpu' || event.args.name === 'GPU Process')) {\n gpuProcessId = event.pid;\n return;\n }\n\n if (Types.Events.isThreadName(event) && event.args.name === 'CrGpuMain') {\n gpuThreadId = event.tid;\n return;\n }\n\n if (Types.Events.isThreadName(event) && event.args.name === 'CrBrowserMain') {\n browserThreadId = event.tid;\n }\n\n if (Types.Events.isMainFrameViewport(event) && viewportRect === null) {\n const rectAsArray = event.args.data.viewport_rect;\n const viewportX = rectAsArray[0];\n const viewportY = rectAsArray[1];\n const viewportWidth = rectAsArray[2];\n const viewportHeight = rectAsArray[5];\n viewportRect = {x: viewportX, y: viewportY, width: viewportWidth, height: viewportHeight};\n devicePixelRatio = event.args.data.dpr;\n }\n\n // The TracingStartedInBrowser event includes the data on which frames are\n // in scope at the start of the trace. We use this to identify the frame with\n // no parent, i.e. the top level frame.\n if (Types.Events.isTracingStartedInBrowser(event)) {\n traceStartedTimeFromTracingStartedEvent = event.ts;\n\n if (!event.args.data) {\n throw new Error('No frames found in trace data');\n }\n\n for (const frame of (event.args.data.frames ?? [])) {\n updateRendererProcessByFrame(event, frame);\n\n if (!frame.parent) {\n topLevelRendererIds.add(frame.processId);\n }\n /**\n * The code here uses a few different methods to try to determine the main frame.\n * The ideal is that the frames have two flags present:\n *\n * 1. isOutermostMainFrame (added in April 2024 - crrev.com/c/5424783)\n * 2. isInPrimaryMainFrame (added in June 2024 - crrev.com/c/5595033)\n *\n * The frame where both of these are set to `true` is the main frame. The\n * reason we need both of these flags to have 100% confidence is because\n * with the introduction of MPArch and pre-rendering, we can have other\n * frames that are the outermost frame, but are not the primary process.\n * Relying on isOutermostMainFrame in isolation caused the engine to\n * incorrectly identify the wrong frame as main (see crbug.com/343873756).\n *\n * See https://source.chromium.org/chromium/chromium/src/+/main:docs/frame_trees.md\n * for a bit more context on FrameTrees in Chromium.\n *\n * To avoid breaking entirely for traces pre-June 2024 that don't have\n * both of these flags, we will fallback to less accurate methods:\n *\n * 1. If we have isOutermostMainFrame, we will use that\n * (and accept we might get it wrong)\n * 2. If we don't have isOutermostMainFrame, we fallback to finding a\n * frame that has a URL, but doesn't have a parent. This is a crude\n * guess at the main frame...but better than nothing and is historically\n * how DevTools identified the main frame.\n */\n\n const traceHasPrimaryMainFrameFlag = 'isInPrimaryMainFrame' in frame;\n const traceHasOutermostMainFrameFlag = 'isOutermostMainFrame' in frame;\n\n if (traceHasPrimaryMainFrameFlag && traceHasOutermostMainFrameFlag) {\n // Ideal situation: identify the main frame as the one that has both these flags set to true.\n if (frame.isInPrimaryMainFrame && frame.isOutermostMainFrame) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n } else if (traceHasOutermostMainFrameFlag) {\n // Less ideal: \"guess\" at the main thread by using this flag.\n if (frame.isOutermostMainFrame) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n // Worst case: guess by seeing if the frame doesn't have a parent, and does have a URL.\n } else if (!frame.parent && frame.url) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n }\n\n return;\n }\n\n // FrameCommittedInBrowser events tell us information about each frame\n // and we use these to track how long each individual renderer is active\n // for. We track all renderers here (top level and those in frames), but\n // for convenience we also populate a set of top level renderer IDs.\n if (Types.Events.isFrameCommittedInBrowser(event)) {\n const frame = event.args.data;\n if (!frame) {\n return;\n }\n\n updateRendererProcessByFrame(event, frame);\n\n if (frame.parent) {\n return;\n }\n\n topLevelRendererIds.add(frame.processId);\n return;\n }\n\n if (Types.Events.isCommitLoad(event)) {\n const frameData = event.args.data;\n if (!frameData) {\n return;\n }\n\n const {frame, name, url} = frameData;\n updateRendererProcessByFrame(event, {processId: event.pid, frame, name, url});\n return;\n }\n\n // Track all threads based on the process & thread IDs.\n if (Types.Events.isThreadName(event)) {\n const threads = Platform.MapUtilities.getWithDefault(threadsInProcess, event.pid, () => new Map());\n threads.set(event.tid, event);\n return;\n }\n\n // Track all navigation events. Note that there can be navigation start events\n // but where the documentLoaderURL is empty. As far as the trace rendering is\n // concerned, these events are noise so we filter them out here.\n // (The filtering of empty URLs is done in the isNavigationStart check)\n if (Types.Events.isNavigationStart(event) && event.args.data) {\n const navigationId = event.args.data.navigationId;\n if (navigationsByNavigationId.has(navigationId)) {\n // We have only ever seen this situation once, in crbug.com/1503982, where the user ran:\n // window.location.href = 'javascript:console.log(\"foo\")'\n // In this situation two identical navigationStart events are emitted with the same data, URL and ID.\n // So, in this situation we drop/ignore any subsequent navigations if we have already seen that ID.\n return;\n }\n navigationsByNavigationId.set(navigationId, event);\n finalDisplayUrlByNavigationId.set(navigationId, event.args.data.documentLoaderURL);\n\n const frameId = event.args.frame;\n const existingFrameNavigations = navigationsByFrameId.get(frameId) || [];\n existingFrameNavigations.push(event);\n navigationsByFrameId.set(frameId, existingFrameNavigations);\n if (frameId === mainFrameId) {\n mainFrameNavigations.push(event);\n }\n return;\n }\n\n // Update `finalDisplayUrlByNavigationId` to reflect the latest redirect for each navigation.\n if (Types.Events.isResourceSendRequest(event)) {\n if (event.args.data.resourceType !== 'Document') {\n return;\n }\n\n const maybeNavigationId = event.args.data.requestId;\n const navigation = navigationsByNavigationId.get(maybeNavigationId);\n if (!navigation) {\n return;\n }\n\n finalDisplayUrlByNavigationId.set(maybeNavigationId, event.args.data.url);\n return;\n }\n\n // Update `finalDisplayUrlByNavigationId` to reflect history API navigations.\n if (Types.Events.isDidCommitSameDocumentNavigation(event)) {\n if (event.args.render_frame_host.frame_type !== 'PRIMARY_MAIN_FRAME') {\n return;\n }\n\n const navigation = mainFrameNavigations.at(-1);\n const key = navigation?.args.data?.navigationId ?? '';\n finalDisplayUrlByNavigationId.set(key, event.args.url);\n return;\n }\n}\n\nexport async function finalize(): Promise<void> {\n // We try to set the minimum time by finding the event with the smallest\n // timestamp. However, if we also got a timestamp from the\n // TracingStartedInBrowser event, we should always use that.\n // But in some traces (for example, CPU profiles) we do not get that event,\n // hence why we need to check we got a timestamp from it before setting it.\n if (traceStartedTimeFromTracingStartedEvent >= 0) {\n traceBounds.min = traceStartedTimeFromTracingStartedEvent;\n }\n traceBounds.range = Types.Timing.Micro(traceBounds.max - traceBounds.min);\n\n // If we go from foo.com to example.com we will get a new renderer, and\n // therefore the \"top level renderer\" will have a different PID as it has\n // changed. Here we step through each renderer process and updated its window\n // bounds, such that we end up with the time ranges in the trace for when\n // each particular renderer started and stopped being the main renderer\n // process.\n for (const [, processWindows] of rendererProcessesByFrameId) {\n // Sort the windows by time; we cannot assume by default they arrive via\n // events in time order. Because we set the window bounds per-process based\n // on the time of the current + next window, we need them sorted in ASC\n // order.\n const processWindowValues = [...processWindows.values()].flat().sort((a, b) => {\n return a.window.min - b.window.min;\n });\n for (let i = 0; i < processWindowValues.length; i++) {\n const currentWindow = processWindowValues[i];\n const nextWindow = processWindowValues[i + 1];\n\n // For the last window we set its max to be positive infinity.\n // TODO: Move the trace bounds handler into meta so we can clamp first and last windows.\n if (!nextWindow) {\n currentWindow.window.max = Types.Timing.Micro(traceBounds.max);\n currentWindow.window.range = Types.Timing.Micro(traceBounds.max - currentWindow.window.min);\n } else {\n currentWindow.window.max = Types.Timing.Micro(nextWindow.window.min - 1);\n currentWindow.window.range = Types.Timing.Micro(currentWindow.window.max - currentWindow.window.min);\n }\n }\n }\n\n // Frame ids which we didn't register using either the TracingStartedInBrowser or\n // the FrameCommittedInBrowser events are considered noise, so we filter them out, as well\n // as the navigations that belong to such frames.\n for (const [frameId, navigations] of navigationsByFrameId) {\n // The frames in the rendererProcessesByFrameId map come only from the\n // TracingStartedInBrowser and FrameCommittedInBrowser events, so we can use it as point\n // of comparison to determine if a frameId should be discarded.\n if (rendererProcessesByFrameId.has(frameId)) {\n continue;\n }\n navigationsByFrameId.delete(frameId);\n for (const navigation of navigations) {\n if (!navigation.args.data) {\n continue;\n }\n navigationsByNavigationId.delete(navigation.args.data.navigationId);\n }\n }\n\n // Sometimes in traces the TracingStartedInBrowser event can give us an\n // incorrect initial URL for the main frame's URL - about:blank or the URL of\n // the previous page. This doesn't matter too much except we often use this\n // URL as the visual name of the trace shown to the user (e.g. in the history\n // dropdown). We can be more accurate by finding the first main frame\n // navigation, and using its URL, if we have it.\n // However, to avoid doing this in a case where the first navigation is far\n // into the trace's lifecycle, we only do this in situations where the first\n // navigation happened very soon (0.5 seconds) after the trace started\n // recording.\n const firstMainFrameNav = mainFrameNavigations.at(0);\n const firstNavTimeThreshold = Helpers.Timing.secondsToMicro(Types.Timing.Seconds(0.5));\n if (firstMainFrameNav) {\n const navigationIsWithinThreshold = firstMainFrameNav.ts - traceBounds.min < firstNavTimeThreshold;\n if (firstMainFrameNav.args.data?.isOutermostMainFrame && firstMainFrameNav.args.data?.documentLoaderURL &&\n navigationIsWithinThreshold) {\n mainFrameURL = firstMainFrameNav.args.data.documentLoaderURL;\n }\n }\n}\n\nexport interface MetaHandlerData {\n traceIsGeneric: boolean;\n traceBounds: Types.Timing.TraceWindowMicro;\n browserProcessId: Types.Events.ProcessID;\n processNames: Map<Types.Events.ProcessID, Types.Events.ProcessName>;\n browserThreadId: Types.Events.ThreadID;\n gpuProcessId: Types.Events.ProcessID;\n navigationsByFrameId: Map<string, Types.Events.NavigationStart[]>;\n navigationsByNavigationId: Map<string, Types.Events.NavigationStart>;\n /**\n * The user-visible URL displayed to users in the address bar.\n * This captures:\n * - resolving all redirects\n * - history API pushState\n *\n * Given no redirects or history API usages, this is just the navigation event's documentLoaderURL.\n *\n * Note: empty string special case denotes the duration of the trace between the start\n * and the first navigation. If there is no history API navigation during this time,\n * there will be no value for empty string.\n **/\n finalDisplayUrlByNavigationId: Map<string, string>;\n threadsInProcess: Map<Types.Events.ProcessID, Map<Types.Events.ThreadID, Types.Events.ThreadName>>;\n mainFrameId: string;\n mainFrameURL: string;\n /**\n * A frame can have multiple renderer processes, at the same time,\n * a renderer process can have multiple URLs. This map tracks the\n * processes active on a given frame, with the time window in which\n * they were active. Because a renderer process might have multiple\n * URLs, each process in each frame has an array of windows, with an\n * entry for each URL it had.\n */\n rendererProcessesByFrame: FrameProcessData;\n topLevelRendererIds: Set<Types.Events.ProcessID>;\n frameByProcessId: Map<Types.Events.ProcessID, Map<string, Types.Events.TraceFrame>>;\n mainFrameNavigations: Types.Events.NavigationStart[];\n gpuThreadId?: Types.Events.ThreadID;\n viewportRect?: {x: number, y: number, width: number, height: number};\n devicePixelRatio?: number;\n}\n\n/**\n * Each frame has a single render process at a given time but it can have\n * multiple render processes during a trace, for example if a navigation\n * occurred in the frame. This map tracks the process that was active for\n * each frame at each point in time. Also, because a process can be\n * assigned to multiple URLs, there is a window for each URL a process\n * was assigned.\n *\n * Note that different sites always end up in different render\n * processes, however two different URLs can point to the same site.\n * For example: https://google.com and https://maps.google.com point to\n * the same site.\n * Read more about this in\n * https://developer.chrome.com/articles/renderingng-architecture/#threads\n * and https://web.dev/same-site-same-origin/\n **/\nexport type FrameProcessData =\n Map<string,\n Map<Types.Events.ProcessID, Array<{frame: Types.Events.TraceFrame, window: Types.Timing.TraceWindowMicro}>>>;\n\nexport function data(): MetaHandlerData {\n return {\n traceBounds,\n browserProcessId,\n browserThreadId,\n processNames,\n gpuProcessId,\n gpuThreadId: gpuThreadId === Types.Events.ThreadID(-1) ? undefined : gpuThreadId,\n viewportRect: viewportRect || undefined,\n devicePixelRatio: devicePixelRatio ?? undefined,\n mainFrameId,\n mainFrameURL,\n navigationsByFrameId,\n navigationsByNavigationId,\n finalDisplayUrlByNavigationId,\n threadsInProcess,\n rendererProcessesByFrame: rendererProcessesByFrameId,\n topLevelRendererIds,\n frameByProcessId: framesByProcessId,\n mainFrameNavigations,\n traceIsGeneric,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MetaHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/MetaHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAI3C,IAAI,MAAgC,CAAC;AAErC,qFAAqF;AACrF,IAAI,0BAA0B,GAAqB,IAAI,GAAG,EAAE,CAAC;AAE7D,4EAA4E;AAC5E,0DAA0D;AAC1D,IA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mBAAmB;QACnB,6BAA6B;QAC7B,gBAAgB;QAChB,wBAAwB,EAAE,0BAA0B;QACpD,mBAAmB;QACnB,gBAAgB,EAAE,iBAAiB;QACnC,oBAAoB;QACpB,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport type {FinalizeOptions} from './types.js';\n\nlet config: {showAllEvents: boolean};\n\n// We track the renderer processes we see in each frame on the way through the trace.\nlet rendererProcessesByFrameId: FrameProcessData = new Map();\n\n// We will often want to key data by Frame IDs, and commonly we'll care most\n// about the main frame's ID, so we store and expose that.\nlet mainFrameId = '';\nlet mainFrameURL = '';\n\nlet framesByProcessId = new Map<Types.Events.ProcessID, Map<string, Types.Events.TraceFrame>>();\n\n// We will often want to key data by the browser process, GPU process and top\n// level renderer IDs, so keep a track on those.\nlet browserProcessId: Types.Events.ProcessID = Types.Events.ProcessID(-1);\nlet browserThreadId: Types.Events.ThreadID = Types.Events.ThreadID(-1);\nlet gpuProcessId: Types.Events.ProcessID = Types.Events.ProcessID(-1);\nlet gpuThreadId: Types.Events.ThreadID = Types.Events.ThreadID(-1);\nlet viewportRect: {x: number, y: number, width: number, height: number}|null = null;\nlet devicePixelRatio: number|null = null;\n\nlet processNames = new Map<Types.Events.ProcessID, Types.Events.ProcessName>();\n\nlet topLevelRendererIds = new Set<Types.Events.ProcessID>();\n\nfunction makeNewTraceBounds(): Types.Timing.TraceWindowMicro {\n return {\n min: Types.Timing.Micro(Number.POSITIVE_INFINITY),\n max: Types.Timing.Micro(Number.NEGATIVE_INFINITY),\n range: Types.Timing.Micro(Number.POSITIVE_INFINITY),\n };\n}\nlet traceBounds: Types.Timing.TraceWindowMicro = makeNewTraceBounds();\n\n/**\n * These represent the user navigating. Values such as First Contentful Paint,\n * etc, are relative to the navigation.\n *\n * We store navigation events both by the frame and navigation ID. This means\n * when we need to look them up, we can use whichever ID we have.\n *\n * Note that these Maps will have the same values in them; these are just keyed\n * differently to make look-ups easier.\n *\n * We also additionally maintain an array of only navigations that occurred on\n * the main frame. In many places in the UI we only care about highlighting\n * main frame navigations, so calculating this list here is better than\n * filtering either of the below maps over and over again at the UI layer.\n */\nlet navigationsByFrameId = new Map<string, Types.Events.NavigationStart[]>();\nlet navigationsByNavigationId = new Map<string, Types.Events.NavigationStart>();\nlet softNavigationsById = new Map<number, Types.Events.SoftNavigationStart>();\nlet finalDisplayUrlByNavigationId = new Map<string, string>();\nlet mainFrameNavigations: Types.Events.NavigationStart[] = [];\n\n// Represents all the threads in the trace, organized by process. This is mostly for internal\n// bookkeeping so that during the finalize pass we can obtain the main and browser thread IDs.\nlet threadsInProcess = new Map<Types.Events.ProcessID, Map<Types.Events.ThreadID, Types.Events.ThreadName>>();\n\nlet traceStartedTimeFromTracingStartedEvent = Types.Timing.Micro(-1);\nconst eventPhasesOfInterestForTraceBounds = new Set([\n Types.Events.Phase.BEGIN,\n Types.Events.Phase.END,\n Types.Events.Phase.COMPLETE,\n Types.Events.Phase.INSTANT,\n]);\n\n// Tracks if the trace is a generic trace, which here means that it did not come from athe DevTools Performance Panel recording.\n// We assume a trace is generic, and mark it as not generic if we see any of:\n// - TracingStartedInPage\n// - TracingStartedInBrowser\n// - TracingSessionIdForWorker\n// - CpuProfile\n// These are all events which indicate this is a Chrome browser trace.\nlet traceIsGeneric = true;\nconst CHROME_WEB_TRACE_EVENTS = new Set([\n Types.Events.Name.TRACING_STARTED_IN_PAGE,\n Types.Events.Name.TRACING_SESSION_ID_FOR_WORKER,\n Types.Events.Name.TRACING_STARTED_IN_BROWSER,\n Types.Events.Name.CPU_PROFILE,\n]);\n\nexport function reset(): void {\n navigationsByFrameId = new Map();\n navigationsByNavigationId = new Map();\n softNavigationsById = new Map();\n finalDisplayUrlByNavigationId = new Map();\n processNames = new Map();\n mainFrameNavigations = [];\n\n browserProcessId = Types.Events.ProcessID(-1);\n browserThreadId = Types.Events.ThreadID(-1);\n gpuProcessId = Types.Events.ProcessID(-1);\n gpuThreadId = Types.Events.ThreadID(-1);\n viewportRect = null;\n topLevelRendererIds = new Set();\n threadsInProcess = new Map();\n rendererProcessesByFrameId = new Map();\n framesByProcessId = new Map();\n\n traceBounds = makeNewTraceBounds();\n traceStartedTimeFromTracingStartedEvent = Types.Timing.Micro(-1);\n\n traceIsGeneric = true;\n}\n\nfunction updateRendererProcessByFrame(event: Types.Events.Event, frame: Types.Events.TraceFrame): void {\n const framesInProcessById = Platform.MapUtilities.getWithDefault(framesByProcessId, frame.processId, () => new Map());\n framesInProcessById.set(frame.frame, frame);\n\n const rendererProcessInFrame = Platform.MapUtilities.getWithDefault(\n rendererProcessesByFrameId, frame.frame,\n () => new Map<\n Types.Events.ProcessID, Array<{frame: Types.Events.TraceFrame, window: Types.Timing.TraceWindowMicro}>>());\n const rendererProcessInfo = Platform.MapUtilities.getWithDefault(rendererProcessInFrame, frame.processId, () => {\n return [];\n });\n const lastProcessData = rendererProcessInfo.at(-1);\n\n // Only store a new entry if the URL changed, otherwise it's just\n // redundant information.\n if (lastProcessData && lastProcessData.frame.url === frame.url) {\n return;\n }\n // For now we store the time of the event as the min. In the finalize we step\n // through each of these windows and update their max and range values.\n rendererProcessInfo.push({\n frame,\n window: {\n min: event.ts,\n max: Types.Timing.Micro(0),\n range: Types.Timing.Micro(0),\n },\n });\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n if (traceIsGeneric && CHROME_WEB_TRACE_EVENTS.has(event.name as Types.Events.Name)) {\n traceIsGeneric = false;\n }\n\n if (Types.Events.isProcessName(event)) {\n processNames.set(event.pid, event);\n }\n\n // If there is a timestamp (which meta events do not have), and the event does\n // not end with ::UMA then it, and the event is in the set of valid phases,\n // then it should be included for the purposes of calculating the trace bounds.\n // The UMA events in particular seem to be reported on page unloading, which\n // often extends the bounds of the trace unhelpfully.\n if (event.ts !== 0 && !event.name.endsWith('::UMA') && eventPhasesOfInterestForTraceBounds.has(event.ph)) {\n traceBounds.min = Types.Timing.Micro(Math.min(event.ts, traceBounds.min));\n const eventDuration = event.dur ?? Types.Timing.Micro(0);\n traceBounds.max = Types.Timing.Micro(Math.max(event.ts + eventDuration, traceBounds.max));\n }\n\n if (Types.Events.isProcessName(event) && (event.args.name === 'Browser' || event.args.name === 'HeadlessBrowser')) {\n browserProcessId = event.pid;\n return;\n }\n\n if (Types.Events.isProcessName(event) && (event.args.name === 'Gpu' || event.args.name === 'GPU Process')) {\n gpuProcessId = event.pid;\n return;\n }\n\n if (Types.Events.isThreadName(event) && event.args.name === 'CrGpuMain') {\n gpuThreadId = event.tid;\n return;\n }\n\n if (Types.Events.isThreadName(event) && event.args.name === 'CrBrowserMain') {\n browserThreadId = event.tid;\n }\n\n if (Types.Events.isMainFrameViewport(event) && viewportRect === null) {\n const rectAsArray = event.args.data.viewport_rect;\n const viewportX = rectAsArray[0];\n const viewportY = rectAsArray[1];\n const viewportWidth = rectAsArray[2];\n const viewportHeight = rectAsArray[5];\n viewportRect = {x: viewportX, y: viewportY, width: viewportWidth, height: viewportHeight};\n devicePixelRatio = event.args.data.dpr;\n }\n\n // The TracingStartedInBrowser event includes the data on which frames are\n // in scope at the start of the trace. We use this to identify the frame with\n // no parent, i.e. the top level frame.\n if (Types.Events.isTracingStartedInBrowser(event)) {\n traceStartedTimeFromTracingStartedEvent = event.ts;\n\n if (!event.args.data) {\n throw new Error('No frames found in trace data');\n }\n\n for (const frame of (event.args.data.frames ?? [])) {\n updateRendererProcessByFrame(event, frame);\n\n if (!frame.parent) {\n topLevelRendererIds.add(frame.processId);\n }\n /**\n * The code here uses a few different methods to try to determine the main frame.\n * The ideal is that the frames have two flags present:\n *\n * 1. isOutermostMainFrame (added in April 2024 - crrev.com/c/5424783)\n * 2. isInPrimaryMainFrame (added in June 2024 - crrev.com/c/5595033)\n *\n * The frame where both of these are set to `true` is the main frame. The\n * reason we need both of these flags to have 100% confidence is because\n * with the introduction of MPArch and pre-rendering, we can have other\n * frames that are the outermost frame, but are not the primary process.\n * Relying on isOutermostMainFrame in isolation caused the engine to\n * incorrectly identify the wrong frame as main (see crbug.com/343873756).\n *\n * See https://source.chromium.org/chromium/chromium/src/+/main:docs/frame_trees.md\n * for a bit more context on FrameTrees in Chromium.\n *\n * To avoid breaking entirely for traces pre-June 2024 that don't have\n * both of these flags, we will fallback to less accurate methods:\n *\n * 1. If we have isOutermostMainFrame, we will use that\n * (and accept we might get it wrong)\n * 2. If we don't have isOutermostMainFrame, we fallback to finding a\n * frame that has a URL, but doesn't have a parent. This is a crude\n * guess at the main frame...but better than nothing and is historically\n * how DevTools identified the main frame.\n */\n\n const traceHasPrimaryMainFrameFlag = 'isInPrimaryMainFrame' in frame;\n const traceHasOutermostMainFrameFlag = 'isOutermostMainFrame' in frame;\n\n if (traceHasPrimaryMainFrameFlag && traceHasOutermostMainFrameFlag) {\n // Ideal situation: identify the main frame as the one that has both these flags set to true.\n if (frame.isInPrimaryMainFrame && frame.isOutermostMainFrame) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n } else if (traceHasOutermostMainFrameFlag) {\n // Less ideal: \"guess\" at the main thread by using this flag.\n if (frame.isOutermostMainFrame) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n // Worst case: guess by seeing if the frame doesn't have a parent, and does have a URL.\n } else if (!frame.parent && frame.url) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n }\n\n return;\n }\n\n // FrameCommittedInBrowser events tell us information about each frame\n // and we use these to track how long each individual renderer is active\n // for. We track all renderers here (top level and those in frames), but\n // for convenience we also populate a set of top level renderer IDs.\n if (Types.Events.isFrameCommittedInBrowser(event)) {\n const frame = event.args.data;\n if (!frame) {\n return;\n }\n\n updateRendererProcessByFrame(event, frame);\n\n if (frame.parent) {\n return;\n }\n\n topLevelRendererIds.add(frame.processId);\n return;\n }\n\n if (Types.Events.isCommitLoad(event)) {\n const frameData = event.args.data;\n if (!frameData) {\n return;\n }\n\n const {frame, name, url} = frameData;\n updateRendererProcessByFrame(event, {processId: event.pid, frame, name, url});\n return;\n }\n\n // Track all threads based on the process & thread IDs.\n if (Types.Events.isThreadName(event)) {\n const threads = Platform.MapUtilities.getWithDefault(threadsInProcess, event.pid, () => new Map());\n threads.set(event.tid, event);\n return;\n }\n\n // Track all navigation events. Note that there can be navigation start events\n // but where the documentLoaderURL is empty. As far as the trace rendering is\n // concerned, these events are noise so we filter them out here.\n // (The filtering of empty URLs is done in the isNavigationStart check)\n if (Types.Events.isNavigationStart(event) && event.args.data) {\n const navigationId = event.args.data.navigationId;\n if (navigationsByNavigationId.has(navigationId)) {\n // We have only ever seen this situation once, in crbug.com/1503982, where the user ran:\n // window.location.href = 'javascript:console.log(\"foo\")'\n // In this situation two identical navigationStart events are emitted with the same data, URL and ID.\n // So, in this situation we drop/ignore any subsequent navigations if we have already seen that ID.\n return;\n }\n navigationsByNavigationId.set(navigationId, event);\n finalDisplayUrlByNavigationId.set(navigationId, event.args.data.documentLoaderURL);\n\n const frameId = event.args.frame;\n const existingFrameNavigations = navigationsByFrameId.get(frameId) || [];\n existingFrameNavigations.push(event);\n navigationsByFrameId.set(frameId, existingFrameNavigations);\n if (frameId === mainFrameId) {\n mainFrameNavigations.push(event);\n }\n return;\n }\n\n if (Types.Events.isSoftNavigationStart(event)) {\n softNavigationsById.set(event.args.context.performanceTimelineNavigationId, event);\n }\n\n // Update `finalDisplayUrlByNavigationId` to reflect the latest redirect for each navigation.\n if (Types.Events.isResourceSendRequest(event)) {\n if (event.args.data.resourceType !== 'Document') {\n return;\n }\n\n const maybeNavigationId = event.args.data.requestId;\n const navigation = navigationsByNavigationId.get(maybeNavigationId);\n if (!navigation) {\n return;\n }\n\n finalDisplayUrlByNavigationId.set(maybeNavigationId, event.args.data.url);\n return;\n }\n\n // Update `finalDisplayUrlByNavigationId` to reflect history API navigations.\n if (Types.Events.isDidCommitSameDocumentNavigation(event)) {\n if (event.args.render_frame_host.frame_type !== 'PRIMARY_MAIN_FRAME') {\n return;\n }\n\n const navigation = mainFrameNavigations.at(-1);\n const key = navigation?.args.data?.navigationId ?? '';\n finalDisplayUrlByNavigationId.set(key, event.args.url);\n return;\n }\n}\n\nexport async function finalize(options?: FinalizeOptions): Promise<void> {\n config = {showAllEvents: Boolean(options?.showAllEvents)};\n\n // We try to set the minimum time by finding the event with the smallest\n // timestamp. However, if we also got a timestamp from the\n // TracingStartedInBrowser event, we should always use that.\n // But in some traces (for example, CPU profiles) we do not get that event,\n // hence why we need to check we got a timestamp from it before setting it.\n if (traceStartedTimeFromTracingStartedEvent >= 0) {\n traceBounds.min = traceStartedTimeFromTracingStartedEvent;\n }\n traceBounds.range = Types.Timing.Micro(traceBounds.max - traceBounds.min);\n\n // If we go from foo.com to example.com we will get a new renderer, and\n // therefore the \"top level renderer\" will have a different PID as it has\n // changed. Here we step through each renderer process and updated its window\n // bounds, such that we end up with the time ranges in the trace for when\n // each particular renderer started and stopped being the main renderer\n // process.\n for (const [, processWindows] of rendererProcessesByFrameId) {\n // Sort the windows by time; we cannot assume by default they arrive via\n // events in time order. Because we set the window bounds per-process based\n // on the time of the current + next window, we need them sorted in ASC\n // order.\n const processWindowValues = [...processWindows.values()].flat().sort((a, b) => {\n return a.window.min - b.window.min;\n });\n for (let i = 0; i < processWindowValues.length; i++) {\n const currentWindow = processWindowValues[i];\n const nextWindow = processWindowValues[i + 1];\n\n // For the last window we set its max to be positive infinity.\n // TODO: Move the trace bounds handler into meta so we can clamp first and last windows.\n if (!nextWindow) {\n currentWindow.window.max = Types.Timing.Micro(traceBounds.max);\n currentWindow.window.range = Types.Timing.Micro(traceBounds.max - currentWindow.window.min);\n } else {\n currentWindow.window.max = Types.Timing.Micro(nextWindow.window.min - 1);\n currentWindow.window.range = Types.Timing.Micro(currentWindow.window.max - currentWindow.window.min);\n }\n }\n }\n\n // Frame ids which we didn't register using either the TracingStartedInBrowser or\n // the FrameCommittedInBrowser events are considered noise, so we filter them out, as well\n // as the navigations that belong to such frames.\n for (const [frameId, navigations] of navigationsByFrameId) {\n // The frames in the rendererProcessesByFrameId map come only from the\n // TracingStartedInBrowser and FrameCommittedInBrowser events, so we can use it as point\n // of comparison to determine if a frameId should be discarded.\n if (rendererProcessesByFrameId.has(frameId)) {\n continue;\n }\n navigationsByFrameId.delete(frameId);\n for (const navigation of navigations) {\n if (!navigation.args.data) {\n continue;\n }\n navigationsByNavigationId.delete(navigation.args.data.navigationId);\n }\n }\n\n // Sometimes in traces the TracingStartedInBrowser event can give us an\n // incorrect initial URL for the main frame's URL - about:blank or the URL of\n // the previous page. This doesn't matter too much except we often use this\n // URL as the visual name of the trace shown to the user (e.g. in the history\n // dropdown). We can be more accurate by finding the first main frame\n // navigation, and using its URL, if we have it.\n // However, to avoid doing this in a case where the first navigation is far\n // into the trace's lifecycle, we only do this in situations where the first\n // navigation happened very soon (0.5 seconds) after the trace started\n // recording.\n const firstMainFrameNav = mainFrameNavigations.at(0);\n const firstNavTimeThreshold = Helpers.Timing.secondsToMicro(Types.Timing.Seconds(0.5));\n if (firstMainFrameNav) {\n const navigationIsWithinThreshold = firstMainFrameNav.ts - traceBounds.min < firstNavTimeThreshold;\n if (firstMainFrameNav.args.data?.isOutermostMainFrame && firstMainFrameNav.args.data?.documentLoaderURL &&\n navigationIsWithinThreshold) {\n mainFrameURL = firstMainFrameNav.args.data.documentLoaderURL;\n }\n }\n}\n\nexport interface MetaHandlerData {\n config: {showAllEvents: boolean};\n traceIsGeneric: boolean;\n traceBounds: Types.Timing.TraceWindowMicro;\n browserProcessId: Types.Events.ProcessID;\n processNames: Map<Types.Events.ProcessID, Types.Events.ProcessName>;\n browserThreadId: Types.Events.ThreadID;\n gpuProcessId: Types.Events.ProcessID;\n navigationsByFrameId: Map<string, Types.Events.NavigationStart[]>;\n /**\n * This does not include soft navigations.\n *\n * TODO(crbug.com/414468047): include soft navs here, so that\n * PageLoadMetricsHandler and insights can use this map for all navigation types.\n */\n navigationsByNavigationId: Map<string, Types.Events.NavigationStart>;\n softNavigationsById: Map<number, Types.Events.SoftNavigationStart>;\n /**\n * The user-visible URL displayed to users in the address bar.\n * This captures:\n * - resolving all redirects\n * - history API pushState\n *\n * Given no redirects or history API usages, this is just the navigation event's documentLoaderURL.\n *\n * Note: empty string special case denotes the duration of the trace between the start\n * and the first navigation. If there is no history API navigation during this time,\n * there will be no value for empty string.\n **/\n finalDisplayUrlByNavigationId: Map<string, string>;\n threadsInProcess: Map<Types.Events.ProcessID, Map<Types.Events.ThreadID, Types.Events.ThreadName>>;\n mainFrameId: string;\n mainFrameURL: string;\n /**\n * A frame can have multiple renderer processes, at the same time,\n * a renderer process can have multiple URLs. This map tracks the\n * processes active on a given frame, with the time window in which\n * they were active. Because a renderer process might have multiple\n * URLs, each process in each frame has an array of windows, with an\n * entry for each URL it had.\n */\n rendererProcessesByFrame: FrameProcessData;\n topLevelRendererIds: Set<Types.Events.ProcessID>;\n frameByProcessId: Map<Types.Events.ProcessID, Map<string, Types.Events.TraceFrame>>;\n mainFrameNavigations: Types.Events.NavigationStart[];\n gpuThreadId?: Types.Events.ThreadID;\n viewportRect?: {x: number, y: number, width: number, height: number};\n devicePixelRatio?: number;\n}\n\n/**\n * Each frame has a single render process at a given time but it can have\n * multiple render processes during a trace, for example if a navigation\n * occurred in the frame. This map tracks the process that was active for\n * each frame at each point in time. Also, because a process can be\n * assigned to multiple URLs, there is a window for each URL a process\n * was assigned.\n *\n * Note that different sites always end up in different render\n * processes, however two different URLs can point to the same site.\n * For example: https://google.com and https://maps.google.com point to\n * the same site.\n * Read more about this in\n * https://developer.chrome.com/articles/renderingng-architecture/#threads\n * and https://web.dev/same-site-same-origin/\n **/\nexport type FrameProcessData =\n Map<string,\n Map<Types.Events.ProcessID, Array<{frame: Types.Events.TraceFrame, window: Types.Timing.TraceWindowMicro}>>>;\n\nexport function data(): MetaHandlerData {\n return {\n config,\n traceBounds,\n browserProcessId,\n browserThreadId,\n processNames,\n gpuProcessId,\n gpuThreadId: gpuThreadId === Types.Events.ThreadID(-1) ? undefined : gpuThreadId,\n viewportRect: viewportRect || undefined,\n devicePixelRatio: devicePixelRatio ?? undefined,\n mainFrameId,\n mainFrameURL,\n navigationsByFrameId,\n navigationsByNavigationId,\n softNavigationsById,\n finalDisplayUrlByNavigationId,\n threadsInProcess,\n rendererProcessesByFrame: rendererProcessesByFrameId,\n topLevelRendererIds,\n frameByProcessId: framesByProcessId,\n mainFrameNavigations,\n traceIsGeneric,\n };\n}\n"]}
|
|
@@ -19,6 +19,7 @@ export interface TraceEventsForNetworkRequest {
|
|
|
19
19
|
resourceFinish?: Types.Events.ResourceFinish;
|
|
20
20
|
receivedData?: Types.Events.ResourceReceivedData[];
|
|
21
21
|
resourceMarkAsCached?: Types.Events.ResourceMarkAsCached;
|
|
22
|
+
preloadRenderBlockingStatusChange?: Types.Events.PreloadRenderBlockingStatusChangeEvent[];
|
|
22
23
|
}
|
|
23
24
|
export interface WebSocketTraceDataForFrame {
|
|
24
25
|
frame: string;
|
|
@@ -36,7 +37,13 @@ export type WebSocketTraceData = WebSocketTraceDataForFrame | WebSocketTraceData
|
|
|
36
37
|
interface NetworkRequestData {
|
|
37
38
|
byId: Map<string, Types.Events.SyntheticNetworkRequest>;
|
|
38
39
|
byTime: Types.Events.SyntheticNetworkRequest[];
|
|
39
|
-
|
|
40
|
+
requestIdsByURL: Map<string, string[]>;
|
|
41
|
+
/**
|
|
42
|
+
* IMPORTANT: you should prefer to use `Trace.Extras.Initiator` to find the initiator.
|
|
43
|
+
* This is because backend trace events have some bugs which means the initiators are not always accurate.
|
|
44
|
+
* See crrev.com/c/7032169 for context.
|
|
45
|
+
*/
|
|
46
|
+
incompleteInitiator: Map<Types.Events.SyntheticNetworkRequest, Types.Events.SyntheticNetworkRequest>;
|
|
40
47
|
webSocket: WebSocketTraceData[];
|
|
41
48
|
entityMappings: HandlerHelpers.EntityMappings;
|
|
42
49
|
linkPreconnectEvents: Types.Events.LinkPreconnect[];
|