Skip to content

Commit

Permalink
fix(profiles): fix encoding of profiles on Node.js v16+
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarchini committed Nov 7, 2022
1 parent f683b19 commit ab0f580
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
- version: 10.x
- version: 12.x
- version: 14.x
- version: 16.x
- version: 18.x
- version: 19.x
# TODO(mmarchini): fix tests on windows and re-enable it here
os: [ubuntu-latest, macos-latest]

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/cpu-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function run(host, port, stream, options={}) {

const res = await client.post("Profiler.stop");
const { profile } = res;
stream.write(JSON.stringify(profile), res);
stream.write(JSON.stringify(profile));

await client.post("Profiler.disable");
client.disconnect();
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/heap-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function run(host, port, stream, options={}) {

const res = await client.post("HeapProfiler.stopSampling");
const { profile } = res;
stream.write(JSON.stringify(profile), res);
stream.write(JSON.stringify(profile));

client.disconnect();
}
Expand Down

0 comments on commit ab0f580

Please sign in to comment.