-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add trace interpretation guide #2472
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,32 @@ driver.sendCommand('Security.enable'); | |
|
||
* _Debugging the protocol_: Read [Better debugging of the Protocol](https://github.com/GoogleChrome/lighthouse/issues/184). | ||
|
||
## Understanding a Trace | ||
|
||
`lighthouse-core/gather/computed/trace-of-tab.js` and `lighthouse-core/lib/traces/tracing-processor.js` provide the core transformation of a trace into more meaningful objects. Each raw trace event has a monotonically increasing timestamp in microseconds, a thread ID, a process ID, a duration in microseconds (potentially), and other applicable metadata properties such as the event type, the task name, the frame, etc. [Learn more about trace events](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview). | ||
|
||
### Example Trace Event | ||
```js | ||
{ | ||
'pid': 41904, // process ID | ||
'tid': 1295, // thread ID | ||
'ts': 1676836141, // timestamp in microseconds | ||
'ph': 'X', // trace event type | ||
'cat': 'toplevel', // trace category from which this event came | ||
'name': 'MessageLoop::RunTask', // relatively human-readable description of the trace event | ||
'dur': 64, // duration of the task in microseconds | ||
'args': {}, // contains additional data such as frame when applicable | ||
} | ||
``` | ||
|
||
### Trace of Tab | ||
|
||
Trace of tab identifies trace events for key moments (navigation start, first meaningful paint, DOM content loaded, trace end, etc) and provides filtered views of just the main process and the main thread events. Because the timestamps are not interesting in isolation, trace of tab also calculates the times in milliseconds of key moments relative to navigation start, thus providing the typical interpretation of first meaningful paint in ms. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hyphenate or camelCase trace-of-tab? It feels weird without articles, so clearly a proper name, but also lower case and without anything connecting the words :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
### Tracing Processor | ||
|
||
Tracing processor takes the output of trace of tab and identifies the toplevel main thread tasks, their durations, and corresponding impact on page responsiveness. Tracing process also translates task timestamps to milliseconds since navigation start for easier interpretation in computed gatherers and audits. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
## Audits | ||
|
||
The return value of each audit [takes this shape](https://github.com/GoogleChrome/lighthouse/blob/b354890076f2c077c5460b2fa56ded546cca72ee/lighthouse-core/closure/typedefs/AuditResult.js#L23-L55). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
timestamps
andtimings
names for each of the two groups of times?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done