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

Method startHeapProfile

lib/internal/worker.js:628–644  ·  view source on GitHub ↗

* @param {object} [options] * @param {number} [options.sampleInterval] * @param {number} [options.stackDepth] * @param {boolean} [options.forceGC] * @param {boolean} [options.includeObjectsCollectedByMajorGC] * @param {boolean} [options.includeObjectsCollectedByMinorGC] * @returns

(options)

Source from the content-addressed store, hash-verified

626 * @returns {Promise}
627 */
628 startHeapProfile(options) {
629 normalizeHeapProfileOptions ??=
630 require('internal/v8/heap_profile').normalizeHeapProfileOptions;
631 const { sampleInterval, stackDepth, flags } =
632 normalizeHeapProfileOptions(options);
633 const startTaker = this[kHandle]?.startHeapProfile(
634 sampleInterval, stackDepth, flags);
635 return new Promise((resolve, reject) => {
636 if (!startTaker) return reject(new ERR_WORKER_NOT_RUNNING());
637 startTaker.ondone = (err) => {
638 if (err) {
639 return reject(err);
640 }
641 resolve(new HeapProfileHandle(this));
642 };
643 });
644 }
645}
646
647/**

Calls 4

requireFunction · 0.50
rejectFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected