@datadog/pprof 1.1.1 → 2.0.0-pre-b7ce6e3
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/out/src/cpu-profiler.d.ts +1 -1
- package/out/src/cpu-profiler.js +10 -5
- package/out/src/cpu-profiler.js.map +1 -1
- package/out/src/heap-profiler.d.ts +2 -2
- package/out/src/profile-encoder.d.ts +3 -3
- package/out/src/profile-encoder.js +2 -5
- package/out/src/profile-encoder.js.map +1 -1
- package/out/src/profile-serializer.d.ts +4 -4
- package/out/src/profile-serializer.js +42 -71
- package/out/src/profile-serializer.js.map +1 -1
- package/out/src/sourcemapper/sourcemapper.js +38 -3
- package/out/src/sourcemapper/sourcemapper.js.map +1 -1
- package/out/src/time-profiler.d.ts +2 -2
- package/out/src/v8-types.d.ts +5 -1
- package/package.json +3 -6
- 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-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-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/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-72.node +0 -0
- package/prebuilds/linux-arm/node-79.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-72.node +0 -0
- package/prebuilds/linux-arm64/node-79.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-ia32/node-72.node +0 -0
- package/prebuilds/linux-ia32/node-79.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-72.node +0 -0
- package/prebuilds/linux-x64/node-79.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-72.node +0 -0
- package/prebuilds/linuxmusl-x64/node-79.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-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-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/out/third_party/cloud-debug-nodejs/src/agent/io/scanner.d.ts +0 -29
- package/out/third_party/cloud-debug-nodejs/src/agent/io/scanner.js +0 -214
- package/out/third_party/cloud-debug-nodejs/src/agent/io/scanner.js.map +0 -1
- package/proto/README.md +0 -3
- package/proto/profile.d.ts +0 -1001
- package/proto/profile.js +0 -3161
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { CpuProfiler as NativeCpuProfiler } from './cpu-profiler-bindings';
|
|
17
17
|
export default class CpuProfiler extends NativeCpuProfiler {
|
|
18
|
-
profile(): import("
|
|
18
|
+
profile(): import("pprof-format").Profile | undefined;
|
|
19
19
|
}
|
package/out/src/cpu-profiler.js
CHANGED
|
@@ -79,14 +79,19 @@ class CpuProfiler extends cpu_profiler_bindings_1.CpuProfiler {
|
|
|
79
79
|
targetNode.children.push(node);
|
|
80
80
|
targetNode = node;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
if (sample.labels && Object.keys(sample.labels).length > 0) {
|
|
83
|
+
targetNode.labelSets.push({
|
|
84
|
+
labels: sample.labels,
|
|
85
|
+
cpuTime: sample.cpuTime,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
targetNode.cpuTime += sample.cpuTime;
|
|
90
|
+
targetNode.hitCount++;
|
|
86
91
|
}
|
|
87
92
|
targetNode = timeProfile.topDownRoot;
|
|
88
93
|
}
|
|
89
|
-
const intervalMicros =
|
|
94
|
+
const intervalMicros = 1000000 / this.frequency;
|
|
90
95
|
return (0, profile_serializer_1.serializeCpuProfile)(timeProfile, intervalMicros);
|
|
91
96
|
}
|
|
92
97
|
}
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AW,CAAC;QAEzC,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE;YACpC,IAAI,CAAC,MAAM;gBAAE,SAAS;YACtB,SAAS,EAAE,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE;gBAClD,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBAEhC,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,QAAQ,EAAE;oBACvC,MAAM,SAAS,GAAG,KAAuB,CAAC;oBAC1C,IAAI,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE;wBAChC,UAAU,GAAG,SAAS,CAAC;wBACvB,SAAS,SAAS,CAAC;qBACpB;iBACF;gBAED,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC/B,UAAU,GAAG,IAAI,CAAC;aACnB;YAED,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC1D,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC;oBACxB,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;iBACxB,CAAC,CAAC;aACJ;iBAAM;gBACL,UAAU,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC;gBACrC,UAAU,CAAC,QAAQ,EAAE,CAAC;aACvB;YAED,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC;SACtC;QAED,MAAM,cAAc,GAAG,OAAO,GAAI,IAAI,CAAC,SAAoB,CAAC;QAC5D,OAAO,IAAA,wCAAmB,EAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC;CACF;AAzDD,8BAyDC"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { Profile } from 'pprof-format';
|
|
17
17
|
import { SourceMapper } from './sourcemapper/sourcemapper';
|
|
18
18
|
import { AllocationProfileNode } from './v8-types';
|
|
19
19
|
export declare function v8Profile(): AllocationProfileNode;
|
|
@@ -24,7 +24,7 @@ export declare function v8Profile(): AllocationProfileNode;
|
|
|
24
24
|
* @param ignoreSamplePath
|
|
25
25
|
* @param sourceMapper
|
|
26
26
|
*/
|
|
27
|
-
export declare function profile(ignoreSamplePath?: string, sourceMapper?: SourceMapper):
|
|
27
|
+
export declare function profile(ignoreSamplePath?: string, sourceMapper?: SourceMapper): Profile;
|
|
28
28
|
/**
|
|
29
29
|
* Starts heap profiling. If heap profiling has already been started with
|
|
30
30
|
* the same parameters, this is a noop. If heap profiler has already been
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
/// <reference types="node" />
|
|
17
|
-
import {
|
|
18
|
-
export declare function encode(profile:
|
|
19
|
-
export declare function encodeSync(profile:
|
|
17
|
+
import { Profile } from 'pprof-format';
|
|
18
|
+
export declare function encode(profile: Profile): Promise<Buffer>;
|
|
19
|
+
export declare function encodeSync(profile: Profile): Buffer;
|
|
@@ -18,16 +18,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.encodeSync = exports.encode = void 0;
|
|
19
19
|
const pify = require("pify");
|
|
20
20
|
const zlib_1 = require("zlib");
|
|
21
|
-
const profile_1 = require("../../proto/profile");
|
|
22
21
|
const gzipPromise = pify(zlib_1.gzip);
|
|
23
22
|
async function encode(profile) {
|
|
24
|
-
|
|
25
|
-
return gzipPromise(buffer);
|
|
23
|
+
return gzipPromise(profile.encode());
|
|
26
24
|
}
|
|
27
25
|
exports.encode = encode;
|
|
28
26
|
function encodeSync(profile) {
|
|
29
|
-
|
|
30
|
-
return (0, zlib_1.gzipSync)(buffer);
|
|
27
|
+
return (0, zlib_1.gzipSync)(profile.encode());
|
|
31
28
|
}
|
|
32
29
|
exports.encodeSync = encodeSync;
|
|
33
30
|
//# sourceMappingURL=profile-encoder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-encoder.js","sourceRoot":"","sources":["../../ts/src/profile-encoder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,6BAA6B;AAC7B,+BAAoC;
|
|
1
|
+
{"version":3,"file":"profile-encoder.js","sourceRoot":"","sources":["../../ts/src/profile-encoder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,6BAA6B;AAC7B,+BAAoC;AAIpC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAI,CAAC,CAAC;AAExB,KAAK,UAAU,MAAM,CAAC,OAAgB;IAC3C,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACvC,CAAC;AAFD,wBAEC;AAED,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAO,IAAA,eAAQ,EAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACpC,CAAC;AAFD,gCAEC"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { Profile } from 'pprof-format';
|
|
17
17
|
import { SourceMapper } from './sourcemapper/sourcemapper';
|
|
18
18
|
import { AllocationProfileNode, CpuProfile, TimeProfile } from './v8-types';
|
|
19
19
|
/**
|
|
@@ -23,7 +23,7 @@ import { AllocationProfileNode, CpuProfile, 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):
|
|
26
|
+
export declare function serializeTimeProfile(prof: TimeProfile, intervalMicros: number, sourceMapper?: SourceMapper): Profile;
|
|
27
27
|
/**
|
|
28
28
|
* Converts cpu profile into into a profile proto.
|
|
29
29
|
* (https://github.com/google/pprof/blob/master/proto/profile.proto)
|
|
@@ -31,7 +31,7 @@ export declare function serializeTimeProfile(prof: TimeProfile, intervalMicros:
|
|
|
31
31
|
* @param prof - profile to be converted.
|
|
32
32
|
* @param intervalMicros - average time (microseconds) between samples.
|
|
33
33
|
*/
|
|
34
|
-
export declare function serializeCpuProfile(prof: CpuProfile, intervalMicros: number, sourceMapper?: SourceMapper):
|
|
34
|
+
export declare function serializeCpuProfile(prof: CpuProfile, intervalMicros: number, sourceMapper?: SourceMapper): Profile;
|
|
35
35
|
/**
|
|
36
36
|
* Converts v8 heap profile into into a profile proto.
|
|
37
37
|
* (https://github.com/google/pprof/blob/master/proto/profile.proto)
|
|
@@ -42,4 +42,4 @@ export declare function serializeCpuProfile(prof: CpuProfile, intervalMicros: nu
|
|
|
42
42
|
* nanoseconds.
|
|
43
43
|
* @param intervalBytes - bytes allocated between samples.
|
|
44
44
|
*/
|
|
45
|
-
export declare function serializeHeapProfile(prof: AllocationProfileNode, startTimeNanos: number, intervalBytes: number, ignoreSamplesPath?: string, sourceMapper?: SourceMapper):
|
|
45
|
+
export declare function serializeHeapProfile(prof: AllocationProfileNode, startTimeNanos: number, intervalBytes: number, ignoreSamplesPath?: string, sourceMapper?: SourceMapper): Profile;
|
|
@@ -16,36 +16,12 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.serializeHeapProfile = exports.serializeCpuProfile = exports.serializeTimeProfile = void 0;
|
|
19
|
-
const
|
|
19
|
+
const pprof_format_1 = require("pprof-format");
|
|
20
20
|
function isGeneratedLocation(location) {
|
|
21
21
|
return (location.column !== undefined &&
|
|
22
22
|
location.line !== undefined &&
|
|
23
23
|
location.line > 0);
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Used to build string table and access strings and their ids within the table
|
|
27
|
-
* when serializing a profile.
|
|
28
|
-
*/
|
|
29
|
-
class StringTable {
|
|
30
|
-
constructor() {
|
|
31
|
-
this.strings = [];
|
|
32
|
-
this.stringsMap = new Map();
|
|
33
|
-
this.getIndexOrAdd('');
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @return index of str within the table. Also adds str to string table if
|
|
37
|
-
* str is not in the table already.
|
|
38
|
-
*/
|
|
39
|
-
getIndexOrAdd(str) {
|
|
40
|
-
let idx = this.stringsMap.get(str);
|
|
41
|
-
if (idx !== undefined) {
|
|
42
|
-
return idx;
|
|
43
|
-
}
|
|
44
|
-
idx = this.strings.push(str) - 1;
|
|
45
|
-
this.stringsMap.set(str, idx);
|
|
46
|
-
return idx;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
25
|
/**
|
|
50
26
|
* Takes v8 profile and populates sample, location, and function fields of
|
|
51
27
|
* profile.proto.
|
|
@@ -87,7 +63,7 @@ function serialize(profile, root, appendToSamples, stringTable, ignoreSamplesPat
|
|
|
87
63
|
profile.sample = samples;
|
|
88
64
|
profile.location = locations;
|
|
89
65
|
profile.function = functions;
|
|
90
|
-
profile.stringTable = stringTable
|
|
66
|
+
profile.stringTable = stringTable;
|
|
91
67
|
function getLocation(node, sourceMapper) {
|
|
92
68
|
let profLoc = {
|
|
93
69
|
file: node.scriptName || '',
|
|
@@ -109,12 +85,12 @@ function serialize(profile, root, appendToSamples, stringTable, ignoreSamplesPat
|
|
|
109
85
|
id = locations.length + 1;
|
|
110
86
|
locationIdMap.set(keyStr, id);
|
|
111
87
|
const line = getLine(node.scriptId, profLoc.file, profLoc.name, profLoc.line);
|
|
112
|
-
const location = new
|
|
88
|
+
const location = new pprof_format_1.Location({ id, line: [line] });
|
|
113
89
|
locations.push(location);
|
|
114
90
|
return location;
|
|
115
91
|
}
|
|
116
92
|
function getLine(scriptId, scriptName, name, line) {
|
|
117
|
-
return new
|
|
93
|
+
return new pprof_format_1.Line({
|
|
118
94
|
functionId: getFunction(scriptId, scriptName, name).id,
|
|
119
95
|
line,
|
|
120
96
|
});
|
|
@@ -128,12 +104,12 @@ function serialize(profile, root, appendToSamples, stringTable, ignoreSamplesPat
|
|
|
128
104
|
}
|
|
129
105
|
id = functions.length + 1;
|
|
130
106
|
functionIdMap.set(keyStr, id);
|
|
131
|
-
const nameId = stringTable.
|
|
132
|
-
const f = new
|
|
107
|
+
const nameId = stringTable.dedup(name || '(anonymous)');
|
|
108
|
+
const f = new pprof_format_1.Function({
|
|
133
109
|
id,
|
|
134
110
|
name: nameId,
|
|
135
111
|
systemName: nameId,
|
|
136
|
-
filename: stringTable.
|
|
112
|
+
filename: stringTable.dedup(scriptName || ''),
|
|
137
113
|
});
|
|
138
114
|
functions.push(f);
|
|
139
115
|
return f;
|
|
@@ -144,9 +120,9 @@ function serialize(profile, root, appendToSamples, stringTable, ignoreSamplesPat
|
|
|
144
120
|
* adds strings used in this value type to the table.
|
|
145
121
|
*/
|
|
146
122
|
function createSampleCountValueType(table) {
|
|
147
|
-
return new
|
|
148
|
-
type: table.
|
|
149
|
-
unit: table.
|
|
123
|
+
return new pprof_format_1.ValueType({
|
|
124
|
+
type: table.dedup('sample'),
|
|
125
|
+
unit: table.dedup('count'),
|
|
150
126
|
});
|
|
151
127
|
}
|
|
152
128
|
/**
|
|
@@ -154,9 +130,9 @@ function createSampleCountValueType(table) {
|
|
|
154
130
|
* adds strings used in this value type to the table.
|
|
155
131
|
*/
|
|
156
132
|
function createTimeValueType(table) {
|
|
157
|
-
return new
|
|
158
|
-
type: table.
|
|
159
|
-
unit: table.
|
|
133
|
+
return new pprof_format_1.ValueType({
|
|
134
|
+
type: table.dedup('wall'),
|
|
135
|
+
unit: table.dedup('nanoseconds'),
|
|
160
136
|
});
|
|
161
137
|
}
|
|
162
138
|
/**
|
|
@@ -164,9 +140,9 @@ function createTimeValueType(table) {
|
|
|
164
140
|
* adds strings used in this value type to the table.
|
|
165
141
|
*/
|
|
166
142
|
function createCpuValueType(table) {
|
|
167
|
-
return new
|
|
168
|
-
type: table.
|
|
169
|
-
unit: table.
|
|
143
|
+
return new pprof_format_1.ValueType({
|
|
144
|
+
type: table.dedup('cpu'),
|
|
145
|
+
unit: table.dedup('nanoseconds'),
|
|
170
146
|
});
|
|
171
147
|
}
|
|
172
148
|
/**
|
|
@@ -174,9 +150,9 @@ function createCpuValueType(table) {
|
|
|
174
150
|
* adds strings used in this value type to the table.
|
|
175
151
|
*/
|
|
176
152
|
function createObjectCountValueType(table) {
|
|
177
|
-
return new
|
|
178
|
-
type: table.
|
|
179
|
-
unit: table.
|
|
153
|
+
return new pprof_format_1.ValueType({
|
|
154
|
+
type: table.dedup('objects'),
|
|
155
|
+
unit: table.dedup('count'),
|
|
180
156
|
});
|
|
181
157
|
}
|
|
182
158
|
/**
|
|
@@ -184,9 +160,9 @@ function createObjectCountValueType(table) {
|
|
|
184
160
|
* adds strings used in this value type to the table.
|
|
185
161
|
*/
|
|
186
162
|
function createAllocationValueType(table) {
|
|
187
|
-
return new
|
|
188
|
-
type: table.
|
|
189
|
-
unit: table.
|
|
163
|
+
return new pprof_format_1.ValueType({
|
|
164
|
+
type: table.dedup('space'),
|
|
165
|
+
unit: table.dedup('bytes'),
|
|
190
166
|
});
|
|
191
167
|
}
|
|
192
168
|
/**
|
|
@@ -200,14 +176,14 @@ function serializeTimeProfile(prof, intervalMicros, sourceMapper) {
|
|
|
200
176
|
const intervalNanos = intervalMicros * 1000;
|
|
201
177
|
const appendTimeEntryToSamples = (entry, samples) => {
|
|
202
178
|
if (entry.node.hitCount > 0) {
|
|
203
|
-
const sample = new
|
|
179
|
+
const sample = new pprof_format_1.Sample({
|
|
204
180
|
locationId: entry.stack,
|
|
205
181
|
value: [entry.node.hitCount, entry.node.hitCount * intervalNanos],
|
|
206
182
|
});
|
|
207
183
|
samples.push(sample);
|
|
208
184
|
}
|
|
209
185
|
};
|
|
210
|
-
const stringTable = new StringTable();
|
|
186
|
+
const stringTable = new pprof_format_1.StringTable();
|
|
211
187
|
const sampleValueType = createSampleCountValueType(stringTable);
|
|
212
188
|
const timeValueType = createTimeValueType(stringTable);
|
|
213
189
|
const profile = {
|
|
@@ -215,21 +191,21 @@ function serializeTimeProfile(prof, intervalMicros, sourceMapper) {
|
|
|
215
191
|
timeNanos: Date.now() * 1000 * 1000,
|
|
216
192
|
durationNanos: (prof.endTime - prof.startTime) * 1000,
|
|
217
193
|
periodType: timeValueType,
|
|
218
|
-
period:
|
|
194
|
+
period: intervalNanos,
|
|
219
195
|
};
|
|
220
196
|
serialize(profile, prof.topDownRoot, appendTimeEntryToSamples, stringTable, undefined, sourceMapper);
|
|
221
|
-
return profile;
|
|
197
|
+
return new pprof_format_1.Profile(profile);
|
|
222
198
|
}
|
|
223
199
|
exports.serializeTimeProfile = serializeTimeProfile;
|
|
224
200
|
function buildLabels(labelSet, stringTable) {
|
|
225
201
|
const labels = [];
|
|
226
202
|
for (const [key, value] of Object.entries(labelSet)) {
|
|
227
203
|
if (typeof value === 'number' || typeof value === 'string') {
|
|
228
|
-
const label = new
|
|
229
|
-
key: stringTable.
|
|
204
|
+
const label = new pprof_format_1.Label({
|
|
205
|
+
key: stringTable.dedup(key),
|
|
230
206
|
num: typeof value === 'number' ? value : undefined,
|
|
231
207
|
str: typeof value === 'string'
|
|
232
|
-
? stringTable.
|
|
208
|
+
? stringTable.dedup(value)
|
|
233
209
|
: undefined,
|
|
234
210
|
});
|
|
235
211
|
labels.push(label);
|
|
@@ -247,28 +223,23 @@ function buildLabels(labelSet, stringTable) {
|
|
|
247
223
|
function serializeCpuProfile(prof, intervalMicros, sourceMapper) {
|
|
248
224
|
const intervalNanos = intervalMicros * 1000;
|
|
249
225
|
const appendCpuEntryToSamples = (entry, samples) => {
|
|
250
|
-
for (const
|
|
251
|
-
const sample = new
|
|
226
|
+
for (const labelCpu of entry.node.labelSets) {
|
|
227
|
+
const sample = new pprof_format_1.Sample({
|
|
252
228
|
locationId: entry.stack,
|
|
253
|
-
value: [1,
|
|
254
|
-
label: buildLabels(
|
|
229
|
+
value: [1, labelCpu.cpuTime],
|
|
230
|
+
label: buildLabels(labelCpu.labels, stringTable),
|
|
255
231
|
});
|
|
256
232
|
samples.push(sample);
|
|
257
233
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
const sample = new profile_1.perftools.profiles.Sample({
|
|
234
|
+
if (entry.node.hitCount > 0) {
|
|
235
|
+
const sample = new pprof_format_1.Sample({
|
|
261
236
|
locationId: entry.stack,
|
|
262
|
-
value: [
|
|
263
|
-
unknownEntryCount,
|
|
264
|
-
entry.node.cpuTime,
|
|
265
|
-
// unknownEntryCount * intervalNanos,
|
|
266
|
-
],
|
|
237
|
+
value: [entry.node.hitCount, entry.node.cpuTime],
|
|
267
238
|
});
|
|
268
239
|
samples.push(sample);
|
|
269
240
|
}
|
|
270
241
|
};
|
|
271
|
-
const stringTable = new StringTable();
|
|
242
|
+
const stringTable = new pprof_format_1.StringTable();
|
|
272
243
|
const sampleValueType = createSampleCountValueType(stringTable);
|
|
273
244
|
// const wallValueType = createTimeValueType(stringTable);
|
|
274
245
|
const cpuValueType = createCpuValueType(stringTable);
|
|
@@ -277,10 +248,10 @@ function serializeCpuProfile(prof, intervalMicros, sourceMapper) {
|
|
|
277
248
|
timeNanos: Date.now() * 1000 * 1000,
|
|
278
249
|
durationNanos: prof.endTime - prof.startTime,
|
|
279
250
|
periodType: cpuValueType,
|
|
280
|
-
period:
|
|
251
|
+
period: intervalNanos,
|
|
281
252
|
};
|
|
282
253
|
serialize(profile, prof.topDownRoot, appendCpuEntryToSamples, stringTable, undefined, sourceMapper);
|
|
283
|
-
return profile;
|
|
254
|
+
return new pprof_format_1.Profile(profile);
|
|
284
255
|
}
|
|
285
256
|
exports.serializeCpuProfile = serializeCpuProfile;
|
|
286
257
|
/**
|
|
@@ -297,7 +268,7 @@ function serializeHeapProfile(prof, startTimeNanos, intervalBytes, ignoreSamples
|
|
|
297
268
|
const appendHeapEntryToSamples = (entry, samples) => {
|
|
298
269
|
if (entry.node.allocations.length > 0) {
|
|
299
270
|
for (const alloc of entry.node.allocations) {
|
|
300
|
-
const sample = new
|
|
271
|
+
const sample = new pprof_format_1.Sample({
|
|
301
272
|
locationId: entry.stack,
|
|
302
273
|
value: [alloc.count, alloc.sizeBytes * alloc.count],
|
|
303
274
|
// TODO: add tag for allocation size
|
|
@@ -306,7 +277,7 @@ function serializeHeapProfile(prof, startTimeNanos, intervalBytes, ignoreSamples
|
|
|
306
277
|
}
|
|
307
278
|
}
|
|
308
279
|
};
|
|
309
|
-
const stringTable = new StringTable();
|
|
280
|
+
const stringTable = new pprof_format_1.StringTable();
|
|
310
281
|
const sampleValueType = createObjectCountValueType(stringTable);
|
|
311
282
|
const allocationValueType = createAllocationValueType(stringTable);
|
|
312
283
|
const profile = {
|
|
@@ -316,7 +287,7 @@ function serializeHeapProfile(prof, startTimeNanos, intervalBytes, ignoreSamples
|
|
|
316
287
|
period: intervalBytes,
|
|
317
288
|
};
|
|
318
289
|
serialize(profile, prof, appendHeapEntryToSamples, stringTable, ignoreSamplesPath, sourceMapper);
|
|
319
|
-
return profile;
|
|
290
|
+
return new pprof_format_1.Profile(profile);
|
|
320
291
|
}
|
|
321
292
|
exports.serializeHeapProfile = serializeHeapProfile;
|
|
322
293
|
//# sourceMappingURL=profile-serializer.js.map
|
|
@@ -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,+CAUsB;AAsCtB,SAAS,mBAAmB,CAC1B,QAAwB;IAExB,OAAO,CACL,QAAQ,CAAC,MAAM,KAAK,SAAS;QAC7B,QAAQ,CAAC,IAAI,KAAK,SAAS;QAC3B,QAAQ,CAAC,IAAI,G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CAAC,MAAM,CAAC,CAAC;aACtB;SACF;IACH,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,IAAI,0BAAW,EAAE,CAAC;IACtC,MAAM,eAAe,GAAG,0BAA0B,CAAC,WAAW,CAAC,CAAC;IAChE,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;IAEnE,MAAM,OAAO,GAAG;QACd,UAAU,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;QAClD,SAAS,EAAE,cAAc;QACzB,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,aAAa;KACtB,CAAC;IAEF,SAAS,CACP,OAAO,EACP,IAAI,EACJ,wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,YAAY,CACb,CAAC;IAEF,OAAO,IAAI,sBAAO,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AA3CD,oDA2CC"}
|
|
@@ -33,7 +33,6 @@ const sourceMap = require("source-map");
|
|
|
33
33
|
if (desc) {
|
|
34
34
|
Object.defineProperty(globalThis, 'fetch', desc);
|
|
35
35
|
}
|
|
36
|
-
const scanner = require("../../third_party/cloud-debug-nodejs/src/agent/io/scanner");
|
|
37
36
|
const pify = require('pify');
|
|
38
37
|
const pLimit = require('p-limit');
|
|
39
38
|
const readFile = pify(fs.readFile);
|
|
@@ -203,9 +202,45 @@ async function createFromMapFiles(mapFiles) {
|
|
|
203
202
|
}
|
|
204
203
|
return mapper;
|
|
205
204
|
}
|
|
205
|
+
function isErrnoException(e) {
|
|
206
|
+
return e instanceof Error && 'code' in e;
|
|
207
|
+
}
|
|
208
|
+
function isNonFatalError(error) {
|
|
209
|
+
const nonFatalErrors = ['ENOENT', 'EPERM', 'EACCES', 'ELOOP'];
|
|
210
|
+
return (isErrnoException(error) && error.code && nonFatalErrors.includes(error.code));
|
|
211
|
+
}
|
|
212
|
+
async function* walk(dir,
|
|
213
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
214
|
+
fileFilter = (filename) => true,
|
|
215
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
216
|
+
directoryFilter = (root, dirname) => true) {
|
|
217
|
+
async function* walkRecursive(dir) {
|
|
218
|
+
try {
|
|
219
|
+
for await (const d of await fs.promises.opendir(dir)) {
|
|
220
|
+
const entry = path.join(dir, d.name);
|
|
221
|
+
if (d.isDirectory() && directoryFilter(dir, d.name)) {
|
|
222
|
+
yield* walkRecursive(entry);
|
|
223
|
+
}
|
|
224
|
+
else if (d.isFile() && fileFilter(d.name)) {
|
|
225
|
+
// check that the file is readable
|
|
226
|
+
await fs.promises.access(entry, fs.constants.R_OK);
|
|
227
|
+
yield entry;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
if (!isNonFatalError(error)) {
|
|
233
|
+
throw error;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
yield* walkRecursive(dir);
|
|
238
|
+
}
|
|
206
239
|
async function getMapFiles(baseDir) {
|
|
207
|
-
const
|
|
208
|
-
const
|
|
240
|
+
const mapFiles = [];
|
|
241
|
+
for await (const entry of walk(baseDir, filename => filename.endsWith('.js.map'), (root, dirname) => root !== '/proc' && dirname !== '.git' && dirname !== 'node_modules')) {
|
|
242
|
+
mapFiles.push(path.relative(baseDir, entry));
|
|
243
|
+
}
|
|
209
244
|
return mapFiles;
|
|
210
245
|
}
|
|
211
246
|
//# sourceMappingURL=sourcemapper.js.map
|
|
@@ -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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C,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"}
|
|
@@ -31,6 +31,6 @@ export interface TimeProfilerOptions {
|
|
|
31
31
|
*/
|
|
32
32
|
lineNumbers?: boolean;
|
|
33
33
|
}
|
|
34
|
-
export declare function profile(options: TimeProfilerOptions): Promise<import("
|
|
35
|
-
export declare function start(intervalMicros?: Microseconds, name?: string, sourceMapper?: SourceMapper, lineNumbers?: boolean): (restart?: boolean) => import("
|
|
34
|
+
export declare function profile(options: TimeProfilerOptions): Promise<import("pprof-format").Profile>;
|
|
35
|
+
export declare function start(intervalMicros?: Microseconds, name?: string, sourceMapper?: SourceMapper, lineNumbers?: boolean): (restart?: boolean) => import("pprof-format").Profile;
|
|
36
36
|
export {};
|
package/out/src/v8-types.d.ts
CHANGED
|
@@ -55,10 +55,14 @@ export interface CpuProfile {
|
|
|
55
55
|
export interface LabelSet {
|
|
56
56
|
[key: string]: string | number;
|
|
57
57
|
}
|
|
58
|
+
export interface LabelsCpu {
|
|
59
|
+
labels: LabelSet;
|
|
60
|
+
cpuTime: number;
|
|
61
|
+
}
|
|
58
62
|
export interface CpuProfileNode extends ProfileNode {
|
|
59
63
|
hitCount: number;
|
|
60
64
|
cpuTime: number;
|
|
61
|
-
labelSets:
|
|
65
|
+
labelSets: LabelsCpu[];
|
|
62
66
|
}
|
|
63
67
|
export interface CpuProfileSample {
|
|
64
68
|
labels: LabelSet;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/pprof",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-pre-b7ce6e3",
|
|
4
4
|
"description": "pprof support for Node.js",
|
|
5
5
|
"repository": "datadog/pprof-nodejs",
|
|
6
6
|
"main": "out/src/index.js",
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
"prebuild": "node scripts/prebuild.js",
|
|
19
19
|
"prebuilds": "node scripts/prebuilds.js",
|
|
20
20
|
"prepare": "npm run compile",
|
|
21
|
-
"pretest": "npm run compile && npm run rebuild"
|
|
22
|
-
"proto": "npm run proto:profile",
|
|
23
|
-
"proto:profile": "mkdir -p proto && npx --yes pbjs -t static-module -w commonjs -o proto/profile.js third_party/proto/profile.proto && pbts -o proto/profile.d.ts proto/profile.js"
|
|
21
|
+
"pretest": "npm run compile && npm run rebuild"
|
|
24
22
|
},
|
|
25
23
|
"author": {
|
|
26
24
|
"name": "Google Inc."
|
|
@@ -28,11 +26,10 @@
|
|
|
28
26
|
"license": "Apache-2.0",
|
|
29
27
|
"dependencies": {
|
|
30
28
|
"delay": "^5.0.0",
|
|
31
|
-
"findit2": "^2.2.3",
|
|
32
29
|
"node-gyp-build": "^3.9.0",
|
|
33
30
|
"p-limit": "^3.1.0",
|
|
34
31
|
"pify": "^5.0.0",
|
|
35
|
-
"
|
|
32
|
+
"pprof-format": "^2.0.5",
|
|
36
33
|
"source-map": "^0.7.3",
|
|
37
34
|
"split": "^1.0.1"
|
|
38
35
|
},
|
|
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
|