@datadog/pprof 1.1.0 → 1.1.1
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/heap-profiler.d.ts +2 -2
- package/out/src/profile-encoder.d.ts +3 -3
- package/out/src/profile-encoder.js +5 -2
- package/out/src/profile-encoder.js.map +1 -1
- package/out/src/profile-serializer.d.ts +4 -4
- package/out/src/profile-serializer.js +59 -35
- package/out/src/profile-serializer.js.map +1 -1
- package/out/src/time-profiler.d.ts +2 -2
- package/package.json +5 -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-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/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/proto/README.md +3 -0
- package/proto/profile.d.ts +1001 -0
- package/proto/profile.js +3161 -0
|
@@ -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("../../proto/profile").perftools.profiles.IProfile | undefined;
|
|
19
19
|
}
|
|
@@ -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 { perftools } from '../../proto/profile';
|
|
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): perftools.profiles.IProfile;
|
|
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 { perftools } from '../../proto/profile';
|
|
18
|
+
export declare function encode(profile: perftools.profiles.IProfile): Promise<Buffer>;
|
|
19
|
+
export declare function encodeSync(profile: perftools.profiles.IProfile): Buffer;
|
|
@@ -18,13 +18,16 @@ 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");
|
|
21
22
|
const gzipPromise = pify(zlib_1.gzip);
|
|
22
23
|
async function encode(profile) {
|
|
23
|
-
|
|
24
|
+
const buffer = profile_1.perftools.profiles.Profile.encode(profile).finish();
|
|
25
|
+
return gzipPromise(buffer);
|
|
24
26
|
}
|
|
25
27
|
exports.encode = encode;
|
|
26
28
|
function encodeSync(profile) {
|
|
27
|
-
|
|
29
|
+
const buffer = profile_1.perftools.profiles.Profile.encode(profile).finish();
|
|
30
|
+
return (0, zlib_1.gzipSync)(buffer);
|
|
28
31
|
}
|
|
29
32
|
exports.encodeSync = encodeSync;
|
|
30
33
|
//# 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;AAEpC,iDAA8C;AAE9C,MAAM,WAAW,GAAG,IAAI,CAAC,WAAI,CAAC,CAAC;AAExB,KAAK,UAAU,MAAM,CAC1B,OAAoC;IAEpC,MAAM,MAAM,GAAG,mBAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IACnE,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC;AALD,wBAKC;AAED,SAAgB,UAAU,CAAC,OAAoC;IAC7D,MAAM,MAAM,GAAG,mBAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IACnE,OAAO,IAAA,eAAQ,EAAC,MAAM,CAAC,CAAC;AAC1B,CAAC;AAHD,gCAGC"}
|
|
@@ -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 { perftools } from '../../proto/profile';
|
|
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): perftools.profiles.IProfile;
|
|
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): perftools.profiles.IProfile;
|
|
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): perftools.profiles.IProfile;
|
|
@@ -16,12 +16,36 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.serializeHeapProfile = exports.serializeCpuProfile = exports.serializeTimeProfile = void 0;
|
|
19
|
-
const
|
|
19
|
+
const profile_1 = require("../../proto/profile");
|
|
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
|
+
}
|
|
25
49
|
/**
|
|
26
50
|
* Takes v8 profile and populates sample, location, and function fields of
|
|
27
51
|
* profile.proto.
|
|
@@ -63,7 +87,7 @@ function serialize(profile, root, appendToSamples, stringTable, ignoreSamplesPat
|
|
|
63
87
|
profile.sample = samples;
|
|
64
88
|
profile.location = locations;
|
|
65
89
|
profile.function = functions;
|
|
66
|
-
profile.stringTable = stringTable;
|
|
90
|
+
profile.stringTable = stringTable.strings;
|
|
67
91
|
function getLocation(node, sourceMapper) {
|
|
68
92
|
let profLoc = {
|
|
69
93
|
file: node.scriptName || '',
|
|
@@ -85,12 +109,12 @@ function serialize(profile, root, appendToSamples, stringTable, ignoreSamplesPat
|
|
|
85
109
|
id = locations.length + 1;
|
|
86
110
|
locationIdMap.set(keyStr, id);
|
|
87
111
|
const line = getLine(node.scriptId, profLoc.file, profLoc.name, profLoc.line);
|
|
88
|
-
const location = new
|
|
112
|
+
const location = new profile_1.perftools.profiles.Location({ id, line: [line] });
|
|
89
113
|
locations.push(location);
|
|
90
114
|
return location;
|
|
91
115
|
}
|
|
92
116
|
function getLine(scriptId, scriptName, name, line) {
|
|
93
|
-
return new
|
|
117
|
+
return new profile_1.perftools.profiles.Line({
|
|
94
118
|
functionId: getFunction(scriptId, scriptName, name).id,
|
|
95
119
|
line,
|
|
96
120
|
});
|
|
@@ -104,12 +128,12 @@ function serialize(profile, root, appendToSamples, stringTable, ignoreSamplesPat
|
|
|
104
128
|
}
|
|
105
129
|
id = functions.length + 1;
|
|
106
130
|
functionIdMap.set(keyStr, id);
|
|
107
|
-
const nameId = stringTable.
|
|
108
|
-
const f = new
|
|
131
|
+
const nameId = stringTable.getIndexOrAdd(name || '(anonymous)');
|
|
132
|
+
const f = new profile_1.perftools.profiles.Function({
|
|
109
133
|
id,
|
|
110
134
|
name: nameId,
|
|
111
135
|
systemName: nameId,
|
|
112
|
-
filename: stringTable.
|
|
136
|
+
filename: stringTable.getIndexOrAdd(scriptName || ''),
|
|
113
137
|
});
|
|
114
138
|
functions.push(f);
|
|
115
139
|
return f;
|
|
@@ -120,9 +144,9 @@ function serialize(profile, root, appendToSamples, stringTable, ignoreSamplesPat
|
|
|
120
144
|
* adds strings used in this value type to the table.
|
|
121
145
|
*/
|
|
122
146
|
function createSampleCountValueType(table) {
|
|
123
|
-
return new
|
|
124
|
-
type: table.
|
|
125
|
-
unit: table.
|
|
147
|
+
return new profile_1.perftools.profiles.ValueType({
|
|
148
|
+
type: table.getIndexOrAdd('sample'),
|
|
149
|
+
unit: table.getIndexOrAdd('count'),
|
|
126
150
|
});
|
|
127
151
|
}
|
|
128
152
|
/**
|
|
@@ -130,9 +154,9 @@ function createSampleCountValueType(table) {
|
|
|
130
154
|
* adds strings used in this value type to the table.
|
|
131
155
|
*/
|
|
132
156
|
function createTimeValueType(table) {
|
|
133
|
-
return new
|
|
134
|
-
type: table.
|
|
135
|
-
unit: table.
|
|
157
|
+
return new profile_1.perftools.profiles.ValueType({
|
|
158
|
+
type: table.getIndexOrAdd('wall'),
|
|
159
|
+
unit: table.getIndexOrAdd('nanoseconds'),
|
|
136
160
|
});
|
|
137
161
|
}
|
|
138
162
|
/**
|
|
@@ -140,9 +164,9 @@ function createTimeValueType(table) {
|
|
|
140
164
|
* adds strings used in this value type to the table.
|
|
141
165
|
*/
|
|
142
166
|
function createCpuValueType(table) {
|
|
143
|
-
return new
|
|
144
|
-
type: table.
|
|
145
|
-
unit: table.
|
|
167
|
+
return new profile_1.perftools.profiles.ValueType({
|
|
168
|
+
type: table.getIndexOrAdd('cpu'),
|
|
169
|
+
unit: table.getIndexOrAdd('nanoseconds'),
|
|
146
170
|
});
|
|
147
171
|
}
|
|
148
172
|
/**
|
|
@@ -150,9 +174,9 @@ function createCpuValueType(table) {
|
|
|
150
174
|
* adds strings used in this value type to the table.
|
|
151
175
|
*/
|
|
152
176
|
function createObjectCountValueType(table) {
|
|
153
|
-
return new
|
|
154
|
-
type: table.
|
|
155
|
-
unit: table.
|
|
177
|
+
return new profile_1.perftools.profiles.ValueType({
|
|
178
|
+
type: table.getIndexOrAdd('objects'),
|
|
179
|
+
unit: table.getIndexOrAdd('count'),
|
|
156
180
|
});
|
|
157
181
|
}
|
|
158
182
|
/**
|
|
@@ -160,9 +184,9 @@ function createObjectCountValueType(table) {
|
|
|
160
184
|
* adds strings used in this value type to the table.
|
|
161
185
|
*/
|
|
162
186
|
function createAllocationValueType(table) {
|
|
163
|
-
return new
|
|
164
|
-
type: table.
|
|
165
|
-
unit: table.
|
|
187
|
+
return new profile_1.perftools.profiles.ValueType({
|
|
188
|
+
type: table.getIndexOrAdd('space'),
|
|
189
|
+
unit: table.getIndexOrAdd('bytes'),
|
|
166
190
|
});
|
|
167
191
|
}
|
|
168
192
|
/**
|
|
@@ -176,14 +200,14 @@ function serializeTimeProfile(prof, intervalMicros, sourceMapper) {
|
|
|
176
200
|
const intervalNanos = intervalMicros * 1000;
|
|
177
201
|
const appendTimeEntryToSamples = (entry, samples) => {
|
|
178
202
|
if (entry.node.hitCount > 0) {
|
|
179
|
-
const sample = new
|
|
203
|
+
const sample = new profile_1.perftools.profiles.Sample({
|
|
180
204
|
locationId: entry.stack,
|
|
181
205
|
value: [entry.node.hitCount, entry.node.hitCount * intervalNanos],
|
|
182
206
|
});
|
|
183
207
|
samples.push(sample);
|
|
184
208
|
}
|
|
185
209
|
};
|
|
186
|
-
const stringTable = new
|
|
210
|
+
const stringTable = new StringTable();
|
|
187
211
|
const sampleValueType = createSampleCountValueType(stringTable);
|
|
188
212
|
const timeValueType = createTimeValueType(stringTable);
|
|
189
213
|
const profile = {
|
|
@@ -194,18 +218,18 @@ function serializeTimeProfile(prof, intervalMicros, sourceMapper) {
|
|
|
194
218
|
period: intervalMicros,
|
|
195
219
|
};
|
|
196
220
|
serialize(profile, prof.topDownRoot, appendTimeEntryToSamples, stringTable, undefined, sourceMapper);
|
|
197
|
-
return
|
|
221
|
+
return profile;
|
|
198
222
|
}
|
|
199
223
|
exports.serializeTimeProfile = serializeTimeProfile;
|
|
200
224
|
function buildLabels(labelSet, stringTable) {
|
|
201
225
|
const labels = [];
|
|
202
226
|
for (const [key, value] of Object.entries(labelSet)) {
|
|
203
227
|
if (typeof value === 'number' || typeof value === 'string') {
|
|
204
|
-
const label = new
|
|
205
|
-
key: stringTable.
|
|
228
|
+
const label = new profile_1.perftools.profiles.Label({
|
|
229
|
+
key: stringTable.getIndexOrAdd(key),
|
|
206
230
|
num: typeof value === 'number' ? value : undefined,
|
|
207
231
|
str: typeof value === 'string'
|
|
208
|
-
? stringTable.
|
|
232
|
+
? stringTable.getIndexOrAdd(value)
|
|
209
233
|
: undefined,
|
|
210
234
|
});
|
|
211
235
|
labels.push(label);
|
|
@@ -224,7 +248,7 @@ function serializeCpuProfile(prof, intervalMicros, sourceMapper) {
|
|
|
224
248
|
const intervalNanos = intervalMicros * 1000;
|
|
225
249
|
const appendCpuEntryToSamples = (entry, samples) => {
|
|
226
250
|
for (const labelSet of entry.node.labelSets) {
|
|
227
|
-
const sample = new
|
|
251
|
+
const sample = new profile_1.perftools.profiles.Sample({
|
|
228
252
|
locationId: entry.stack,
|
|
229
253
|
value: [1, intervalNanos],
|
|
230
254
|
label: buildLabels(labelSet, stringTable),
|
|
@@ -233,7 +257,7 @@ function serializeCpuProfile(prof, intervalMicros, sourceMapper) {
|
|
|
233
257
|
}
|
|
234
258
|
const unknownEntryCount = entry.node.hitCount - entry.node.labelSets.length;
|
|
235
259
|
if (unknownEntryCount > 0) {
|
|
236
|
-
const sample = new
|
|
260
|
+
const sample = new profile_1.perftools.profiles.Sample({
|
|
237
261
|
locationId: entry.stack,
|
|
238
262
|
value: [
|
|
239
263
|
unknownEntryCount,
|
|
@@ -244,7 +268,7 @@ function serializeCpuProfile(prof, intervalMicros, sourceMapper) {
|
|
|
244
268
|
samples.push(sample);
|
|
245
269
|
}
|
|
246
270
|
};
|
|
247
|
-
const stringTable = new
|
|
271
|
+
const stringTable = new StringTable();
|
|
248
272
|
const sampleValueType = createSampleCountValueType(stringTable);
|
|
249
273
|
// const wallValueType = createTimeValueType(stringTable);
|
|
250
274
|
const cpuValueType = createCpuValueType(stringTable);
|
|
@@ -256,7 +280,7 @@ function serializeCpuProfile(prof, intervalMicros, sourceMapper) {
|
|
|
256
280
|
period: intervalMicros,
|
|
257
281
|
};
|
|
258
282
|
serialize(profile, prof.topDownRoot, appendCpuEntryToSamples, stringTable, undefined, sourceMapper);
|
|
259
|
-
return
|
|
283
|
+
return profile;
|
|
260
284
|
}
|
|
261
285
|
exports.serializeCpuProfile = serializeCpuProfile;
|
|
262
286
|
/**
|
|
@@ -273,7 +297,7 @@ function serializeHeapProfile(prof, startTimeNanos, intervalBytes, ignoreSamples
|
|
|
273
297
|
const appendHeapEntryToSamples = (entry, samples) => {
|
|
274
298
|
if (entry.node.allocations.length > 0) {
|
|
275
299
|
for (const alloc of entry.node.allocations) {
|
|
276
|
-
const sample = new
|
|
300
|
+
const sample = new profile_1.perftools.profiles.Sample({
|
|
277
301
|
locationId: entry.stack,
|
|
278
302
|
value: [alloc.count, alloc.sizeBytes * alloc.count],
|
|
279
303
|
// TODO: add tag for allocation size
|
|
@@ -282,7 +306,7 @@ function serializeHeapProfile(prof, startTimeNanos, intervalBytes, ignoreSamples
|
|
|
282
306
|
}
|
|
283
307
|
}
|
|
284
308
|
};
|
|
285
|
-
const stringTable = new
|
|
309
|
+
const stringTable = new StringTable();
|
|
286
310
|
const sampleValueType = createObjectCountValueType(stringTable);
|
|
287
311
|
const allocationValueType = createAllocationValueType(stringTable);
|
|
288
312
|
const profile = {
|
|
@@ -292,7 +316,7 @@ function serializeHeapProfile(prof, startTimeNanos, intervalBytes, ignoreSamples
|
|
|
292
316
|
period: intervalBytes,
|
|
293
317
|
};
|
|
294
318
|
serialize(profile, prof, appendHeapEntryToSamples, stringTable, ignoreSamplesPath, sourceMapper);
|
|
295
|
-
return
|
|
319
|
+
return profile;
|
|
296
320
|
}
|
|
297
321
|
exports.serializeHeapProfile = serializeHeapProfile;
|
|
298
322
|
//# 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,iDAA8C;AAsC9C,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;;;GAGG;AACH,MAAM,WAAW;IAIf;QACE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC5C,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,aAAa,CAAC,GAAW;QACvB,IAAI,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,GAAG,KAAK,SAAS,EAAE;YACrB,OAAO,GAAG,CAAC;SACZ;QACD,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC9B,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,SAAS,SAAS,CAChB,OAAoC,EACpC,IAAO,EACP,eAAwC,EACxC,WAAwB,EACxB,iBAA0B,EAC1B,YAA2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C,UAAU,EAAE,KAAK,CAAC,KAAK;oBACvB,KAAK,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC;oBACnD,oCAAoC;iBACrC,CAAC,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACtB;SACF;IACH,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,IAAI,WAAW,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;IACF,OAAO,OAAO,CAAC;AACjB,CAAC;AA7CD,oDA6CC"}
|
|
@@ -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("../../proto/profile").perftools.profiles.IProfile>;
|
|
35
|
+
export declare function start(intervalMicros?: Microseconds, name?: string, sourceMapper?: SourceMapper, lineNumbers?: boolean): (restart?: boolean) => import("../../proto/profile").perftools.profiles.IProfile;
|
|
36
36
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/pprof",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "pprof support for Node.js",
|
|
5
5
|
"repository": "datadog/pprof-nodejs",
|
|
6
6
|
"main": "out/src/index.js",
|
|
@@ -18,7 +18,9 @@
|
|
|
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"
|
|
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"
|
|
22
24
|
},
|
|
23
25
|
"author": {
|
|
24
26
|
"name": "Google Inc."
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
"node-gyp-build": "^3.9.0",
|
|
31
33
|
"p-limit": "^3.1.0",
|
|
32
34
|
"pify": "^5.0.0",
|
|
33
|
-
"
|
|
35
|
+
"protobufjs": "^7.0.0",
|
|
34
36
|
"source-map": "^0.7.3",
|
|
35
37
|
"split": "^1.0.1"
|
|
36
38
|
},
|
|
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
|
package/proto/README.md
ADDED