firefox-devtools / firefox-devtools/profiler
Make Network markers schema-based
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
Network markers currently don't have a schema.
For #5302, we'll need to create a schema which lists all useful fields. This will require an upgrader.
Furthermore, we have code when computing the derived markers, which treats Network markers in a special way and matches up markers based on `data.status` and `data.id`. If we have to upgrade these markers anyway, it may make sense to change them in such a way that we can remove this special handling.
This issue is only about making this change to the processed format. The Gecko format can be changed in a separate step. Once the Gecko format is changed, changing the Gecko C++ code for network markers will hopefully not require changing the front-end anymore.
---
I suggest the following:
1. Add the field formats `network-request-status`, `network-request-priority`, and `network-request-http-version`, to preserve behavior in the tooltip which uses `_getHumanReadableDataStatus`, `_getHumanReadablePriority` and `_getHumanReadableHttpVersion`.
2. Add the field format `network-request-redirect-info` which expects values of type `{ redirectType: string, isHttpToHttpsRedirect: bool }`, again to preserve behavior in the tooltip which creates entries such as "Redirection type:
Permanent (HTTP to HTTPS)". Or, alternatively, just put the combined string into a regular string field, and remove the extra bool field.
3. Add the field format `network-request-mime-type` so that the tooltip can have the colored square in front of the mime type value.
4. Add the field format `network-request-phase-timestamps` which is a JSON object containing all the timestamps of the various preflight/request/response phases.
5. Change the markers from interval markers to start/end markers, because the middle timestamp is ignored anyway. The middle timestamp being the end of the STATUS_START marker which is also the start of the STATUS_NOTSTART marker. (We currently put that middle timestamp into a `fetchStart` field which is unused.) Make sure that the marker name is just as unambiguous as the `data.id` field, so that the regular code for matching start/end markers based on the name works reliably.
6. Add some code to the upgrader to add `guessedMimeType` fields for markers from old profiles which didn't have a `mimeType` field.
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-854)
Contributor guide
Assessment
This issue has not been assessed yet.