Bug 2024449 - Add importer for streamed profile format (JSON Lines)#5901
Bug 2024449 - Add importer for streamed profile format (JSON Lines)#5901fqueze wants to merge 1 commit intofirefox-devtools:mainfrom
Conversation
😧 |
2c0c6f0 to
fb8a404
Compare
|
I insist that if it's not valid JSON, it should not be served as application/json. I don't want to maintain workarounds for this. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5901 +/- ##
==========================================
+ Coverage 85.44% 85.46% +0.02%
==========================================
Files 321 322 +1
Lines 32061 32132 +71
Branches 8753 8858 +105
==========================================
+ Hits 27393 27463 +70
- Misses 4236 4237 +1
Partials 432 432 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add support for importing the "streamed profile" format, a JSON Lines format where each line is a JSON object: a meta line, a thread declaration line, then marker lines. This format is produced by tools like resourcemonitor.py for streaming resource-usage profiles. The importer passes through meta and thread objects as-is and respects the input's preprocessedProfileVersion, so the standard profile upgraders handle all format migrations. stringArray placement is version-aware: per-thread for versions < 56, in profile.shared for versions >= 56. Also adds early detection in _extractJsonFromArrayBuffer so that JSON Lines content reaches the string-based format detection instead of failing JSON.parse.
fb8a404 to
bcf0a07
Compare
Sorry, this part of the commit message was misleading, the check is not for application/json but for
To me it's not a workaround, just a simple if check: I don't see how that could grow into more workarounds in the future. The part where I'm the least confident for the future is about how we'll handle profile format changes for the parts that aren't part of what's streamed as lines. The |
Add support for importing the "streamed profile" format, a JSON Lines format where each line is a JSON object: a meta line, a thread declaration line, then marker lines. This format is produced by tools like resourcemonitor.py for streaming resource-usage profiles (with the patches in bug 2024449).
The importer passes through meta and thread objects as-is and respects the input's
preprocessedProfileVersion, so the standard profile upgraders handle all format migrations. stringArray placement is version-aware: per-thread for versions < 56, in profile.shared for versions >= 56.Also adds early detection in
_extractJsonFromArrayBufferso that JSON Lines content served as application/json reaches the string-based format detection instead of failing JSON.parse.Example profiles on the timed out xpcshell jobs of this try push.