@paulirish/trace_engine 0.0.21 → 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.
- package/analyze-trace.mjs +24 -16
- package/generated/protocol.d.ts +14 -1
- package/models/cpu_profile/CPUProfileDataModel.d.ts +1 -1
- package/models/cpu_profile/CPUProfileDataModel.js +6 -6
- package/models/cpu_profile/CPUProfileDataModel.js.map +1 -1
- package/models/trace/ModelImpl.d.ts +0 -6
- package/models/trace/ModelImpl.js +1 -10
- package/models/trace/ModelImpl.js.map +1 -1
- package/models/trace/Processor.d.ts +0 -1
- package/models/trace/Processor.js +13 -14
- package/models/trace/Processor.js.map +1 -1
- package/models/trace/TracingManager.js.map +1 -1
- package/models/trace/handlers/NetworkRequestsHandler.js +4 -7
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
- package/models/trace/handlers/RendererHandler.js +17 -7
- package/models/trace/handlers/RendererHandler.js.map +1 -1
- package/models/trace/handlers/SamplesHandler.d.ts +1 -0
- package/models/trace/handlers/SamplesHandler.js +11 -5
- package/models/trace/handlers/SamplesHandler.js.map +1 -1
- package/models/trace/handlers/Threads.js +2 -2
- package/models/trace/handlers/Threads.js.map +1 -1
- package/models/trace/handlers/WarningsHandler.js +0 -1
- package/models/trace/handlers/WarningsHandler.js.map +1 -1
- package/models/trace/helpers/SamplesIntegrator.d.ts +6 -1
- package/models/trace/helpers/SamplesIntegrator.js +36 -8
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -1
- package/models/trace/helpers/Trace.d.ts +78 -7
- package/models/trace/helpers/Trace.js +171 -23
- package/models/trace/helpers/Trace.js.map +1 -1
- package/models/trace/insights/CumulativeLayoutShift.d.ts +29 -0
- package/models/trace/insights/CumulativeLayoutShift.js +81 -0
- package/models/trace/insights/CumulativeLayoutShift.js.map +1 -0
- package/models/trace/insights/InsightRunners.d.ts +1 -0
- package/models/trace/insights/InsightRunners.js +1 -0
- package/models/trace/insights/InsightRunners.js.map +1 -1
- package/models/trace/insights/insights-tsconfig.json +1 -0
- package/models/trace/types/Configuration.d.ts +16 -28
- package/models/trace/types/Configuration.js +7 -27
- package/models/trace/types/Configuration.js.map +1 -1
- package/models/trace/types/TraceEvents.d.ts +57 -13
- package/models/trace/types/TraceEvents.js +2 -1
- package/models/trace/types/TraceEvents.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,33 +1,21 @@
|
|
|
1
|
-
export type Configuration =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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.
|
|
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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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.
|
|
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;
|
|
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"]}
|
|
@@ -251,12 +251,16 @@ export interface SyntheticNetworkRequest extends TraceEventComplete {
|
|
|
251
251
|
frame: string;
|
|
252
252
|
fromServiceWorker: boolean;
|
|
253
253
|
isLinkPreload: boolean;
|
|
254
|
-
host: string;
|
|
255
254
|
mimeType: string;
|
|
256
|
-
pathname: string;
|
|
257
|
-
search: string;
|
|
258
255
|
priority: Protocol.Network.ResourcePriority;
|
|
259
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
|
+
*/
|
|
260
264
|
protocol: string;
|
|
261
265
|
redirects: SyntheticNetworkRedirect[];
|
|
262
266
|
renderBlocking: RenderBlocking;
|
|
@@ -371,19 +375,22 @@ export interface SyntheticScreenshot extends TraceEventData {
|
|
|
371
375
|
}
|
|
372
376
|
export interface TraceEventAnimation extends TraceEventData {
|
|
373
377
|
args: TraceEventArgs & {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
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
|
+
};
|
|
381
388
|
};
|
|
382
389
|
name: 'Animation';
|
|
383
390
|
id2?: {
|
|
384
391
|
local?: string;
|
|
385
392
|
};
|
|
386
|
-
ph: Phase.ASYNC_NESTABLE_START | Phase.ASYNC_NESTABLE_END;
|
|
393
|
+
ph: Phase.ASYNC_NESTABLE_START | Phase.ASYNC_NESTABLE_END | Phase.ASYNC_NESTABLE_INSTANT;
|
|
387
394
|
}
|
|
388
395
|
export interface TraceEventMetadata extends TraceEventData {
|
|
389
396
|
ph: Phase.METADATA;
|
|
@@ -709,6 +716,14 @@ export interface TraceEventResourceReceiveResponse extends TraceEventInstant {
|
|
|
709
716
|
name: 'ResourceReceiveResponse';
|
|
710
717
|
args: TraceEventArgs & {
|
|
711
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;
|
|
712
727
|
encodedDataLength: number;
|
|
713
728
|
frame: string;
|
|
714
729
|
fromCache: boolean;
|
|
@@ -831,7 +846,7 @@ export interface TraceEventPrePaint extends TraceEventComplete {
|
|
|
831
846
|
name: 'PrePaint';
|
|
832
847
|
}
|
|
833
848
|
export interface TraceEventPairableAsync extends TraceEventData {
|
|
834
|
-
ph: Phase.ASYNC_NESTABLE_START | Phase.ASYNC_NESTABLE_END;
|
|
849
|
+
ph: Phase.ASYNC_NESTABLE_START | Phase.ASYNC_NESTABLE_END | Phase.ASYNC_NESTABLE_INSTANT;
|
|
835
850
|
id2?: {
|
|
836
851
|
local?: string;
|
|
837
852
|
global?: string;
|
|
@@ -841,6 +856,9 @@ export interface TraceEventPairableAsync extends TraceEventData {
|
|
|
841
856
|
export interface TraceEventPairableAsyncBegin extends TraceEventPairableAsync {
|
|
842
857
|
ph: Phase.ASYNC_NESTABLE_START;
|
|
843
858
|
}
|
|
859
|
+
export interface TraceEventPairableAsyncInstant extends TraceEventPairableAsync {
|
|
860
|
+
ph: Phase.ASYNC_NESTABLE_INSTANT;
|
|
861
|
+
}
|
|
844
862
|
export interface TraceEventPairableAsyncEnd extends TraceEventPairableAsync {
|
|
845
863
|
ph: Phase.ASYNC_NESTABLE_END;
|
|
846
864
|
}
|
|
@@ -989,6 +1007,7 @@ export interface SyntheticEventPair<T extends TraceEventPairableAsync = TraceEve
|
|
|
989
1007
|
data: {
|
|
990
1008
|
beginEvent: T & TraceEventPairableAsyncBegin;
|
|
991
1009
|
endEvent: T & TraceEventPairableAsyncEnd;
|
|
1010
|
+
instantEvents?: Array<T & TraceEventPairableAsyncInstant>;
|
|
992
1011
|
};
|
|
993
1012
|
};
|
|
994
1013
|
}
|
|
@@ -1017,10 +1036,32 @@ export interface SyntheticTraceEntry extends TraceEventData {
|
|
|
1017
1036
|
/**
|
|
1018
1037
|
* A profile call created in the frontend from samples disguised as a
|
|
1019
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.
|
|
1020
1047
|
*/
|
|
1021
1048
|
export interface SyntheticProfileCall extends SyntheticTraceEntry {
|
|
1022
1049
|
callFrame: Protocol.Runtime.CallFrame;
|
|
1023
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;
|
|
1024
1065
|
}
|
|
1025
1066
|
/**
|
|
1026
1067
|
* A trace event augmented synthetically in the frontend to contain
|
|
@@ -1528,6 +1569,9 @@ export interface TraceEventV8Compile extends TraceEventComplete {
|
|
|
1528
1569
|
data?: {
|
|
1529
1570
|
url?: string;
|
|
1530
1571
|
columnNumber?: number;
|
|
1572
|
+
consumedCacheSize?: number;
|
|
1573
|
+
cacheRejected?: boolean;
|
|
1574
|
+
cacheKind?: 'full' | 'normal';
|
|
1531
1575
|
lineNumber?: number;
|
|
1532
1576
|
notStreamedReason?: string;
|
|
1533
1577
|
streamed?: boolean;
|
|
@@ -1620,7 +1664,6 @@ export declare const enum KnownEventName {
|
|
|
1620
1664
|
GCCollectGarbage = "BlinkGC.AtomicPhase",
|
|
1621
1665
|
CPPGCSweep = "CppGC.IncrementalSweep",
|
|
1622
1666
|
ScheduleStyleRecalculation = "ScheduleStyleRecalculation",
|
|
1623
|
-
RecalculateStyles = "RecalculateStyles",
|
|
1624
1667
|
Layout = "Layout",
|
|
1625
1668
|
UpdateLayoutTree = "UpdateLayoutTree",
|
|
1626
1669
|
InvalidateLayout = "InvalidateLayout",
|
|
@@ -1696,6 +1739,7 @@ export declare const enum KnownEventName {
|
|
|
1696
1739
|
StartProfiling = "CpuProfiler::StartProfiling",
|
|
1697
1740
|
ProfileChunk = "ProfileChunk",
|
|
1698
1741
|
UpdateCounters = "UpdateCounters",
|
|
1742
|
+
JSSample = "JSSample",
|
|
1699
1743
|
Animation = "Animation",
|
|
1700
1744
|
ParseAuthorStyleSheet = "ParseAuthorStyleSheet",
|
|
1701
1745
|
EmbedderCallback = "EmbedderCallback",
|
|
@@ -212,7 +212,8 @@ export function isTraceEventNavigationStart(traceEventData) {
|
|
|
212
212
|
return traceEventData.name === 'navigationStart';
|
|
213
213
|
}
|
|
214
214
|
export function isTraceEventAnimation(traceEventData) {
|
|
215
|
-
|
|
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');
|
|
216
217
|
}
|
|
217
218
|
export function isTraceEventLayoutShift(traceEventData) {
|
|
218
219
|
return traceEventData.name === 'LayoutShift';
|