(diagnosticDir)
| 784 | |
| 785 | // To generate the HeapSnapshotFilename while using custom diagnosticDir |
| 786 | function getHeapSnapshotFilename(diagnosticDir) { |
| 787 | if (!diagnosticDir) return undefined; |
| 788 | |
| 789 | const date = new Date(); |
| 790 | |
| 791 | const year = DatePrototypeGetFullYear(date); |
| 792 | const month = String(DatePrototypeGetMonth(date) + 1).padStart(2, '0'); |
| 793 | const day = String(DatePrototypeGetDate(date)).padStart(2, '0'); |
| 794 | const hours = String(DatePrototypeGetHours(date)).padStart(2, '0'); |
| 795 | const minutes = String(DatePrototypeGetMinutes(date)).padStart(2, '0'); |
| 796 | const seconds = String(DatePrototypeGetSeconds(date)).padStart(2, '0'); |
| 797 | |
| 798 | const dateString = `${year}${month}${day}`; |
| 799 | const timeString = `${hours}${minutes}${seconds}`; |
| 800 | const pid = process.pid; |
| 801 | const threadId = internalBinding('worker').threadId; |
| 802 | const fileSequence = (++sequenceNumOfheapSnapshot).toString().padStart(3, '0'); |
| 803 | |
| 804 | return `${diagnosticDir}/Heap.${dateString}.${timeString}.${pid}.${threadId}.${fileSequence}.heapsnapshot`; |
| 805 | } |
| 806 | |
| 807 | module.exports = { |
| 808 | initializeModuleLoaders, |
no test coverage detected