* @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)
| 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 | /** |
no test coverage detected