@datadog/pprof 5.8.0 → 5.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +2 -2
  2. package/out/src/index.d.ts +1 -0
  3. package/out/src/time-profiler.d.ts +2 -0
  4. package/out/src/time-profiler.js +5 -3
  5. package/out/src/time-profiler.js.map +1 -1
  6. package/package.json +2 -1
  7. package/prebuilds/darwin-arm64/node-108.node +0 -0
  8. package/prebuilds/darwin-arm64/node-111.node +0 -0
  9. package/prebuilds/darwin-arm64/node-115.node +0 -0
  10. package/prebuilds/darwin-arm64/node-120.node +0 -0
  11. package/prebuilds/darwin-arm64/node-127.node +0 -0
  12. package/prebuilds/darwin-arm64/node-131.node +0 -0
  13. package/prebuilds/darwin-arm64/node-137.node +0 -0
  14. package/prebuilds/darwin-x64/node-108.node +0 -0
  15. package/prebuilds/darwin-x64/node-111.node +0 -0
  16. package/prebuilds/darwin-x64/node-115.node +0 -0
  17. package/prebuilds/darwin-x64/node-120.node +0 -0
  18. package/prebuilds/darwin-x64/node-127.node +0 -0
  19. package/prebuilds/darwin-x64/node-131.node +0 -0
  20. package/prebuilds/darwin-x64/node-137.node +0 -0
  21. package/prebuilds/linuxglibc-arm64/node-108.node +0 -0
  22. package/prebuilds/linuxglibc-arm64/node-111.node +0 -0
  23. package/prebuilds/linuxglibc-arm64/node-115.node +0 -0
  24. package/prebuilds/linuxglibc-arm64/node-120.node +0 -0
  25. package/prebuilds/linuxglibc-arm64/node-127.node +0 -0
  26. package/prebuilds/linuxglibc-arm64/node-131.node +0 -0
  27. package/prebuilds/linuxglibc-arm64/node-137.node +0 -0
  28. package/prebuilds/linuxglibc-x64/node-108.node +0 -0
  29. package/prebuilds/linuxglibc-x64/node-111.node +0 -0
  30. package/prebuilds/linuxglibc-x64/node-115.node +0 -0
  31. package/prebuilds/linuxglibc-x64/node-120.node +0 -0
  32. package/prebuilds/linuxglibc-x64/node-127.node +0 -0
  33. package/prebuilds/linuxglibc-x64/node-131.node +0 -0
  34. package/prebuilds/linuxglibc-x64/node-137.node +0 -0
  35. package/prebuilds/linuxmusl-arm64/node-108.node +0 -0
  36. package/prebuilds/linuxmusl-arm64/node-111.node +0 -0
  37. package/prebuilds/linuxmusl-arm64/node-115.node +0 -0
  38. package/prebuilds/linuxmusl-arm64/node-120.node +0 -0
  39. package/prebuilds/linuxmusl-arm64/node-127.node +0 -0
  40. package/prebuilds/linuxmusl-arm64/node-131.node +0 -0
  41. package/prebuilds/linuxmusl-arm64/node-137.node +0 -0
  42. package/prebuilds/linuxmusl-x64/node-108.node +0 -0
  43. package/prebuilds/linuxmusl-x64/node-111.node +0 -0
  44. package/prebuilds/linuxmusl-x64/node-115.node +0 -0
  45. package/prebuilds/linuxmusl-x64/node-120.node +0 -0
  46. package/prebuilds/linuxmusl-x64/node-127.node +0 -0
  47. package/prebuilds/linuxmusl-x64/node-131.node +0 -0
  48. package/prebuilds/linuxmusl-x64/node-137.node +0 -0
  49. package/prebuilds/win32-x64/node-108.node +0 -0
  50. package/prebuilds/win32-x64/node-111.node +0 -0
  51. package/prebuilds/win32-x64/node-115.node +0 -0
  52. package/prebuilds/win32-x64/node-120.node +0 -0
  53. package/prebuilds/win32-x64/node-127.node +0 -0
  54. package/prebuilds/win32-x64/node-131.node +0 -0
  55. package/prebuilds/win32-x64/node-137.node +0 -0
  56. package/prebuilds/darwin-arm64/node-102.node +0 -0
  57. package/prebuilds/darwin-arm64/node-93.node +0 -0
  58. package/prebuilds/darwin-x64/node-102.node +0 -0
  59. package/prebuilds/darwin-x64/node-93.node +0 -0
  60. package/prebuilds/linuxglibc-arm64/node-102.node +0 -0
  61. package/prebuilds/linuxglibc-arm64/node-93.node +0 -0
  62. package/prebuilds/linuxglibc-x64/node-102.node +0 -0
  63. package/prebuilds/linuxglibc-x64/node-93.node +0 -0
  64. package/prebuilds/linuxmusl-arm64/node-102.node +0 -0
  65. package/prebuilds/linuxmusl-arm64/node-93.node +0 -0
  66. package/prebuilds/linuxmusl-x64/node-102.node +0 -0
  67. package/prebuilds/linuxmusl-x64/node-93.node +0 -0
  68. package/prebuilds/win32-ia32/node-102.node +0 -0
  69. package/prebuilds/win32-ia32/node-93.node +0 -0
  70. package/prebuilds/win32-x64/node-102.node +0 -0
  71. package/prebuilds/win32-x64/node-93.node +0 -0
package/README.md CHANGED
@@ -7,13 +7,13 @@
7
7
  [pprof][pprof-url] support for Node.js.
8
8
 
9
9
  ## Prerequisites
10
- 1. Your application will need to be using Node.js 16 or greater.
10
+ 1. Your application will need to be using Node.js 18 or greater.
11
11
 
12
12
  2. The `pprof` module has a native component that is used to collect profiles
13
13
  with v8's CPU and Heap profilers. You may need to install additional
14
14
  dependencies to build this module.
15
15
  * `pprof` has prebuilt binaries available for Linux arm64/x64,
16
- Alpine Linux x64, macOS arm64/x64, and Windows x64 for Node 16/18/20/22/23.
16
+ Alpine Linux x64, macOS arm64/x64, and Windows x64 for Node 18/20/22/24.
17
17
  No additional dependencies are required.
18
18
  * For other environments: on environments that `pprof` does not have
19
19
  prebuilt binaries for, the module
@@ -16,6 +16,7 @@ export declare const time: {
16
16
  getState: typeof timeProfiler.getState;
17
17
  constants: {
18
18
  kSampleCount: any;
19
+ kCPEDContextCount: any;
19
20
  GARBAGE_COLLECTION_FUNCTION_NAME: string;
20
21
  NON_JS_THREADS_FUNCTION_NAME: string;
21
22
  };
@@ -35,6 +35,7 @@ export interface TimeProfilerOptions {
35
35
  workaroundV8Bug?: boolean;
36
36
  collectCpuTime?: boolean;
37
37
  collectAsyncId?: boolean;
38
+ useCPED?: boolean;
38
39
  }
39
40
  export declare function profile(options?: TimeProfilerOptions): Promise<import("pprof-format").Profile>;
40
41
  export declare function start(options?: TimeProfilerOptions): void;
@@ -46,6 +47,7 @@ export declare function isStarted(): boolean;
46
47
  export declare function v8ProfilerStuckEventLoopDetected(): number;
47
48
  export declare const constants: {
48
49
  kSampleCount: any;
50
+ kCPEDContextCount: any;
49
51
  GARBAGE_COLLECTION_FUNCTION_NAME: string;
50
52
  NON_JS_THREADS_FUNCTION_NAME: string;
51
53
  };
@@ -24,7 +24,7 @@ const profile_serializer_1 = require("./profile-serializer");
24
24
  const time_profiler_bindings_1 = require("./time-profiler-bindings");
25
25
  Object.defineProperty(exports, "getNativeThreadId", { enumerable: true, get: function () { return time_profiler_bindings_1.getNativeThreadId; } });
26
26
  const worker_threads_1 = require("worker_threads");
27
- const { kSampleCount } = time_profiler_bindings_1.constants;
27
+ const { kSampleCount, kCPEDContextCount } = time_profiler_bindings_1.constants;
28
28
  const DEFAULT_INTERVAL_MICROS = 1000;
29
29
  const DEFAULT_DURATION_MILLIS = 60000;
30
30
  let gProfiler;
@@ -45,6 +45,7 @@ const DEFAULT_OPTIONS = {
45
45
  workaroundV8Bug: true,
46
46
  collectCpuTime: false,
47
47
  collectAsyncId: false,
48
+ useCPED: false,
48
49
  };
49
50
  async function profile(options = {}) {
50
51
  options = { ...DEFAULT_OPTIONS, ...options };
@@ -64,8 +65,8 @@ function start(options = {}) {
64
65
  gIntervalMicros = options.intervalMicros;
65
66
  gV8ProfilerStuckEventLoopDetected = 0;
66
67
  gProfiler.start();
67
- // If contexts are enabled, set an initial empty context
68
- if (options.withContexts) {
68
+ // If contexts are enabled without using CPED, set an initial empty context
69
+ if (options.withContexts && !options.useCPED) {
69
70
  setContext({});
70
71
  }
71
72
  }
@@ -130,6 +131,7 @@ function v8ProfilerStuckEventLoopDetected() {
130
131
  exports.v8ProfilerStuckEventLoopDetected = v8ProfilerStuckEventLoopDetected;
131
132
  exports.constants = {
132
133
  kSampleCount,
134
+ kCPEDContextCount,
133
135
  GARBAGE_COLLECTION_FUNCTION_NAME: profile_serializer_1.GARBAGE_COLLECTION_FUNCTION_NAME,
134
136
  NON_JS_THREADS_FUNCTION_NAME: profile_serializer_1.NON_JS_THREADS_FUNCTION_NAME,
135
137
  };
@@ -1 +1 @@
1
- {"version":3,"file":"time-profiler.js","sourceRoot":"","sources":["../../ts/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AO,SAAS,CAAC,OAAO,CAAC;AAC3B,CAAC;AALD,gCAKC;AAED,SAAgB,SAAS;IACvB,OAAO,CAAC,CAAC,SAAS,CAAC;AACrB,CAAC;AAFD,8BAEC;AAED,sFAAsF;AACtF,SAAgB,gCAAgC;IAC9C,OAAO,iCAAiC,CAAC;AAC3C,CAAC;AAFD,4EAEC;AAEY,QAAA,SAAS,GAAG;IACvB,YAAY;IACZ,iBAAiB;IACjB,gCAAgC,EAAhC,qDAAgC;IAChC,4BAA4B,EAA5B,iDAA4B;CAC7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datadog/pprof",
3
- "version": "5.8.0",
3
+ "version": "5.9.0",
4
4
  "description": "pprof support for Node.js",
5
5
  "repository": "datadog/pprof-nodejs",
6
6
  "main": "out/src/index.js",
@@ -57,6 +57,7 @@
57
57
  "mocha": "^10.2.0",
58
58
  "nan": "^2.22.2",
59
59
  "nyc": "^15.1.0",
60
+ "semver": "^7.7.2",
60
61
  "sinon": "^15.2.0",
61
62
  "source-map-support": "^0.5.21",
62
63
  "tmp": "0.2.1",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file