• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

clippingkk / web / #1060

05 Apr 2025 08:32AM UTC coverage: 0.678% (-0.002%) from 0.68%
#1060

push

AnnatarHe
fix(node): fix build issue with node

30 of 384 branches covered (7.81%)

Branch coverage included in aggregate %.

0 of 2 new or added lines in 1 file covered. (0.0%)

148 of 25888 relevant lines covered (0.57%)

11.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/node/profiler.ts
NEW
1
import { Session } from 'node:inspector/promises'
×
NEW
2
import fs from 'node:fs'
×
3

×
4
async function dumpHeapSnapshot() {
×
5
  const session = new Session()
×
6

×
7
  const now = new Date()
×
8
  // YYYY-MM-DD_HH-MM-SS
×
9
  const filename = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}_${now.getHours()}-${now.getMinutes()}-${now.getSeconds()}.heapsnapshot`
×
10

×
11
  const fd = fs.openSync(filename, 'w')
×
12

×
13
  session.connect()
×
14

×
15
  session.on('HeapProfiler.addHeapSnapshotChunk', (m) => {
×
16
    fs.writeSync(fd, m.params.chunk)
×
17
  })
×
18

×
19
  const result = await session.post('HeapProfiler.takeHeapSnapshot')
×
20
  console.log('HeapProfiler.takeHeapSnapshot done:', result)
×
21
  session.disconnect()
×
22
  fs.closeSync(fd)
×
23
}
×
24

×
25
console.log('Starting heap snapshot dump...')
×
26

×
27
const THREE_HOURS = 3 * 60 * 60 * 1000
×
28
await dumpHeapSnapshot()
×
29
setInterval(async () => {
×
30
  await dumpHeapSnapshot()
×
31
}, THREE_HOURS)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc