Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async writeHeapProfile(prof: RequestProfile): Promise {
if (this.config.disableHeap) {
throw Error('Cannot collect heap profile, heap profiler not enabled.');
}
const p = heapProfiler.profile(
this.config.ignoreHeapSamplesPath,
this.sourceMapper
);
prof.profileBytes = await profileBytes(p);
return prof;
}
}