firefox-devtools / firefox-devtools/profiler
Support the "stack-chart" option for a marker display location
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
When implementing the marker schema, this display location "stack-chart" has been added in https://github.com/firefox-devtools/profiler/blob/a43a86c1c6fd14e26fe146eab4f2fb9b05920e92/src/types/markers.js#L100-L101. The goal is to make it possible to configure markers to be displayed in the stack-chart. Currently it's hardcoded for UserTiming only.
This shouldn't be too hard.
Currently it's done this way:
The data for the stack chart is computed with this when the option "show user timing" is checked:
https://github.com/firefox-devtools/profiler/blob/a43a86c1c6fd14e26fe146eab4f2fb9b05920e92/src/selectors/per-thread/composed.js#L101-L115
The markers to be displayed are computed with:
https://github.com/firefox-devtools/profiler/blob/a43a86c1c6fd14e26fe146eab4f2fb9b05920e92/src/selectors/per-thread/markers.js#L540-L549
https://github.com/firefox-devtools/profiler/blob/a43a86c1c6fd14e26fe146eab4f2fb9b05920e92/src/selectors/per-thread/markers.js#L342-L346
Instead of `isUserTimingMarker` we should use something like:
https://github.com/firefox-devtools/profiler/blob/a43a86c1c6fd14e26fe146eab4f2fb9b05920e92/src/selectors/per-thread/markers.js#L398-L413
With "stack-chart" instead of "marker-table".
And probably rename some of the functions for consistency.
Here is a profile with such a marker: https://share.firefox.dev/45a8ISC
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-803)
Contributor guide
Assessment
This issue has not been assessed yet.