Skip to content

Pf2.profile: Add 'out' and 'format' option to control output - #86

Merged
osyoyu merged 2 commits into
mainfrom
pf2-profile-options-out-format
Jan 24, 2026
Merged

osyoyu merged 2 commits into
mainfrom
pf2-profile-options-out-format

Conversation

@osyoyu

@osyoyu osyoyu commented Jan 24, 2026 •

Copy link
Copy Markdown
Owner

This patch adds convienience options for direct output from Pf2.profile. 'out' controls where to write the profile data, and 'format' controls the output format.

Pf2.profile(out: <path>, format: :firefox) is expected to be a convienient way to replace manual saving + 'pf2 report' steps.

Pf2.start/stop users still need to operate on raw profile data.

This patch also changes Pf2::Reporter::FirefoxProfilerSer2 to emit a JSON string instead of a Hash, as its responsibility is to produce a representation that Firefox Profiler can directly comsume.

This patch adds convienience options for direct output from
Pf2.profile. 'out' controls where to write the profile data, and
'format' controls the output format.

Pf2.profile(out: <path>, format: :firefox) is expected to be a
convienient way to replace manual saving + 'pf2 report' steps.

Pf2.start/stop users still need to operate on raw profile data.

This patch also changes Pf2::Reporter::FirefoxProfilerSer2 to emit a
JSON string instead of a Hash, as its responsibility is to produce a
representation that Firefox Profiler can directly comsume.
@osyoyu
osyoyu force-pushed the pf2-profile-options-out-format branch 2 times, most recently from f9b67a2 to dc5704e Compare January 24, 2026 14:09
@osyoyu
osyoyu merged commit 273e07d into main Jan 24, 2026
12 checks passed
@osyoyu
osyoyu deleted the pf2-profile-options-out-format branch January 24, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant