@datadog/pprof 2.2.1 → 2.2.2
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 +3 -3
- package/out/src/heap-profiler-bindings.d.ts +1 -1
- package/out/src/heap-profiler.d.ts +1 -1
- package/out/src/sourcemapper/sourcemapper.js +39 -25
- package/out/src/sourcemapper/sourcemapper.js.map +1 -1
- package/out/src/time-profiler.d.ts +2 -2
- package/package.json +15 -16
- 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-72.node +0 -0
- package/prebuilds/darwin-arm64/node-79.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-72.node +0 -0
- package/prebuilds/darwin-x64/node-79.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/win32-ia32/node-102.node +0 -0
- package/prebuilds/win32-ia32/node-72.node +0 -0
- package/prebuilds/win32-ia32/node-79.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-72.node +0 -0
- package/prebuilds/win32-x64/node-79.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/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# pprof support for Node.js
|
|
2
2
|
|
|
3
3
|
[![NPM Version][npm-image]][npm-url]
|
|
4
|
-
[![Build Status][
|
|
4
|
+
[![Build Status][build-image]][build-url]
|
|
5
5
|
[![Known Vulnerabilities][snyk-image]][snyk-url]
|
|
6
6
|
|
|
7
7
|
[pprof][pprof-url] support for Node.js.
|
|
@@ -108,8 +108,8 @@ Install [`pprof`][npm-url] with `npm` or add to your `package.json`.
|
|
|
108
108
|
const profile = await pprof.heap.v8Profile();
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
[
|
|
112
|
-
[
|
|
111
|
+
[build-image]: https://github.com/Datadog/pprof-nodejs/actions/workflows/build.yml/badge.svg?branch=main
|
|
112
|
+
[build-url]: https://github.com/Datadog/pprof-nodejs/actions/workflows/build.yml
|
|
113
113
|
[coveralls-image]: https://coveralls.io/repos/google/pprof-nodejs/badge.svg?branch=main&service=github
|
|
114
114
|
[npm-image]: https://badge.fury.io/js/pprof.svg
|
|
115
115
|
[npm-url]: https://npmjs.org/package/pprof
|
|
@@ -17,5 +17,5 @@ import { AllocationProfileNode } from './v8-types';
|
|
|
17
17
|
export declare function startSamplingHeapProfiler(heapIntervalBytes: number, heapStackDepth: number): void;
|
|
18
18
|
export declare function stopSamplingHeapProfiler(): void;
|
|
19
19
|
export declare function getAllocationProfile(): AllocationProfileNode;
|
|
20
|
-
export
|
|
20
|
+
export type NearHeapLimitCallback = (profile: AllocationProfileNode) => void;
|
|
21
21
|
export declare function monitorOutOfMemory(heapLimitExtensionSize: number, maxHeapLimitExtensionCount: number, dumpHeapProfileOnSdterr: boolean, exportCommand: Array<String> | undefined, callback: NearHeapLimitCallback | undefined, callbackMode: number): void;
|
|
@@ -36,7 +36,7 @@ export declare function convertProfile(rootNode: AllocationProfileNode, ignoreSa
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function start(intervalBytes: number, stackDepth: number): void;
|
|
38
38
|
export declare function stop(): void;
|
|
39
|
-
export
|
|
39
|
+
export type NearHeapLimitCallback = (profile: Profile) => void;
|
|
40
40
|
export declare const CallbackMode: {
|
|
41
41
|
Async: number;
|
|
42
42
|
Interrupt: number;
|
|
@@ -38,6 +38,15 @@ const pLimit = require('p-limit');
|
|
|
38
38
|
const readFile = pify(fs.readFile);
|
|
39
39
|
const CONCURRENCY = 10;
|
|
40
40
|
const MAP_EXT = '.map';
|
|
41
|
+
const debug = process.env.DD_PROFILING_DEBUG_SOURCE_MAPS
|
|
42
|
+
? (msg) => {
|
|
43
|
+
console.log(typeof msg === 'function' ? msg() : msg);
|
|
44
|
+
}
|
|
45
|
+
: () => { };
|
|
46
|
+
function error(msg) {
|
|
47
|
+
debug(`Error: ${msg}`);
|
|
48
|
+
return new Error(msg);
|
|
49
|
+
}
|
|
41
50
|
/**
|
|
42
51
|
* @param {!Map} infoMap The map that maps input source files to
|
|
43
52
|
* SourceMapConsumer objects that are used to calculate mapping information
|
|
@@ -49,7 +58,7 @@ async function processSourceMap(infoMap, mapPath) {
|
|
|
49
58
|
// this handles the case when the path is undefined, null, or
|
|
50
59
|
// the empty string
|
|
51
60
|
if (!mapPath || !mapPath.endsWith(MAP_EXT)) {
|
|
52
|
-
throw
|
|
61
|
+
throw error(`The path "${mapPath}" does not specify a source map file`);
|
|
53
62
|
}
|
|
54
63
|
mapPath = path.normalize(mapPath);
|
|
55
64
|
let contents;
|
|
@@ -57,7 +66,7 @@ async function processSourceMap(infoMap, mapPath) {
|
|
|
57
66
|
contents = await readFile(mapPath, 'utf8');
|
|
58
67
|
}
|
|
59
68
|
catch (e) {
|
|
60
|
-
throw
|
|
69
|
+
throw error('Could not read source map file ' + mapPath + ': ' + e);
|
|
61
70
|
}
|
|
62
71
|
let consumer;
|
|
63
72
|
try {
|
|
@@ -70,7 +79,7 @@ async function processSourceMap(infoMap, mapPath) {
|
|
|
70
79
|
consumer = (await new sourceMap.SourceMapConsumer(contents));
|
|
71
80
|
}
|
|
72
81
|
catch (e) {
|
|
73
|
-
throw
|
|
82
|
+
throw error('An error occurred while reading the ' +
|
|
74
83
|
'sourceMap file ' +
|
|
75
84
|
mapPath +
|
|
76
85
|
': ' +
|
|
@@ -88,20 +97,11 @@ async function processSourceMap(infoMap, mapPath) {
|
|
|
88
97
|
: path.basename(mapPath, MAP_EXT);
|
|
89
98
|
const generatedPath = path.resolve(dir, generatedBase);
|
|
90
99
|
infoMap.set(generatedPath, { mapFileDir: dir, mapConsumer: consumer });
|
|
100
|
+
debug(`Loaded source map for ${generatedPath} => ${mapPath}`);
|
|
91
101
|
}
|
|
92
102
|
class SourceMapper {
|
|
93
|
-
/**
|
|
94
|
-
* @param {Array.<string>} sourceMapPaths An array of paths to .map source map
|
|
95
|
-
* files that should be processed. The paths should be relative to the
|
|
96
|
-
* current process's current working directory
|
|
97
|
-
* @param {Logger} logger A logger that reports errors that occurred while
|
|
98
|
-
* processing the given source map files
|
|
99
|
-
* @constructor
|
|
100
|
-
*/
|
|
101
|
-
constructor() {
|
|
102
|
-
this.infoMap = new Map();
|
|
103
|
-
}
|
|
104
103
|
static async create(searchDirs) {
|
|
104
|
+
debug(() => `Looking for source map files in dirs: [${searchDirs.join(', ')}]`);
|
|
105
105
|
const mapFiles = [];
|
|
106
106
|
for (const dir of searchDirs) {
|
|
107
107
|
try {
|
|
@@ -111,11 +111,23 @@ class SourceMapper {
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
catch (e) {
|
|
114
|
-
throw
|
|
114
|
+
throw error(`failed to get source maps from ${dir}: ${e}`);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
+
debug(() => `Found source map files: [${mapFiles.join(', ')}]`);
|
|
117
118
|
return createFromMapFiles(mapFiles);
|
|
118
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* @param {Array.<string>} sourceMapPaths An array of paths to .map source map
|
|
122
|
+
* files that should be processed. The paths should be relative to the
|
|
123
|
+
* current process's current working directory
|
|
124
|
+
* @param {Logger} logger A logger that reports errors that occurred while
|
|
125
|
+
* processing the given source map files
|
|
126
|
+
* @constructor
|
|
127
|
+
*/
|
|
128
|
+
constructor() {
|
|
129
|
+
this.infoMap = new Map();
|
|
130
|
+
}
|
|
119
131
|
/**
|
|
120
132
|
* Used to get the information about the transpiled file from a given input
|
|
121
133
|
* source file provided there isn't any ambiguity with associating the input
|
|
@@ -172,29 +184,28 @@ class SourceMapper {
|
|
|
172
184
|
const inputPath = path.normalize(location.file);
|
|
173
185
|
const entry = this.getMappingInfo(inputPath);
|
|
174
186
|
if (entry === null) {
|
|
187
|
+
debug(() => `Source map lookup failed: no map found for ${location.file} (normalized: ${inputPath})`);
|
|
175
188
|
return location;
|
|
176
189
|
}
|
|
177
190
|
const generatedPos = {
|
|
178
191
|
line: location.line,
|
|
179
|
-
column: location.column,
|
|
180
|
-
bias: sourceMap.SourceMapConsumer.LEAST_UPPER_BOUND,
|
|
192
|
+
column: location.column > 0 ? location.column - 1 : 0, // SourceMapConsumer expects column to be 0-based
|
|
181
193
|
};
|
|
182
194
|
// TODO: Determine how to remove the explicit cast here.
|
|
183
195
|
const consumer = entry.mapConsumer;
|
|
184
|
-
|
|
185
|
-
if (pos.source === null) {
|
|
186
|
-
generatedPos.bias = sourceMap.SourceMapConsumer.GREATEST_LOWER_BOUND;
|
|
187
|
-
pos = consumer.originalPositionFor(generatedPos);
|
|
188
|
-
}
|
|
196
|
+
const pos = consumer.originalPositionFor(generatedPos);
|
|
189
197
|
if (pos.source === null) {
|
|
198
|
+
debug(() => `Source map lookup failed for ${location.name}(${location.file}:${location.line}:${location.column})`);
|
|
190
199
|
return location;
|
|
191
200
|
}
|
|
192
|
-
|
|
201
|
+
const loc = {
|
|
193
202
|
file: path.resolve(entry.mapFileDir, pos.source),
|
|
194
203
|
line: pos.line || undefined,
|
|
195
204
|
name: pos.name || location.name,
|
|
196
|
-
column: pos.column
|
|
205
|
+
column: pos.column === null ? undefined : pos.column + 1, // convert column back to 1-based
|
|
197
206
|
};
|
|
207
|
+
debug(() => `Source map lookup succeeded for ${location.name}(${location.file}:${location.line}:${location.column}) => ${loc.name}(${loc.file}:${loc.line}:${loc.column})`);
|
|
208
|
+
return loc;
|
|
198
209
|
}
|
|
199
210
|
}
|
|
200
211
|
exports.SourceMapper = SourceMapper;
|
|
@@ -206,7 +217,7 @@ async function createFromMapFiles(mapFiles) {
|
|
|
206
217
|
await Promise.all(promises);
|
|
207
218
|
}
|
|
208
219
|
catch (err) {
|
|
209
|
-
throw
|
|
220
|
+
throw error('An error occurred while processing the source map files' + err);
|
|
210
221
|
}
|
|
211
222
|
return mapper;
|
|
212
223
|
}
|
|
@@ -240,6 +251,9 @@ directoryFilter = (root, dirname) => true) {
|
|
|
240
251
|
if (!isNonFatalError(error)) {
|
|
241
252
|
throw error;
|
|
242
253
|
}
|
|
254
|
+
else {
|
|
255
|
+
debug(() => `Non fatal error: ${error}`);
|
|
256
|
+
}
|
|
243
257
|
}
|
|
244
258
|
}
|
|
245
259
|
yield* walkRecursive(dir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourcemapper.js","sourceRoot":"","sources":["../../../ts/src/sourcemapper/sourcemapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,mEAAmE;AACnE,8HAA8H;AAC9H,8EAA8E;AAC9E,0BAA0B;AAE1B,yBAAyB;AACzB,6BAA6B;AAE7B,2EAA2E;AAC3E,0EAA0E;AAC1E,uEAAuE;AACvE,MAAM,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAClE,6DAA6D;AAC7D,aAAa;AACb,OAAO,UAAU,CAAC,KAAK,CAAC;AACxB,wCAAwC;AACxC,IAAI,IAAI,EA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AC,IAAI,CAAC,CAAC;oBACnD,MAAM,KAAK,CAAC;iBACb;aACF;SACF;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE;gBAC3B,MAAM,KAAK,CAAC;aACb;iBAAM;gBACL,KAAK,CAAC,GAAG,EAAE,CAAC,oBAAoB,KAAK,EAAE,CAAC,CAAC;aAC1C;SACF;IACH,CAAC;IAED,KAAK,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,OAAe;IACxC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,CAC5B,OAAO,EACP,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,EACxC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAChB,IAAI,KAAK,OAAO,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,cAAc,CACvE,EAAE;QACD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;KAC9C;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { SourceMapper } from './sourcemapper/sourcemapper';
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
type Microseconds = number;
|
|
18
|
+
type Milliseconds = number;
|
|
19
19
|
export interface TimeProfilerOptions {
|
|
20
20
|
/** time in milliseconds for which to collect profile. */
|
|
21
21
|
durationMillis: Milliseconds;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/pprof",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "pprof support for Node.js",
|
|
5
5
|
"repository": "datadog/pprof-nodejs",
|
|
6
6
|
"main": "out/src/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"format": "clang-format --style file -i --glob='bindings/**/*.{h,hh,cpp,cc}'",
|
|
19
19
|
"prebuild": "node scripts/prebuild.js",
|
|
20
20
|
"prebuilds": "node scripts/prebuilds.js",
|
|
21
|
-
"prepare": "npm run compile",
|
|
21
|
+
"prepare": "npm run compile && npm run rebuild",
|
|
22
22
|
"pretest": "npm run compile && npm run rebuild"
|
|
23
23
|
},
|
|
24
24
|
"author": {
|
|
@@ -30,46 +30,45 @@
|
|
|
30
30
|
"node-gyp-build": "^3.9.0",
|
|
31
31
|
"p-limit": "^3.1.0",
|
|
32
32
|
"pify": "^5.0.0",
|
|
33
|
-
"pprof-format": "^2.0.
|
|
33
|
+
"pprof-format": "^2.0.7",
|
|
34
34
|
"source-map": "^0.7.3",
|
|
35
35
|
"split": "^1.0.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/mocha": "^9.1.1",
|
|
39
|
-
"@types/node": "^18.
|
|
39
|
+
"@types/node": "^18.16.16",
|
|
40
40
|
"@types/p-limit": "^2.0.0",
|
|
41
41
|
"@types/pify": "^5.0.0",
|
|
42
42
|
"@types/pretty-ms": "^5.0.1",
|
|
43
43
|
"@types/request": "^2.47.1",
|
|
44
|
-
"@types/sinon": "^10.0.
|
|
44
|
+
"@types/sinon": "^10.0.15",
|
|
45
45
|
"@types/tmp": "^0.2.3",
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
|
47
47
|
"axios": "^0.27.2",
|
|
48
48
|
"checksum": "^1.0.0",
|
|
49
49
|
"clang-format": "^1.8.0",
|
|
50
50
|
"codecov": "^3.0.0",
|
|
51
51
|
"deep-copy": "^1.4.2",
|
|
52
|
-
"eslint-config-standard": "^17.
|
|
53
|
-
"eslint-plugin-import": "^2.
|
|
54
|
-
"eslint-plugin-n": "^15.
|
|
55
|
-
"eslint-plugin-promise": "^6.
|
|
56
|
-
"glob": "^8.0
|
|
52
|
+
"eslint-config-standard": "^17.1.0",
|
|
53
|
+
"eslint-plugin-import": "^2.27.5",
|
|
54
|
+
"eslint-plugin-n": "^15.7.0",
|
|
55
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
56
|
+
"glob": "^8.1.0",
|
|
57
57
|
"gts": "^3.0.0",
|
|
58
58
|
"js-green-licenses": "^4.0.0",
|
|
59
|
-
"linkinator": "^4.0.2",
|
|
60
59
|
"mkdirp": "^1.0.4",
|
|
61
60
|
"mocha": "^9.2.2",
|
|
62
61
|
"nan": "^2.17.0",
|
|
63
62
|
"nyc": "^15.0.0",
|
|
64
63
|
"protobufjs-cli": "^1.0.2",
|
|
65
64
|
"rimraf": "^3.0.2",
|
|
66
|
-
"semver": "^7.
|
|
67
|
-
"sinon": "^14.0.
|
|
65
|
+
"semver": "^7.5.1",
|
|
66
|
+
"sinon": "^14.0.2",
|
|
68
67
|
"source-map-support": "^0.5.12",
|
|
69
|
-
"tar": "^6.1.
|
|
68
|
+
"tar": "^6.1.15",
|
|
70
69
|
"tmp": "0.2.1",
|
|
71
70
|
"ts-mockito": "^2.2.5",
|
|
72
|
-
"typescript": "^4.
|
|
71
|
+
"typescript": "^4.9.5"
|
|
73
72
|
},
|
|
74
73
|
"files": [
|
|
75
74
|
"out/src",
|
|
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
|