Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Please see each tool's source directory for additional documentation
* Node.js signal handlers that provide a way to shut down long-running application components
gracefully on unhandled exceptions or interrupt signals.

### CPU Profiler
### Profiler server

* Fastify server that controls a profiler capable of generating:
* `.cpuprofile` files for CPU usage analysis
Expand Down
2 changes: 1 addition & 1 deletion src/profiler/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ const CpuProfiler: FastifyPluginCallback<Record<never, never>, Server, TypeBoxTy
logger.info(
`[HeapProfiler] Completed, total snapshot byte size: ${result.totalSnapshotByteSize}`
);
await pipeline(fs.createReadStream(tmpFile), res.raw);
await res.headers({
'Cache-Control': 'no-store',
'Transfer-Encoding': 'chunked',
'Content-Disposition': `attachment; filename="${filename}"`,
'Content-Type': 'application/json; charset=utf-8',
});
await pipeline(fs.createReadStream(tmpFile), res.raw);
} finally {
const session = existingSession;
existingSession = undefined;
Expand Down