@paulirish/trace_engine 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/analyze-trace.mjs +24 -16
  2. package/generated/protocol.d.ts +39 -5
  3. package/models/cpu_profile/CPUProfileDataModel.d.ts +1 -1
  4. package/models/cpu_profile/CPUProfileDataModel.js +6 -6
  5. package/models/cpu_profile/CPUProfileDataModel.js.map +1 -1
  6. package/models/trace/ModelImpl.d.ts +0 -6
  7. package/models/trace/ModelImpl.js +1 -10
  8. package/models/trace/ModelImpl.js.map +1 -1
  9. package/models/trace/Processor.d.ts +0 -1
  10. package/models/trace/Processor.js +13 -14
  11. package/models/trace/Processor.js.map +1 -1
  12. package/models/trace/TracingManager.js.map +1 -1
  13. package/models/trace/handlers/InvalidationsHandler.js +0 -9
  14. package/models/trace/handlers/InvalidationsHandler.js.map +1 -1
  15. package/models/trace/handlers/MetaHandler.js +25 -6
  16. package/models/trace/handlers/MetaHandler.js.map +1 -1
  17. package/models/trace/handlers/ModelHandlers.d.ts +1 -0
  18. package/models/trace/handlers/ModelHandlers.js +1 -0
  19. package/models/trace/handlers/ModelHandlers.js.map +1 -1
  20. package/models/trace/handlers/NetworkRequestsHandler.js +8 -7
  21. package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
  22. package/models/trace/handlers/RendererHandler.js +17 -7
  23. package/models/trace/handlers/RendererHandler.js.map +1 -1
  24. package/models/trace/handlers/SamplesHandler.d.ts +1 -0
  25. package/models/trace/handlers/SamplesHandler.js +11 -5
  26. package/models/trace/handlers/SamplesHandler.js.map +1 -1
  27. package/models/trace/handlers/SelectorStatsHandler.d.ts +9 -0
  28. package/models/trace/handlers/SelectorStatsHandler.js +28 -0
  29. package/models/trace/handlers/SelectorStatsHandler.js.map +1 -0
  30. package/models/trace/handlers/Threads.js +2 -2
  31. package/models/trace/handlers/Threads.js.map +1 -1
  32. package/models/trace/handlers/UserInteractionsHandler.d.ts +2 -0
  33. package/models/trace/handlers/UserInteractionsHandler.js +7 -0
  34. package/models/trace/handlers/UserInteractionsHandler.js.map +1 -1
  35. package/models/trace/handlers/WarningsHandler.js +0 -1
  36. package/models/trace/handlers/WarningsHandler.js.map +1 -1
  37. package/models/trace/handlers/handlers-tsconfig.json +1 -0
  38. package/models/trace/helpers/SamplesIntegrator.d.ts +6 -1
  39. package/models/trace/helpers/SamplesIntegrator.js +36 -8
  40. package/models/trace/helpers/SamplesIntegrator.js.map +1 -1
  41. package/models/trace/helpers/Trace.d.ts +88 -6
  42. package/models/trace/helpers/Trace.js +270 -21
  43. package/models/trace/helpers/Trace.js.map +1 -1
  44. package/models/trace/insights/CumulativeLayoutShift.d.ts +29 -0
  45. package/models/trace/insights/CumulativeLayoutShift.js +81 -0
  46. package/models/trace/insights/CumulativeLayoutShift.js.map +1 -0
  47. package/models/trace/insights/InsightRunners.d.ts +2 -0
  48. package/models/trace/insights/InsightRunners.js +2 -0
  49. package/models/trace/insights/InsightRunners.js.map +1 -1
  50. package/models/trace/insights/Viewport.d.ts +5 -0
  51. package/models/trace/insights/Viewport.js +39 -0
  52. package/models/trace/insights/Viewport.js.map +1 -0
  53. package/models/trace/insights/insights-tsconfig.json +2 -0
  54. package/models/trace/insights/types.d.ts +2 -1
  55. package/models/trace/insights/types.js +1 -0
  56. package/models/trace/insights/types.js.map +1 -1
  57. package/models/trace/types/Configuration.d.ts +16 -28
  58. package/models/trace/types/Configuration.js +7 -27
  59. package/models/trace/types/Configuration.js.map +1 -1
  60. package/models/trace/types/TraceEvents.d.ts +101 -26
  61. package/models/trace/types/TraceEvents.js +10 -3
  62. package/models/trace/types/TraceEvents.js.map +1 -1
  63. package/package.json +1 -1
  64. package/PAUL.readme.md +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"InsightRunners.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/InsightRunners.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport * as InteractionToNextPaint from './InteractionToNextPaint.js';\nexport * as LargestContentfulPaint from './LargestContentfulPaint.js';\nexport * as RenderBlocking from './RenderBlocking.js';\n"]}
1
+ {"version":3,"file":"InsightRunners.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/InsightRunners.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport * as CumulativeLayoutShift from './CumulativeLayoutShift.js';\nexport * as InteractionToNextPaint from './InteractionToNextPaint.js';\nexport * as LargestContentfulPaint from './LargestContentfulPaint.js';\nexport * as RenderBlocking from './RenderBlocking.js';\nexport * as Viewport from './Viewport.js';\n"]}
@@ -0,0 +1,5 @@
1
+ import { type InsightResult, type NavigationInsightContext, type RequiredData } from './types.js';
2
+ export declare function deps(): ['Meta', 'UserInteractions'];
3
+ export declare function generateInsight(traceParsedData: RequiredData<typeof deps>, context: NavigationInsightContext): InsightResult<{
4
+ mobileOptimized: boolean | null;
5
+ }>;
@@ -0,0 +1,39 @@
1
+ // Copyright 2024 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+ import * as Helpers from '../helpers/helpers.js';
5
+ import { InsightWarning } from './types.js';
6
+ export function deps() {
7
+ return ['Meta', 'UserInteractions'];
8
+ }
9
+ export function generateInsight(traceParsedData, context) {
10
+ const events = traceParsedData.UserInteractions.beginCommitCompositorFrameEvents.filter(event => {
11
+ if (event.args.frame !== context.frameId) {
12
+ return false;
13
+ }
14
+ const navigation = Helpers.Trace.getNavigationForTraceEvent(event, context.frameId, traceParsedData.Meta.navigationsByFrameId);
15
+ if (navigation?.args.data?.navigationId !== context.navigationId) {
16
+ return false;
17
+ }
18
+ return true;
19
+ });
20
+ if (!events.length) {
21
+ // Trace doesn't have the data we need.
22
+ return {
23
+ mobileOptimized: null,
24
+ warnings: [InsightWarning.NO_LAYOUT],
25
+ };
26
+ }
27
+ // Returns true only if all events are mobile optimized.
28
+ for (const event of events) {
29
+ if (!event.args.is_mobile_optimized) {
30
+ return {
31
+ mobileOptimized: false,
32
+ };
33
+ }
34
+ }
35
+ return {
36
+ mobileOptimized: true,
37
+ };
38
+ }
39
+ //# sourceMappingURL=Viewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Viewport.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/Viewport.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAqB,cAAc,EAAmD,MAAM,YAAY,CAAC;AAEhH,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,eAA0C,EAAE,OAAiC;IAE3G,MAAM,MAAM,GAAG,eAAe,CAAC,gBAAgB,CAAC,gCAAgC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QAC9F,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC;YACzC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,UAAU,GACZ,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAChH,IAAI,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC;YACjE,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,uCAAuC;QACvC,OAAO;YACL,eAAe,EAAE,IAAI;YACrB,QAAQ,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;SACrC,CAAC;IACJ,CAAC;IAED,wDAAwD;IACxD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACpC,OAAO;gBACL,eAAe,EAAE,KAAK;aACvB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,eAAe,EAAE,IAAI;KACtB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Helpers from '../helpers/helpers.js';\n\nimport {type InsightResult, InsightWarning, type NavigationInsightContext, type RequiredData} from './types.js';\n\nexport function deps(): ['Meta', 'UserInteractions'] {\n return ['Meta', 'UserInteractions'];\n}\n\nexport function generateInsight(traceParsedData: RequiredData<typeof deps>, context: NavigationInsightContext):\n InsightResult<{mobileOptimized: boolean | null}> {\n const events = traceParsedData.UserInteractions.beginCommitCompositorFrameEvents.filter(event => {\n if (event.args.frame !== context.frameId) {\n return false;\n }\n\n const navigation =\n Helpers.Trace.getNavigationForTraceEvent(event, context.frameId, traceParsedData.Meta.navigationsByFrameId);\n if (navigation?.args.data?.navigationId !== context.navigationId) {\n return false;\n }\n\n return true;\n });\n\n if (!events.length) {\n // Trace doesn't have the data we need.\n return {\n mobileOptimized: null,\n warnings: [InsightWarning.NO_LAYOUT],\n };\n }\n\n // Returns true only if all events are mobile optimized.\n for (const event of events) {\n if (!event.args.is_mobile_optimized) {\n return {\n mobileOptimized: false,\n };\n }\n }\n\n return {\n mobileOptimized: true,\n };\n}\n"]}
@@ -29,10 +29,12 @@
29
29
  "useUnknownInCatchVariables": false
30
30
  },
31
31
  "files": [
32
+ "../../../../../../../front_end/models/trace/insights/CumulativeLayoutShift.ts",
32
33
  "../../../../../../../front_end/models/trace/insights/InsightRunners.ts",
33
34
  "../../../../../../../front_end/models/trace/insights/InteractionToNextPaint.ts",
34
35
  "../../../../../../../front_end/models/trace/insights/LargestContentfulPaint.ts",
35
36
  "../../../../../../../front_end/models/trace/insights/RenderBlocking.ts",
37
+ "../../../../../../../front_end/models/trace/insights/Viewport.ts",
36
38
  "../../../../../../../front_end/models/trace/insights/types.ts",
37
39
  "../../../../../../../front_end/legacy/legacy-defs.d.ts",
38
40
  "../../../../../../../front_end/global_typings/global_defs.d.ts",
@@ -11,7 +11,8 @@ type InsightRunnersType = typeof InsightsRunners;
11
11
  export declare enum InsightWarning {
12
12
  NO_FP = "NO_FP",
13
13
  NO_LCP = "NO_LCP",
14
- NO_DOCUMENT_REQUEST = "NO_DOCUMENT_REQUEST"
14
+ NO_DOCUMENT_REQUEST = "NO_DOCUMENT_REQUEST",
15
+ NO_LAYOUT = "NO_LAYOUT"
15
16
  }
16
17
  export type InsightResult<R extends Record<string, unknown>> = R & {
17
18
  warnings?: InsightWarning[];
@@ -7,5 +7,6 @@ export var InsightWarning;
7
7
  InsightWarning["NO_LCP"] = "NO_LCP";
8
8
  // No network request could be identified as the primary HTML document.
9
9
  InsightWarning["NO_DOCUMENT_REQUEST"] = "NO_DOCUMENT_REQUEST";
10
+ InsightWarning["NO_LAYOUT"] = "NO_LAYOUT";
10
11
  })(InsightWarning || (InsightWarning = {}));
11
12
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/types.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAgB7B,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,uEAAuE;IACvE,6DAA2C,CAAA;AAC7C,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Handlers from '../handlers/handlers.js';\n\nimport type * as InsightsRunners from './InsightRunners.js';\n\n/**\n * Context for which navigation an insight should look at.\n */\nexport interface NavigationInsightContext {\n frameId: string;\n navigationId: string;\n}\n\ntype InsightRunnersType = typeof InsightsRunners;\n\nexport enum InsightWarning {\n NO_FP = 'NO_FP',\n NO_LCP = 'NO_LCP',\n // No network request could be identified as the primary HTML document.\n NO_DOCUMENT_REQUEST = 'NO_DOCUMENT_REQUEST',\n}\n\nexport type InsightResult<R extends Record<string, unknown>> = R&{\n warnings?: InsightWarning[],\n};\n\n/**\n * Contains insights for a specific navigation.\n */\nexport type NavigationInsightData<H extends {[key: string]: Handlers.Types.TraceEventHandler}> = {\n [I in keyof EnabledInsightRunners<H>]: ReturnType<EnabledInsightRunners<H>[I]>|Error;\n};\n\n/**\n * Contains insights for the entire trace. Insights are grouped by `navigationId`.\n */\nexport type TraceInsightData<H extends {[key: string]: Handlers.Types.TraceEventHandler}> =\n Map<string, NavigationInsightData<H>>;\n\n/**\n * Maps each enabled insight name to its generate function. Insights that are disabled (i.e. missing one or more dependencies) will be unset.\n */\nexport type EnabledInsightRunners<H extends {[key: string]: Handlers.Types.TraceEventHandler}> = {\n [I in keyof InsightRunnersType]:\n [Handlers.Types.EnabledHandlerDataWithMeta<H>] extends [Parameters<InsightRunnersType[I]['generateInsight']>[0]] ?\n (traceParsedData: Handlers.Types.EnabledHandlerDataWithMeta<H>, context: NavigationInsightContext) =>\n ReturnType<InsightRunnersType[I]['generateInsight']>:\n never;\n};\n\n/**\n * Represents the narrow set of dependencies defined by an insight's `deps()` function. `Meta` is always included regardless of `deps()`.\n */\nexport type RequiredData<D extends() => Array<keyof typeof Handlers.ModelHandlers>> =\n Handlers.Types.EnabledHandlerDataWithMeta<Pick<typeof Handlers.ModelHandlers, ReturnType<D>[number]>>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/types.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAgB7B,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,uEAAuE;IACvE,6DAA2C,CAAA;IAC3C,yCAAuB,CAAA;AACzB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Handlers from '../handlers/handlers.js';\n\nimport type * as InsightsRunners from './InsightRunners.js';\n\n/**\n * Context for which navigation an insight should look at.\n */\nexport interface NavigationInsightContext {\n frameId: string;\n navigationId: string;\n}\n\ntype InsightRunnersType = typeof InsightsRunners;\n\nexport enum InsightWarning {\n NO_FP = 'NO_FP',\n NO_LCP = 'NO_LCP',\n // No network request could be identified as the primary HTML document.\n NO_DOCUMENT_REQUEST = 'NO_DOCUMENT_REQUEST',\n NO_LAYOUT = 'NO_LAYOUT',\n}\n\nexport type InsightResult<R extends Record<string, unknown>> = R&{\n warnings?: InsightWarning[],\n};\n\n/**\n * Contains insights for a specific navigation.\n */\nexport type NavigationInsightData<H extends {[key: string]: Handlers.Types.TraceEventHandler}> = {\n [I in keyof EnabledInsightRunners<H>]: ReturnType<EnabledInsightRunners<H>[I]>|Error;\n};\n\n/**\n * Contains insights for the entire trace. Insights are grouped by `navigationId`.\n */\nexport type TraceInsightData<H extends {[key: string]: Handlers.Types.TraceEventHandler}> =\n Map<string, NavigationInsightData<H>>;\n\n/**\n * Maps each enabled insight name to its generate function. Insights that are disabled (i.e. missing one or more dependencies) will be unset.\n */\nexport type EnabledInsightRunners<H extends {[key: string]: Handlers.Types.TraceEventHandler}> = {\n [I in keyof InsightRunnersType]:\n [Handlers.Types.EnabledHandlerDataWithMeta<H>] extends [Parameters<InsightRunnersType[I]['generateInsight']>[0]] ?\n (traceParsedData: Handlers.Types.EnabledHandlerDataWithMeta<H>, context: NavigationInsightContext) =>\n ReturnType<InsightRunnersType[I]['generateInsight']>:\n never;\n};\n\n/**\n * Represents the narrow set of dependencies defined by an insight's `deps()` function. `Meta` is always included regardless of `deps()`.\n */\nexport type RequiredData<D extends() => Array<keyof typeof Handlers.ModelHandlers>> =\n Handlers.Types.EnabledHandlerDataWithMeta<Pick<typeof Handlers.ModelHandlers, ReturnType<D>[number]>>;\n"]}
@@ -1,33 +1,21 @@
1
- export type Configuration = Readonly<{
2
- settings: {};
3
- experiments: {
4
- /**
5
- * Include V8 RCS in the timeline
6
- */
7
- timelineV8RuntimeCallStats: boolean;
8
- /**
9
- * Show all events: disable the default filtering which hides and excludes some events.
10
- */
11
- timelineShowAllEvents: boolean;
12
- };
13
- processing: {
14
- /**
15
- * How long the processor should pause between event chunks.
16
- */
17
- pauseDuration: number;
18
- /**
19
- * How many events should be processed before yielding to the main thread for a pause.
20
- */
21
- eventsPerChunk: number;
22
- };
23
- }>;
24
- export declare const DEFAULT: Configuration;
1
+ export type Configuration = {
2
+ /**
3
+ * Include V8 RCS functions in the JS stacks
4
+ */
5
+ includeRuntimeCallStats: boolean;
6
+ /**
7
+ * Show all events: disable the default filtering which hides and excludes some events.
8
+ */
9
+ showAllEvents: boolean;
10
+ /**
11
+ * Extra detail for RPP developers (eg Trace Event json in Summary, and individual JS Sample events)
12
+ */
13
+ debugMode: boolean;
14
+ };
15
+ export declare const defaults: () => Configuration;
25
16
  /**
26
17
  * Generates a key that can be used to represent this config in a cache. This is
27
18
  * used mainly in tests, where we want to avoid re-parsing a file if we have
28
- * already processed it with the same configuration. This cache key purposefully
29
- * does not include all settings in the configuration; the processing settings
30
- * do not impact the actual resulting data. Only new flags in the config that
31
- * alter parsing should be added to this cache key.
19
+ * already processed it with the same configuration.
32
20
  */
33
21
  export declare function configToCacheKey(config: Configuration): string;
@@ -1,37 +1,17 @@
1
1
  // Copyright 2023 The Chromium Authors. All rights reserved.
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- export const DEFAULT = {
5
- settings: {},
6
- experiments: {
7
- timelineV8RuntimeCallStats: false,
8
- timelineShowAllEvents: false,
9
- },
10
- processing: {
11
- /**
12
- * We want to yield regularly to maintain responsiveness. If we yield too often, we're wasting idle time.
13
- * We could do this by checking `performance.now()` regularly, but it's an expensive call in such a hot loop.
14
- * `eventsPerChunk` is an approximated proxy metric.
15
- * But how big a chunk? We're aiming for long tasks that are no smaller than 100ms and not bigger than 200ms.
16
- * It's CPU dependent, so it should be calibrated on oldish hardware.
17
- * Illustration of a previous change to `eventsPerChunk`: https://imgur.com/wzp8BnR
18
- */
19
- eventsPerChunk: 50_000,
20
- pauseDuration: 0,
21
- },
22
- };
4
+ export const defaults = () => ({
5
+ includeRuntimeCallStats: false,
6
+ showAllEvents: false,
7
+ debugMode: false,
8
+ });
23
9
  /**
24
10
  * Generates a key that can be used to represent this config in a cache. This is
25
11
  * used mainly in tests, where we want to avoid re-parsing a file if we have
26
- * already processed it with the same configuration. This cache key purposefully
27
- * does not include all settings in the configuration; the processing settings
28
- * do not impact the actual resulting data. Only new flags in the config that
29
- * alter parsing should be added to this cache key.
12
+ * already processed it with the same configuration.
30
13
  */
31
14
  export function configToCacheKey(config) {
32
- return [
33
- `experiments.timelineShowAllEvents:${config.experiments.timelineShowAllEvents}`,
34
- `experiments.timelineV8RuntimeCallStats:${config.experiments.timelineV8RuntimeCallStats}`,
35
- ].join('-');
15
+ return JSON.stringify(config);
36
16
  }
37
17
  //# sourceMappingURL=Configuration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Configuration.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AA4B7B,MAAM,CAAC,MAAM,OAAO,GAAkB;IACpC,QAAQ,EAAE,EAAE;IACZ,WAAW,EAAE;QACX,0BAA0B,EAAE,KAAK;QACjC,qBAAqB,EAAE,KAAK;KAC7B;IACD,UAAU,EAAE;QAEV;;;;;;;WAOG;QACH,cAAc,EAAE,MAAM;QACtB,aAAa,EAAE,CAAC;KACjB;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAqB;IACpD,OAAO;QACL,qCAAqC,MAAM,CAAC,WAAW,CAAC,qBAAqB,EAAE;QAC/E,0CAA0C,MAAM,CAAC,WAAW,CAAC,0BAA0B,EAAE;KAC1F,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport type Configuration = Readonly<{\n settings: {\n // Currently empty but defining here as we will migrate more settings into this.\n },\n experiments: {\n /**\n * Include V8 RCS in the timeline\n */\n timelineV8RuntimeCallStats: boolean,\n /**\n * Show all events: disable the default filtering which hides and excludes some events.\n */\n timelineShowAllEvents: boolean,\n },\n processing: {\n /**\n * How long the processor should pause between event chunks.\n */\n pauseDuration: number,\n /**\n * How many events should be processed before yielding to the main thread for a pause.\n */\n eventsPerChunk: number,\n },\n}>;\n\nexport const DEFAULT: Configuration = {\n settings: {},\n experiments: {\n timelineV8RuntimeCallStats: false,\n timelineShowAllEvents: false,\n },\n processing: {\n\n /**\n * We want to yield regularly to maintain responsiveness. If we yield too often, we're wasting idle time.\n * We could do this by checking `performance.now()` regularly, but it's an expensive call in such a hot loop.\n * `eventsPerChunk` is an approximated proxy metric.\n * But how big a chunk? We're aiming for long tasks that are no smaller than 100ms and not bigger than 200ms.\n * It's CPU dependent, so it should be calibrated on oldish hardware.\n * Illustration of a previous change to `eventsPerChunk`: https://imgur.com/wzp8BnR\n */\n eventsPerChunk: 50_000,\n pauseDuration: 0,\n },\n};\n\n/**\n * Generates a key that can be used to represent this config in a cache. This is\n * used mainly in tests, where we want to avoid re-parsing a file if we have\n * already processed it with the same configuration. This cache key purposefully\n * does not include all settings in the configuration; the processing settings\n * do not impact the actual resulting data. Only new flags in the config that\n * alter parsing should be added to this cache key.\n */\nexport function configToCacheKey(config: Configuration): string {\n return [\n `experiments.timelineShowAllEvents:${config.experiments.timelineShowAllEvents}`,\n `experiments.timelineV8RuntimeCallStats:${config.experiments.timelineV8RuntimeCallStats}`,\n ].join('-');\n}\n"]}
1
+ {"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Configuration.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAiB7B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAkB,EAAE,CAAC,CAAC;IAC5C,uBAAuB,EAAE,KAAK;IAC9B,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,KAAK;CACjB,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAqB;IACpD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport type Configuration = {\n /**\n * Include V8 RCS functions in the JS stacks\n */\n includeRuntimeCallStats: boolean,\n /**\n * Show all events: disable the default filtering which hides and excludes some events.\n */\n showAllEvents: boolean,\n /**\n * Extra detail for RPP developers (eg Trace Event json in Summary, and individual JS Sample events)\n */\n debugMode: boolean,\n};\n\nexport const defaults = (): Configuration => ({\n includeRuntimeCallStats: false,\n showAllEvents: false,\n debugMode: false,\n});\n\n/**\n * Generates a key that can be used to represent this config in a cache. This is\n * used mainly in tests, where we want to avoid re-parsing a file if we have\n * already processed it with the same configuration.\n */\nexport function configToCacheKey(config: Configuration): string {\n return JSON.stringify(config);\n}\n"]}
@@ -51,6 +51,7 @@ export interface TraceEventArgs {
51
51
  }
52
52
  export interface TraceEventArgsData {
53
53
  stackTrace?: TraceEventCallFrame[];
54
+ url?: string;
54
55
  navigationId?: string;
55
56
  frame?: string;
56
57
  }
@@ -68,6 +69,7 @@ export interface TraceFrame {
68
69
  processId: ProcessID;
69
70
  url: string;
70
71
  parent?: string;
72
+ isOutermostMainFrame?: boolean;
71
73
  }
72
74
  export interface TraceEventSample extends TraceEventData {
73
75
  ph: Phase.SAMPLE;
@@ -249,12 +251,16 @@ export interface SyntheticNetworkRequest extends TraceEventComplete {
249
251
  frame: string;
250
252
  fromServiceWorker: boolean;
251
253
  isLinkPreload: boolean;
252
- host: string;
253
254
  mimeType: string;
254
- pathname: string;
255
- search: string;
256
- priority: Priority;
257
- initialPriority: Priority;
255
+ priority: Protocol.Network.ResourcePriority;
256
+ initialPriority: Protocol.Network.ResourcePriority;
257
+ /**
258
+ * This is the protocol used to resolve the request.
259
+ *
260
+ * Note, this is not the same as URL.protocol.
261
+ *
262
+ * Example values (not exhaustive): http/0.9, http/1.0, http/1.1, http, h2, h3-Q050, data, blob
263
+ */
258
264
  protocol: string;
259
265
  redirects: SyntheticNetworkRedirect[];
260
266
  renderBlocking: RenderBlocking;
@@ -268,6 +274,12 @@ export interface SyntheticNetworkRequest extends TraceEventComplete {
268
274
  }>;
269
275
  fetchPriorityHint: FetchPriorityHint;
270
276
  url: string;
277
+ /** True only if got a 'resourceFinish' event indicating a failure. */
278
+ failed: boolean;
279
+ /** True only if got a 'resourceFinish' event. */
280
+ finished: boolean;
281
+ connectionId: number;
282
+ connectionReused: boolean;
271
283
  initiator?: Initiator;
272
284
  requestMethod?: string;
273
285
  timing?: TraceEventResourceReceiveResponseTimingData;
@@ -363,19 +375,22 @@ export interface SyntheticScreenshot extends TraceEventData {
363
375
  }
364
376
  export interface TraceEventAnimation extends TraceEventData {
365
377
  args: TraceEventArgs & {
366
- id?: string;
367
- name?: string;
368
- nodeId?: number;
369
- nodeName?: string;
370
- state?: string;
371
- compositeFailed?: number;
372
- unsupportedProperties?: string[];
378
+ data: TraceEventArgsData & {
379
+ nodeName?: string;
380
+ nodeId?: number;
381
+ displayName?: string;
382
+ id?: string;
383
+ name?: string;
384
+ state?: string;
385
+ compositeFailed?: number;
386
+ unsupportedProperties?: string[];
387
+ };
373
388
  };
374
389
  name: 'Animation';
375
390
  id2?: {
376
391
  local?: string;
377
392
  };
378
- ph: Phase.ASYNC_NESTABLE_START | Phase.ASYNC_NESTABLE_END;
393
+ ph: Phase.ASYNC_NESTABLE_START | Phase.ASYNC_NESTABLE_END | Phase.ASYNC_NESTABLE_INSTANT;
379
394
  }
380
395
  export interface TraceEventMetadata extends TraceEventData {
381
396
  ph: Phase.METADATA;
@@ -409,7 +424,7 @@ export interface TraceEventNavigationStart extends TraceEventMark {
409
424
  };
410
425
  }
411
426
  export interface TraceEventFirstContentfulPaint extends TraceEventMark {
412
- name: 'firstContentfulPaint';
427
+ name: KnownEventName.MarkFCP;
413
428
  args: TraceEventArgs & {
414
429
  frame: string;
415
430
  data?: TraceEventArgsData & {
@@ -428,13 +443,13 @@ export interface TraceEventFirstPaint extends TraceEventMark {
428
443
  }
429
444
  export type PageLoadEvent = TraceEventFirstContentfulPaint | TraceEventMarkDOMContent | TraceEventInteractiveTime | TraceEventLargestContentfulPaintCandidate | TraceEventLayoutShift | TraceEventFirstPaint | TraceEventMarkLoad | TraceEventNavigationStart;
430
445
  export declare const MarkerName: readonly ["MarkDOMContent", "MarkLoad", "firstPaint", "firstContentfulPaint", "largestContentfulPaint::Candidate"];
431
- interface MakerEvent extends TraceEventData {
446
+ export interface MarkerEvent extends TraceEventData {
432
447
  name: typeof MarkerName[number];
433
448
  }
434
- export declare function isTraceEventMarkerEvent(event: TraceEventData): event is MakerEvent;
449
+ export declare function isTraceEventMarkerEvent(event: TraceEventData): event is MarkerEvent;
435
450
  export declare function eventIsPageLoadEvent(event: TraceEventData): event is PageLoadEvent;
436
451
  export interface TraceEventLargestContentfulPaintCandidate extends TraceEventMark {
437
- name: 'largestContentfulPaint::Candidate';
452
+ name: KnownEventName.MarkLCPCandidate;
438
453
  args: TraceEventArgs & {
439
454
  frame: string;
440
455
  data?: TraceEventArgsData & {
@@ -614,7 +629,6 @@ export interface SyntheticLayoutShift extends TraceEventLayoutShift {
614
629
  };
615
630
  parsedData: LayoutShiftParsedData;
616
631
  }
617
- export type Priority = 'Low' | 'High' | 'Medium' | 'VeryHigh' | 'Highest';
618
632
  export type FetchPriorityHint = 'low' | 'high' | 'auto';
619
633
  export type RenderBlocking = 'blocking' | 'non_blocking' | 'in_body_parser_blocking' | 'potentially_blocking';
620
634
  export interface Initiator {
@@ -631,7 +645,7 @@ export interface TraceEventResourceSendRequest extends TraceEventInstant {
631
645
  frame: string;
632
646
  requestId: string;
633
647
  url: string;
634
- priority: Priority;
648
+ priority: Protocol.Network.ResourcePriority;
635
649
  resourceType: Protocol.Network.ResourceType;
636
650
  fetchPriorityHint: FetchPriorityHint;
637
651
  requestMethod?: string;
@@ -645,7 +659,7 @@ export interface TraceEventResourceChangePriority extends TraceEventInstant {
645
659
  args: TraceEventArgs & {
646
660
  data: TraceEventArgsData & {
647
661
  requestId: string;
648
- priority: Priority;
662
+ priority: Protocol.Network.ResourcePriority;
649
663
  };
650
664
  };
651
665
  }
@@ -702,6 +716,14 @@ export interface TraceEventResourceReceiveResponse extends TraceEventInstant {
702
716
  name: 'ResourceReceiveResponse';
703
717
  args: TraceEventArgs & {
704
718
  data: TraceEventArgsData & {
719
+ /**
720
+ * This is the protocol used to resolve the request.
721
+ *
722
+ * Note, this is not the same as URL.protocol.
723
+ *
724
+ * Example values (not exhaustive): http/0.9, http/1.0, http/1.1, http, h2, h3-Q050, data, blob
725
+ */
726
+ protocol: string;
705
727
  encodedDataLength: number;
706
728
  frame: string;
707
729
  fromCache: boolean;
@@ -712,6 +734,8 @@ export interface TraceEventResourceReceiveResponse extends TraceEventInstant {
712
734
  statusCode: number;
713
735
  timing: TraceEventResourceReceiveResponseTimingData;
714
736
  isLinkPreload?: boolean;
737
+ connectionId: number;
738
+ connectionReused: boolean;
715
739
  headers?: Array<{
716
740
  name: string;
717
741
  value: string;
@@ -801,6 +825,14 @@ export interface TraceEventStyleInvalidatorInvalidationTracking extends TraceEve
801
825
  };
802
826
  }
803
827
  export declare function isTraceEventStyleInvalidatorInvalidationTracking(event: TraceEventData): event is TraceEventStyleInvalidatorInvalidationTracking;
828
+ export interface TraceEventBeginCommitCompositorFrame extends TraceEventInstant {
829
+ name: KnownEventName.BeginCommitCompositorFrame;
830
+ args: TraceEventArgs & {
831
+ frame: string;
832
+ is_mobile_optimized: boolean;
833
+ };
834
+ }
835
+ export declare function isTraceEventBeginCommitCompositorFrame(event: TraceEventData): event is TraceEventBeginCommitCompositorFrame;
804
836
  export interface TraceEventScheduleStyleRecalculation extends TraceEventInstant {
805
837
  name: KnownEventName.ScheduleStyleRecalculation;
806
838
  args: TraceEventArgs & {
@@ -814,7 +846,7 @@ export interface TraceEventPrePaint extends TraceEventComplete {
814
846
  name: 'PrePaint';
815
847
  }
816
848
  export interface TraceEventPairableAsync extends TraceEventData {
817
- ph: Phase.ASYNC_NESTABLE_START | Phase.ASYNC_NESTABLE_END;
849
+ ph: Phase.ASYNC_NESTABLE_START | Phase.ASYNC_NESTABLE_END | Phase.ASYNC_NESTABLE_INSTANT;
818
850
  id2?: {
819
851
  local?: string;
820
852
  global?: string;
@@ -824,6 +856,9 @@ export interface TraceEventPairableAsync extends TraceEventData {
824
856
  export interface TraceEventPairableAsyncBegin extends TraceEventPairableAsync {
825
857
  ph: Phase.ASYNC_NESTABLE_START;
826
858
  }
859
+ export interface TraceEventPairableAsyncInstant extends TraceEventPairableAsync {
860
+ ph: Phase.ASYNC_NESTABLE_INSTANT;
861
+ }
827
862
  export interface TraceEventPairableAsyncEnd extends TraceEventPairableAsync {
828
863
  ph: Phase.ASYNC_NESTABLE_END;
829
864
  }
@@ -972,6 +1007,7 @@ export interface SyntheticEventPair<T extends TraceEventPairableAsync = TraceEve
972
1007
  data: {
973
1008
  beginEvent: T & TraceEventPairableAsyncBegin;
974
1009
  endEvent: T & TraceEventPairableAsyncEnd;
1010
+ instantEvents?: Array<T & TraceEventPairableAsyncInstant>;
975
1011
  };
976
1012
  };
977
1013
  }
@@ -1000,10 +1036,32 @@ export interface SyntheticTraceEntry extends TraceEventData {
1000
1036
  /**
1001
1037
  * A profile call created in the frontend from samples disguised as a
1002
1038
  * trace event.
1039
+ *
1040
+ * We store the sampleIndex, profileId and nodeId so that we can easily link
1041
+ * back a Synthetic Trace Entry to an indivdual Sample trace event within a
1042
+ * Profile.
1043
+ *
1044
+ * Because a sample contains a set of call frames representing the stack at the
1045
+ * point in time that the sample was created, we also have to store the ID of
1046
+ * the Node that points to the function call that this profile call represents.
1003
1047
  */
1004
1048
  export interface SyntheticProfileCall extends SyntheticTraceEntry {
1005
1049
  callFrame: Protocol.Runtime.CallFrame;
1006
1050
  nodeId: Protocol.integer;
1051
+ sampleIndex: number;
1052
+ profileId: ProfileID;
1053
+ }
1054
+ /**
1055
+ * A JS Sample reflects a single sample from the V8 CPU Profile
1056
+ */
1057
+ export interface SyntheticJSSample extends SyntheticTraceEntry {
1058
+ name: KnownEventName.JSSample;
1059
+ args: TraceEventArgs & {
1060
+ data: TraceEventArgsData & {
1061
+ stackTrace: Protocol.Runtime.CallFrame[];
1062
+ };
1063
+ };
1064
+ ph: Phase.INSTANT;
1007
1065
  }
1008
1066
  /**
1009
1067
  * A trace event augmented synthetically in the frontend to contain
@@ -1147,21 +1205,21 @@ export interface SelectorTiming {
1147
1205
  'match_attempts': number;
1148
1206
  'selector': string;
1149
1207
  'style_sheet_id': string;
1208
+ 'match_count': number;
1150
1209
  }
1151
1210
  export interface SelectorStats {
1152
1211
  selector_timings: SelectorTiming[];
1153
1212
  }
1154
- export interface TraceEventStyleRecalcSelectorStats extends TraceEventComplete {
1213
+ export interface TraceEventSelectorStats extends TraceEventComplete {
1155
1214
  name: KnownEventName.SelectorStats;
1156
1215
  args: TraceEventArgs & {
1157
1216
  selector_stats?: SelectorStats;
1158
1217
  };
1159
1218
  }
1160
- export declare function isStyleRecalcSelectorStats(event: TraceEventData): event is TraceEventStyleRecalcSelectorStats;
1219
+ export declare function isTraceEventSelectorStats(event: TraceEventData): event is TraceEventSelectorStats;
1161
1220
  export interface TraceEventUpdateLayoutTree extends TraceEventComplete {
1162
1221
  name: KnownEventName.UpdateLayoutTree;
1163
1222
  args: TraceEventArgs & {
1164
- selector_stats?: SelectorStats;
1165
1223
  elementCount: number;
1166
1224
  beginData?: {
1167
1225
  frame: string;
@@ -1511,6 +1569,9 @@ export interface TraceEventV8Compile extends TraceEventComplete {
1511
1569
  data?: {
1512
1570
  url?: string;
1513
1571
  columnNumber?: number;
1572
+ consumedCacheSize?: number;
1573
+ cacheRejected?: boolean;
1574
+ cacheKind?: 'full' | 'normal';
1514
1575
  lineNumber?: number;
1515
1576
  notStreamedReason?: string;
1516
1577
  streamed?: boolean;
@@ -1520,6 +1581,20 @@ export interface TraceEventV8Compile extends TraceEventComplete {
1520
1581
  };
1521
1582
  }
1522
1583
  export declare function isTraceEventV8Compile(event: TraceEventData): event is TraceEventV8Compile;
1584
+ export interface TraceEventFunctionCall extends TraceEventComplete {
1585
+ name: KnownEventName.FunctionCall;
1586
+ args: TraceEventArgs & {
1587
+ data?: {
1588
+ frame?: string;
1589
+ columnNumber?: number;
1590
+ lineNumber?: number;
1591
+ functionName?: string;
1592
+ scriptId?: number;
1593
+ url?: string;
1594
+ };
1595
+ };
1596
+ }
1597
+ export declare function isTraceEventFunctionCall(event: TraceEventData): event is TraceEventFunctionCall;
1523
1598
  /**
1524
1599
  * Generally, before JS is executed, a trace event is dispatched that
1525
1600
  * parents the JS calls. These we call "invocation" events. This
@@ -1589,7 +1664,6 @@ export declare const enum KnownEventName {
1589
1664
  GCCollectGarbage = "BlinkGC.AtomicPhase",
1590
1665
  CPPGCSweep = "CppGC.IncrementalSweep",
1591
1666
  ScheduleStyleRecalculation = "ScheduleStyleRecalculation",
1592
- RecalculateStyles = "RecalculateStyles",
1593
1667
  Layout = "Layout",
1594
1668
  UpdateLayoutTree = "UpdateLayoutTree",
1595
1669
  InvalidateLayout = "InvalidateLayout",
@@ -1604,6 +1678,7 @@ export declare const enum KnownEventName {
1604
1678
  StyleRecalcInvalidationTracking = "StyleRecalcInvalidationTracking",
1605
1679
  StyleInvalidatorInvalidationTracking = "StyleInvalidatorInvalidationTracking",
1606
1680
  SelectorStats = "SelectorStats",
1681
+ BeginCommitCompositorFrame = "BeginCommitCompositorFrame",
1607
1682
  ScrollLayer = "ScrollLayer",
1608
1683
  UpdateLayer = "UpdateLayer",
1609
1684
  PaintSetup = "PaintSetup",
@@ -1615,7 +1690,6 @@ export declare const enum KnownEventName {
1615
1690
  ImageDecodeTask = "ImageDecodeTask",
1616
1691
  ImageUploadTask = "ImageUploadTask",
1617
1692
  DecodeImage = "Decode Image",
1618
- ResizeImage = "Resize Image",
1619
1693
  DrawLazyPixelRef = "Draw LazyPixelRef",
1620
1694
  DecodeLazyPixelRef = "Decode LazyPixelRef",
1621
1695
  GPUTask = "GPUTask",
@@ -1665,6 +1739,7 @@ export declare const enum KnownEventName {
1665
1739
  StartProfiling = "CpuProfiler::StartProfiling",
1666
1740
  ProfileChunk = "ProfileChunk",
1667
1741
  UpdateCounters = "UpdateCounters",
1742
+ JSSample = "JSSample",
1668
1743
  Animation = "Animation",
1669
1744
  ParseAuthorStyleSheet = "ParseAuthorStyleSheet",
1670
1745
  EmbedderCallback = "EmbedderCallback",
@@ -52,6 +52,9 @@ export function isTraceEventStyleRecalcInvalidationTracking(event) {
52
52
  export function isTraceEventStyleInvalidatorInvalidationTracking(event) {
53
53
  return event.name === "StyleInvalidatorInvalidationTracking" /* KnownEventName.StyleInvalidatorInvalidationTracking */;
54
54
  }
55
+ export function isTraceEventBeginCommitCompositorFrame(event) {
56
+ return event.name === "BeginCommitCompositorFrame" /* KnownEventName.BeginCommitCompositorFrame */;
57
+ }
55
58
  export function isTraceEventScheduleStyleRecalculation(event) {
56
59
  return event.name === "ScheduleStyleRecalculation" /* KnownEventName.ScheduleStyleRecalculation */;
57
60
  }
@@ -113,7 +116,7 @@ export function isTraceEventDecodeLazyPixelRef(event) {
113
116
  export function isTraceEventDecodeImage(event) {
114
117
  return event.name === "Decode Image" /* KnownEventName.DecodeImage */;
115
118
  }
116
- export function isStyleRecalcSelectorStats(event) {
119
+ export function isTraceEventSelectorStats(event) {
117
120
  return event.name === "SelectorStats" /* KnownEventName.SelectorStats */;
118
121
  }
119
122
  export function isTraceEventUpdateLayoutTree(event) {
@@ -209,7 +212,8 @@ export function isTraceEventNavigationStart(traceEventData) {
209
212
  return traceEventData.name === 'navigationStart';
210
213
  }
211
214
  export function isTraceEventAnimation(traceEventData) {
212
- return traceEventData.name === 'Animation';
215
+ // We've found some rare traces with an Animtation trace event from a different category: https://crbug.com/1472375#comment7
216
+ return traceEventData.name === 'Animation' && traceEventData.cat.includes('devtools.timeline');
213
217
  }
214
218
  export function isTraceEventLayoutShift(traceEventData) {
215
219
  return traceEventData.name === 'LayoutShift';
@@ -221,7 +225,7 @@ export function isTraceEventFirstContentfulPaint(traceEventData) {
221
225
  return traceEventData.name === 'firstContentfulPaint';
222
226
  }
223
227
  export function isTraceEventLargestContentfulPaintCandidate(traceEventData) {
224
- return traceEventData.name === 'largestContentfulPaint::Candidate';
228
+ return traceEventData.name === "largestContentfulPaint::Candidate" /* KnownEventName.MarkLCPCandidate */;
225
229
  }
226
230
  export function isTraceEventLargestImagePaintCandidate(traceEventData) {
227
231
  return traceEventData.name === 'LargestImagePaint::Candidate';
@@ -407,6 +411,9 @@ export function isWebSocketTraceEvent(event) {
407
411
  export function isTraceEventV8Compile(event) {
408
412
  return event.name === "v8.compile" /* KnownEventName.Compile */;
409
413
  }
414
+ export function isTraceEventFunctionCall(event) {
415
+ return event.name === "FunctionCall" /* KnownEventName.FunctionCall */;
416
+ }
410
417
  /**
411
418
  * Generally, before JS is executed, a trace event is dispatched that
412
419
  * parents the JS calls. These we call "invocation" events. This