Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

@datadog/pprof

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/pprof

pprof support for Node.js


Version published
Weekly downloads
1.1M
decreased by-63.58%
Maintainers
1
Weekly downloads
 
Created

What is @datadog/pprof?

The @datadog/pprof package is a Node.js module provided by Datadog for profiling Node.js applications. It allows developers to generate and analyze CPU and heap profiles to understand the performance characteristics of their applications and identify bottlenecks or memory leaks.

What are @datadog/pprof's main functionalities?

CPU Profiling

This feature enables CPU profiling, allowing developers to understand where their application spends most of its execution time. The code sample demonstrates how to start CPU profiling with a specified duration and sampling rate.

const profiler = require('@datadog/pprof');
profiler.start({
  service: 'my-service',
  // 10 minutes profiling duration
  duration: 600,
  // Profile CPU every 1000 milliseconds
  sampleRate: 1000
});

Heap Profiling

Heap profiling helps in identifying memory leaks and understanding memory allocation patterns. The code sample shows how to start heap profiling with a specified interval between snapshots.

const profiler = require('@datadog/pprof');
profiler.heap.start({
  service: 'my-service',
  // Take a snapshot every 600 seconds
  snapshotInterval: 600
});

Other packages similar to @datadog/pprof

FAQs

Package last updated on 23 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts