Logging memory usage on media fetch.
This commit is contained in:
@@ -38,12 +38,12 @@ async function snapshotMemory() {
|
||||
const profile = await inspector.heap.takeSnapshot();
|
||||
const filepath = `traxxx_snapshot_${dayjs().format('YYYY-MM-DD_HH-mm-ss')}.heapprofile`;
|
||||
|
||||
logger.info(`Start heap snapshots, memory usage: ${process.memoryUsage.rss() / 1000000} MB`);
|
||||
logger.info(`Starting heap snapshot, memory usage: ${process.memoryUsage.rss() / 1000000} MB`);
|
||||
|
||||
await inspector.heap.disable();
|
||||
await fs.writeFile(filepath, JSON.stringify(profile));
|
||||
|
||||
logger.info(`Saved heap dump to ${filepath}`);
|
||||
logger.info(`Saved heap snapshot to ${filepath}`);
|
||||
}
|
||||
|
||||
async function stopMemorySample(snapshotTriggers) {
|
||||
|
||||
Reference in New Issue
Block a user