MCPcopy Index your code
hub / github.com/nodejs/node / getHeapSnapshot

Method getHeapSnapshot

lib/internal/worker.js:541–554  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

539 }
540
541 getHeapSnapshot(options) {
542 const {
543 HeapSnapshotStream,
544 getHeapSnapshotOptions,
545 } = require('internal/heap_utils');
546 const optionsArray = getHeapSnapshotOptions(options);
547 const heapSnapshotTaker = this[kHandle]?.takeHeapSnapshot(optionsArray);
548 return new Promise((resolve, reject) => {
549 if (!heapSnapshotTaker) return reject(new ERR_WORKER_NOT_RUNNING());
550 heapSnapshotTaker.ondone = (handle) => {
551 resolve(new HeapSnapshotStream(handle));
552 };
553 });
554 }
555
556 getHeapStatistics() {
557 const taker = this[kHandle]?.getHeapStatistics();

Calls 4

getHeapSnapshotOptionsFunction · 0.85
requireFunction · 0.50
rejectFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected