@datadog/pprof 4.0.0-pre-ff50bca → 4.0.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.
- package/README.md +7 -13
- package/out/src/profile-serializer.d.ts +2 -2
- package/out/src/profile-serializer.js +15 -10
- package/out/src/profile-serializer.js.map +1 -1
- package/out/src/time-profiler.d.ts +2 -2
- package/out/src/time-profiler.js.map +1 -1
- package/out/src/v8-types.d.ts +5 -1
- package/package.json +3 -3
- package/prebuilds/darwin-arm64/node-102.node +0 -0
- package/prebuilds/darwin-arm64/node-108.node +0 -0
- package/prebuilds/darwin-arm64/node-111.node +0 -0
- package/prebuilds/darwin-arm64/node-115.node +0 -0
- package/prebuilds/darwin-arm64/node-83.node +0 -0
- package/prebuilds/darwin-arm64/node-88.node +0 -0
- package/prebuilds/darwin-arm64/node-93.node +0 -0
- package/prebuilds/darwin-x64/node-102.node +0 -0
- package/prebuilds/darwin-x64/node-108.node +0 -0
- package/prebuilds/darwin-x64/node-111.node +0 -0
- package/prebuilds/darwin-x64/node-115.node +0 -0
- package/prebuilds/darwin-x64/node-83.node +0 -0
- package/prebuilds/darwin-x64/node-88.node +0 -0
- package/prebuilds/darwin-x64/node-93.node +0 -0
- package/prebuilds/linux-arm/node-102.node +0 -0
- package/prebuilds/linux-arm/node-108.node +0 -0
- package/prebuilds/linux-arm/node-111.node +0 -0
- package/prebuilds/linux-arm/node-115.node +0 -0
- package/prebuilds/linux-arm/node-83.node +0 -0
- package/prebuilds/linux-arm/node-88.node +0 -0
- package/prebuilds/linux-arm/node-93.node +0 -0
- package/prebuilds/linux-arm64/node-102.node +0 -0
- package/prebuilds/linux-arm64/node-108.node +0 -0
- package/prebuilds/linux-arm64/node-111.node +0 -0
- package/prebuilds/linux-arm64/node-115.node +0 -0
- package/prebuilds/linux-arm64/node-83.node +0 -0
- package/prebuilds/linux-arm64/node-88.node +0 -0
- package/prebuilds/linux-arm64/node-93.node +0 -0
- package/prebuilds/linux-x64/node-102.node +0 -0
- package/prebuilds/linux-x64/node-108.node +0 -0
- package/prebuilds/linux-x64/node-111.node +0 -0
- package/prebuilds/linux-x64/node-115.node +0 -0
- package/prebuilds/linux-x64/node-83.node +0 -0
- package/prebuilds/linux-x64/node-88.node +0 -0
- package/prebuilds/linux-x64/node-93.node +0 -0
- package/prebuilds/linuxmusl-x64/node-102.node +0 -0
- package/prebuilds/linuxmusl-x64/node-108.node +0 -0
- package/prebuilds/linuxmusl-x64/node-111.node +0 -0
- package/prebuilds/linuxmusl-x64/node-115.node +0 -0
- package/prebuilds/linuxmusl-x64/node-83.node +0 -0
- package/prebuilds/linuxmusl-x64/node-88.node +0 -0
- package/prebuilds/linuxmusl-x64/node-93.node +0 -0
- package/prebuilds/win32-ia32/node-102.node +0 -0
- package/prebuilds/win32-ia32/node-83.node +0 -0
- package/prebuilds/win32-ia32/node-88.node +0 -0
- package/prebuilds/win32-ia32/node-93.node +0 -0
- package/prebuilds/win32-x64/node-102.node +0 -0
- package/prebuilds/win32-x64/node-108.node +0 -0
- package/prebuilds/win32-x64/node-111.node +0 -0
- package/prebuilds/win32-x64/node-115.node +0 -0
- package/prebuilds/win32-x64/node-83.node +0 -0
- package/prebuilds/win32-x64/node-88.node +0 -0
- package/prebuilds/win32-x64/node-93.node +0 -0
- package/prebuilds/darwin-arm64/node-72.node +0 -0
- package/prebuilds/darwin-arm64/node-79.node +0 -0
- package/prebuilds/darwin-x64/node-72.node +0 -0
- package/prebuilds/darwin-x64/node-79.node +0 -0
- package/prebuilds/linux-arm/node-72.node +0 -0
- package/prebuilds/linux-arm/node-79.node +0 -0
- package/prebuilds/linux-arm64/node-72.node +0 -0
- package/prebuilds/linux-arm64/node-79.node +0 -0
- package/prebuilds/linux-ia32/node-72.node +0 -0
- package/prebuilds/linux-ia32/node-79.node +0 -0
- package/prebuilds/linux-x64/node-72.node +0 -0
- package/prebuilds/linux-x64/node-79.node +0 -0
- package/prebuilds/linuxmusl-x64/node-72.node +0 -0
- package/prebuilds/linuxmusl-x64/node-79.node +0 -0
- package/prebuilds/win32-ia32/node-72.node +0 -0
- package/prebuilds/win32-ia32/node-79.node +0 -0
- package/prebuilds/win32-x64/node-72.node +0 -0
- package/prebuilds/win32-x64/node-79.node +0 -0
package/README.md
CHANGED
|
@@ -7,28 +7,22 @@
|
|
|
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
|
|
11
|
-
version of Node 12 or 14.
|
|
12
|
-
|
|
13
|
-
The profiler should not be enabled when using earlier versions of Node 10,
|
|
14
|
-
since versions of Node.js 10 prior to 10.4.1 are impacted by
|
|
15
|
-
[this](https://bugs.chromium.org/p/chromium/issues/detail?id=847863) issue,
|
|
16
|
-
which can cause garbage collection to take several minutes when heap profiling
|
|
17
|
-
is enabled.
|
|
10
|
+
1. Your application will need to be using Node.js 14 or greater.
|
|
18
11
|
|
|
19
12
|
2. The `pprof` module has a native component that is used to collect profiles
|
|
20
13
|
with v8's CPU and Heap profilers. You may need to install additional
|
|
21
14
|
dependencies to build this module.
|
|
22
|
-
* For Linux: `pprof` has prebuilt binaries available for Linux
|
|
23
|
-
Linux
|
|
24
|
-
|
|
25
|
-
that `pprof` does not have
|
|
15
|
+
* For Linux: `pprof` has prebuilt binaries available for Linux arm64/x64,
|
|
16
|
+
Alpine Linux x64, macOS arm64/x64, windows x64 for Node 14/16/18/20.
|
|
17
|
+
No additional dependencies are required.
|
|
18
|
+
* For other environments: on environments that `pprof` does not have
|
|
19
|
+
prebuilt binaries for, the module
|
|
26
20
|
[`node-gyp`](https://www.npmjs.com/package/node-gyp) will be used to
|
|
27
21
|
build binaries. See `node-gyp`'s
|
|
28
22
|
[documentation](https://github.com/nodejs/node-gyp#installation)
|
|
29
23
|
for information on dependencies required to build binaries with `node-gyp`.
|
|
30
24
|
|
|
31
|
-
3. The [`pprof`][pprof-url] CLI can be used to view profiles collected with
|
|
25
|
+
3. The [`pprof`][pprof-url] CLI can be used to view profiles collected with
|
|
32
26
|
this module. Instructions for installing the `pprof` CLI can be found
|
|
33
27
|
[here][pprof-install-url].
|
|
34
28
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Profile } from 'pprof-format';
|
|
17
17
|
import { SourceMapper } from './sourcemapper/sourcemapper';
|
|
18
|
-
import { AllocationProfileNode, LabelSet, TimeProfile } from './v8-types';
|
|
18
|
+
import { AllocationProfileNode, LabelSet, TimeProfile, TimeProfileNodeContext } from './v8-types';
|
|
19
19
|
/**
|
|
20
20
|
* Converts v8 time profile into into a profile proto.
|
|
21
21
|
* (https://github.com/google/pprof/blob/master/proto/profile.proto)
|
|
@@ -23,7 +23,7 @@ import { AllocationProfileNode, LabelSet, TimeProfile } from './v8-types';
|
|
|
23
23
|
* @param prof - profile to be converted.
|
|
24
24
|
* @param intervalMicros - average time (microseconds) between samples.
|
|
25
25
|
*/
|
|
26
|
-
export declare function serializeTimeProfile(prof: TimeProfile, intervalMicros: number, sourceMapper?: SourceMapper, recomputeSamplingInterval?: boolean, generateLabels?: (context:
|
|
26
|
+
export declare function serializeTimeProfile(prof: TimeProfile, intervalMicros: number, sourceMapper?: SourceMapper, recomputeSamplingInterval?: boolean, generateLabels?: (context: TimeProfileNodeContext) => LabelSet): Profile;
|
|
27
27
|
/**
|
|
28
28
|
* Converts v8 heap profile into into a profile proto.
|
|
29
29
|
* (https://github.com/google/pprof/blob/master/proto/profile.proto)
|
|
@@ -183,7 +183,7 @@ function serializeTimeProfile(prof, intervalMicros, sourceMapper, recomputeSampl
|
|
|
183
183
|
const appendTimeEntryToSamples = (entry, samples) => {
|
|
184
184
|
let unlabelledHits = entry.node.hitCount;
|
|
185
185
|
for (const context of entry.node.contexts || []) {
|
|
186
|
-
const labels = generateLabels ? generateLabels(context) : context;
|
|
186
|
+
const labels = generateLabels ? generateLabels(context) : context.context;
|
|
187
187
|
if (Object.keys(labels).length > 0) {
|
|
188
188
|
const sample = new pprof_format_1.Sample({
|
|
189
189
|
locationId: entry.stack,
|
|
@@ -219,16 +219,21 @@ exports.serializeTimeProfile = serializeTimeProfile;
|
|
|
219
219
|
function buildLabels(labelSet, stringTable) {
|
|
220
220
|
const labels = [];
|
|
221
221
|
for (const [key, value] of Object.entries(labelSet)) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
222
|
+
const labelInput = {
|
|
223
|
+
key: stringTable.dedup(key),
|
|
224
|
+
};
|
|
225
|
+
switch (typeof value) {
|
|
226
|
+
case 'string':
|
|
227
|
+
labelInput.str = stringTable.dedup(value);
|
|
228
|
+
break;
|
|
229
|
+
case 'number':
|
|
230
|
+
case 'bigint':
|
|
231
|
+
labelInput.num = value;
|
|
232
|
+
break;
|
|
233
|
+
default:
|
|
234
|
+
continue;
|
|
231
235
|
}
|
|
236
|
+
labels.push(new pprof_format_1.Label(labelInput));
|
|
232
237
|
}
|
|
233
238
|
return labels;
|
|
234
239
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-serializer.js","sourceRoot":"","sources":["../../ts/src/profile-serializer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+
|
|
1
|
+
{"version":3,"file":"profile-serializer.js","sourceRoot":"","sources":["../../ts/src/profile-serializer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+CAWsB;AAqCtB,SAAS,mBAAmB,CAC1B,QAAwB;IAExB,OAAO,CACL,QAAQ,CAAC,MAAM,KAAK,SAAS;QAC7B,QAAQ,CAAC,IAAI,KAAK,SAAS;QAC3B,QAAQ,CAAC,IAAI,GAAG,CAAC,CAClB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,SAAS,CAChB,OAAqB,EACrB,IAAO,EACP,eAAwC,EACxC,WAAwB,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16
16
|
import { SourceMapper } from './sourcemapper/sourcemapper';
|
|
17
|
-
import { LabelSet } from './v8-types';
|
|
17
|
+
import { LabelSet, TimeProfileNodeContext } from './v8-types';
|
|
18
18
|
type Microseconds = number;
|
|
19
19
|
type Milliseconds = number;
|
|
20
20
|
export interface TimeProfilerOptions {
|
|
@@ -35,7 +35,7 @@ export interface TimeProfilerOptions {
|
|
|
35
35
|
}
|
|
36
36
|
export declare function profile({ intervalMicros, durationMillis, sourceMapper, lineNumbers, withContexts, workaroundV8Bug, }: TimeProfilerOptions): Promise<import("pprof-format").Profile>;
|
|
37
37
|
export declare function start({ intervalMicros, durationMillis, sourceMapper, lineNumbers, withContexts, workaroundV8Bug, }: TimeProfilerOptions): void;
|
|
38
|
-
export declare function stop(restart?: boolean, generateLabels?: (context:
|
|
38
|
+
export declare function stop(restart?: boolean, generateLabels?: (context: TimeProfileNodeContext) => LabelSet): import("pprof-format").Profile;
|
|
39
39
|
export declare function getState(): any;
|
|
40
40
|
export declare function setContext(context?: object): void;
|
|
41
41
|
export declare function isStarted(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-profiler.js","sourceRoot":"","sources":["../../ts/src/time-profiler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;AAEH,kDAA0B;AAE1B,6DAA0D;AAE1D,qEAGkC;AAGlC,MAAM,EAAC,YAAY,EAAC,GAAG,kCAAiB,CAAC;AAEzC,MAAM,uBAAuB,GAAiB,IAAI,CAAC;AACnD,MAAM,uBAAuB,GAAiB,KAAK,CAAC;AAKpD,IAAI,SAAwD,CAAC;AAC7D,IAAI,aAAuC,CAAC;AAC5C,IAAI,eAA6B,CAAC;AAClC,IAAI,iCAAiC,GAAG,CAAC,CAAC;AAE1C;6DAC6D;AAC7D,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;IACxB,IAAI,SAAS,EAAE;QAAE,IAAI,EAAE,CAAC;AAC1B,CAAC,C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C;AAC3C,CAAC;AAFD,4EAEC;AAEY,QAAA,SAAS,GAAG,EAAC,YAAY,EAAC,CAAC"}
|
package/out/src/v8-types.d.ts
CHANGED
|
@@ -28,9 +28,13 @@ export interface ProfileNode {
|
|
|
28
28
|
columnNumber?: number;
|
|
29
29
|
children: ProfileNode[];
|
|
30
30
|
}
|
|
31
|
+
export interface TimeProfileNodeContext {
|
|
32
|
+
context: object;
|
|
33
|
+
timestamp: bigint;
|
|
34
|
+
}
|
|
31
35
|
export interface TimeProfileNode extends ProfileNode {
|
|
32
36
|
hitCount: number;
|
|
33
|
-
contexts?:
|
|
37
|
+
contexts?: TimeProfileNodeContext[];
|
|
34
38
|
}
|
|
35
39
|
export interface AllocationProfileNode extends ProfileNode {
|
|
36
40
|
allocations: Allocation[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/pprof",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "pprof support for Node.js",
|
|
5
5
|
"repository": "datadog/pprof-nodejs",
|
|
6
6
|
"main": "out/src/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/mocha": "^10.0.1",
|
|
36
|
-
"@types/node": ">=
|
|
36
|
+
"@types/node": ">=14",
|
|
37
37
|
"@types/sinon": "^10.0.15",
|
|
38
38
|
"@types/tmp": "^0.2.3",
|
|
39
39
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
]
|
|
75
75
|
},
|
|
76
76
|
"engines": {
|
|
77
|
-
"node": ">=
|
|
77
|
+
"node": ">=14"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
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
|
|
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
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|