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

Function collectGCProfile

test/common/v8.js:5–13  ·  view source on GitHub ↗
({ duration })

Source from the content-addressed store, hash-verified

3const { GCProfiler } = require('v8');
4
5function collectGCProfile({ duration }) {
6 return new Promise((resolve) => {
7 const profiler = new GCProfiler();
8 profiler.start();
9 setTimeout(() => {
10 resolve(profiler.stop());
11 }, duration);
12 });
13}
14
15function checkGCProfile(data) {
16 assert.ok(data.version > 0);

Callers 1

testGCProfilerFunction · 0.85

Calls 4

startMethod · 0.95
stopMethod · 0.95
resolveFunction · 0.70
setTimeoutFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…