How to use the pprof.heap.start function in pprof

To help you get started, we’ve selected a few pprof examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / cloud-profiler-nodejs / ts / src / index.ts View on Github external
if (!nodeVersionOkay(process.version)) {
    throw new Error(
      `Could not start profiler: node version ${process.version}` +
        ` does not satisfies "${pjson.engines.node}"` +
        '\nSee https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs#prerequisites' +
        ' for details.'
    );
  }

  let profilerConfig: ProfilerConfig = initConfigLocal(config);

  // Start the heap profiler if profiler config does not indicate heap profiling
  // is disabled. This must be done before any asynchronous calls are made so
  // all memory allocations made after start() is called can be captured.
  if (!profilerConfig.disableHeap) {
    heapProfiler.start(
      profilerConfig.heapIntervalBytes,
      profilerConfig.heapMaxStackDepth
    );
  }
  profilerConfig = await initConfigMetadata(profilerConfig);
  return new Profiler(profilerConfig);
}

pprof

pprof support for Node.js

Apache-2.0
Latest version published 6 months ago

Package Health Score

75 / 100
Full package analysis