@datadog/pprof 1.1.0 → 2.0.0-pre-9983949

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 (85) hide show
  1. package/out/src/cpu-profiler.d.ts +1 -1
  2. package/out/src/cpu-profiler.js +10 -5
  3. package/out/src/cpu-profiler.js.map +1 -1
  4. package/out/src/heap-profiler.d.ts +2 -2
  5. package/out/src/profile-encoder.d.ts +3 -3
  6. package/out/src/profile-encoder.js +5 -2
  7. package/out/src/profile-encoder.js.map +1 -1
  8. package/out/src/profile-serializer.d.ts +4 -4
  9. package/out/src/profile-serializer.js +66 -47
  10. package/out/src/profile-serializer.js.map +1 -1
  11. package/out/src/sourcemapper/sourcemapper.js +38 -3
  12. package/out/src/sourcemapper/sourcemapper.js.map +1 -1
  13. package/out/src/time-profiler.d.ts +2 -2
  14. package/out/src/v8-types.d.ts +5 -1
  15. package/package.json +5 -4
  16. package/prebuilds/darwin-arm64/node-102.node +0 -0
  17. package/prebuilds/darwin-arm64/node-108.node +0 -0
  18. package/prebuilds/darwin-arm64/node-111.node +0 -0
  19. package/prebuilds/darwin-arm64/node-72.node +0 -0
  20. package/prebuilds/darwin-arm64/node-79.node +0 -0
  21. package/prebuilds/darwin-arm64/node-83.node +0 -0
  22. package/prebuilds/darwin-arm64/node-88.node +0 -0
  23. package/prebuilds/darwin-arm64/node-93.node +0 -0
  24. package/prebuilds/darwin-x64/node-102.node +0 -0
  25. package/prebuilds/darwin-x64/node-108.node +0 -0
  26. package/prebuilds/darwin-x64/node-111.node +0 -0
  27. package/prebuilds/darwin-x64/node-72.node +0 -0
  28. package/prebuilds/darwin-x64/node-79.node +0 -0
  29. package/prebuilds/darwin-x64/node-83.node +0 -0
  30. package/prebuilds/darwin-x64/node-88.node +0 -0
  31. package/prebuilds/darwin-x64/node-93.node +0 -0
  32. package/prebuilds/linux-arm/node-102.node +0 -0
  33. package/prebuilds/linux-arm/node-108.node +0 -0
  34. package/prebuilds/linux-arm/node-111.node +0 -0
  35. package/prebuilds/linux-arm/node-72.node +0 -0
  36. package/prebuilds/linux-arm/node-79.node +0 -0
  37. package/prebuilds/linux-arm/node-83.node +0 -0
  38. package/prebuilds/linux-arm/node-88.node +0 -0
  39. package/prebuilds/linux-arm/node-93.node +0 -0
  40. package/prebuilds/linux-arm64/node-102.node +0 -0
  41. package/prebuilds/linux-arm64/node-108.node +0 -0
  42. package/prebuilds/linux-arm64/node-111.node +0 -0
  43. package/prebuilds/linux-arm64/node-72.node +0 -0
  44. package/prebuilds/linux-arm64/node-79.node +0 -0
  45. package/prebuilds/linux-arm64/node-83.node +0 -0
  46. package/prebuilds/linux-arm64/node-88.node +0 -0
  47. package/prebuilds/linux-arm64/node-93.node +0 -0
  48. package/prebuilds/linux-ia32/node-72.node +0 -0
  49. package/prebuilds/linux-ia32/node-79.node +0 -0
  50. package/prebuilds/linux-x64/node-102.node +0 -0
  51. package/prebuilds/linux-x64/node-108.node +0 -0
  52. package/prebuilds/linux-x64/node-111.node +0 -0
  53. package/prebuilds/linux-x64/node-72.node +0 -0
  54. package/prebuilds/linux-x64/node-79.node +0 -0
  55. package/prebuilds/linux-x64/node-83.node +0 -0
  56. package/prebuilds/linux-x64/node-88.node +0 -0
  57. package/prebuilds/linux-x64/node-93.node +0 -0
  58. package/prebuilds/linuxmusl-x64/node-102.node +0 -0
  59. package/prebuilds/linuxmusl-x64/node-108.node +0 -0
  60. package/prebuilds/linuxmusl-x64/node-111.node +0 -0
  61. package/prebuilds/linuxmusl-x64/node-72.node +0 -0
  62. package/prebuilds/linuxmusl-x64/node-79.node +0 -0
  63. package/prebuilds/linuxmusl-x64/node-83.node +0 -0
  64. package/prebuilds/linuxmusl-x64/node-88.node +0 -0
  65. package/prebuilds/linuxmusl-x64/node-93.node +0 -0
  66. package/prebuilds/win32-ia32/node-102.node +0 -0
  67. package/prebuilds/win32-ia32/node-72.node +0 -0
  68. package/prebuilds/win32-ia32/node-79.node +0 -0
  69. package/prebuilds/win32-ia32/node-83.node +0 -0
  70. package/prebuilds/win32-ia32/node-88.node +0 -0
  71. package/prebuilds/win32-ia32/node-93.node +0 -0
  72. package/prebuilds/win32-x64/node-102.node +0 -0
  73. package/prebuilds/win32-x64/node-108.node +0 -0
  74. package/prebuilds/win32-x64/node-111.node +0 -0
  75. package/prebuilds/win32-x64/node-72.node +0 -0
  76. package/prebuilds/win32-x64/node-79.node +0 -0
  77. package/prebuilds/win32-x64/node-83.node +0 -0
  78. package/prebuilds/win32-x64/node-88.node +0 -0
  79. package/prebuilds/win32-x64/node-93.node +0 -0
  80. package/proto/README.md +3 -0
  81. package/proto/profile.d.ts +1001 -0
  82. package/proto/profile.js +3161 -0
  83. package/out/third_party/cloud-debug-nodejs/src/agent/io/scanner.d.ts +0 -29
  84. package/out/third_party/cloud-debug-nodejs/src/agent/io/scanner.js +0 -214
  85. package/out/third_party/cloud-debug-nodejs/src/agent/io/scanner.js.map +0 -1
@@ -0,0 +1,3161 @@
1
+ /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
2
+ "use strict";
3
+
4
+ var $protobuf = require("protobufjs/minimal");
5
+
6
+ // Common aliases
7
+ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
8
+
9
+ // Exported root namespace
10
+ var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
11
+
12
+ $root.perftools = (function() {
13
+
14
+ /**
15
+ * Namespace perftools.
16
+ * @exports perftools
17
+ * @namespace
18
+ */
19
+ var perftools = {};
20
+
21
+ perftools.profiles = (function() {
22
+
23
+ /**
24
+ * Namespace profiles.
25
+ * @memberof perftools
26
+ * @namespace
27
+ */
28
+ var profiles = {};
29
+
30
+ profiles.Profile = (function() {
31
+
32
+ /**
33
+ * Properties of a Profile.
34
+ * @memberof perftools.profiles
35
+ * @interface IProfile
36
+ * @property {Array.<perftools.profiles.IValueType>|null} [sampleType] Profile sampleType
37
+ * @property {Array.<perftools.profiles.ISample>|null} [sample] Profile sample
38
+ * @property {Array.<perftools.profiles.IMapping>|null} [mapping] Profile mapping
39
+ * @property {Array.<perftools.profiles.ILocation>|null} [location] Profile location
40
+ * @property {Array.<perftools.profiles.IFunction>|null} ["function"] Profile function
41
+ * @property {Array.<string>|null} [stringTable] Profile stringTable
42
+ * @property {number|Long|null} [dropFrames] Profile dropFrames
43
+ * @property {number|Long|null} [keepFrames] Profile keepFrames
44
+ * @property {number|Long|null} [timeNanos] Profile timeNanos
45
+ * @property {number|Long|null} [durationNanos] Profile durationNanos
46
+ * @property {perftools.profiles.IValueType|null} [periodType] Profile periodType
47
+ * @property {number|Long|null} [period] Profile period
48
+ * @property {Array.<number|Long>|null} [comment] Profile comment
49
+ * @property {number|Long|null} [defaultSampleType] Profile defaultSampleType
50
+ */
51
+
52
+ /**
53
+ * Constructs a new Profile.
54
+ * @memberof perftools.profiles
55
+ * @classdesc Represents a Profile.
56
+ * @implements IProfile
57
+ * @constructor
58
+ * @param {perftools.profiles.IProfile=} [properties] Properties to set
59
+ */
60
+ function Profile(properties) {
61
+ this.sampleType = [];
62
+ this.sample = [];
63
+ this.mapping = [];
64
+ this.location = [];
65
+ this["function"] = [];
66
+ this.stringTable = [];
67
+ this.comment = [];
68
+ if (properties)
69
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
70
+ if (properties[keys[i]] != null)
71
+ this[keys[i]] = properties[keys[i]];
72
+ }
73
+
74
+ /**
75
+ * Profile sampleType.
76
+ * @member {Array.<perftools.profiles.IValueType>} sampleType
77
+ * @memberof perftools.profiles.Profile
78
+ * @instance
79
+ */
80
+ Profile.prototype.sampleType = $util.emptyArray;
81
+
82
+ /**
83
+ * Profile sample.
84
+ * @member {Array.<perftools.profiles.ISample>} sample
85
+ * @memberof perftools.profiles.Profile
86
+ * @instance
87
+ */
88
+ Profile.prototype.sample = $util.emptyArray;
89
+
90
+ /**
91
+ * Profile mapping.
92
+ * @member {Array.<perftools.profiles.IMapping>} mapping
93
+ * @memberof perftools.profiles.Profile
94
+ * @instance
95
+ */
96
+ Profile.prototype.mapping = $util.emptyArray;
97
+
98
+ /**
99
+ * Profile location.
100
+ * @member {Array.<perftools.profiles.ILocation>} location
101
+ * @memberof perftools.profiles.Profile
102
+ * @instance
103
+ */
104
+ Profile.prototype.location = $util.emptyArray;
105
+
106
+ /**
107
+ * Profile function.
108
+ * @member {Array.<perftools.profiles.IFunction>} function
109
+ * @memberof perftools.profiles.Profile
110
+ * @instance
111
+ */
112
+ Profile.prototype["function"] = $util.emptyArray;
113
+
114
+ /**
115
+ * Profile stringTable.
116
+ * @member {Array.<string>} stringTable
117
+ * @memberof perftools.profiles.Profile
118
+ * @instance
119
+ */
120
+ Profile.prototype.stringTable = $util.emptyArray;
121
+
122
+ /**
123
+ * Profile dropFrames.
124
+ * @member {number|Long} dropFrames
125
+ * @memberof perftools.profiles.Profile
126
+ * @instance
127
+ */
128
+ Profile.prototype.dropFrames = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
129
+
130
+ /**
131
+ * Profile keepFrames.
132
+ * @member {number|Long} keepFrames
133
+ * @memberof perftools.profiles.Profile
134
+ * @instance
135
+ */
136
+ Profile.prototype.keepFrames = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
137
+
138
+ /**
139
+ * Profile timeNanos.
140
+ * @member {number|Long} timeNanos
141
+ * @memberof perftools.profiles.Profile
142
+ * @instance
143
+ */
144
+ Profile.prototype.timeNanos = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
145
+
146
+ /**
147
+ * Profile durationNanos.
148
+ * @member {number|Long} durationNanos
149
+ * @memberof perftools.profiles.Profile
150
+ * @instance
151
+ */
152
+ Profile.prototype.durationNanos = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
153
+
154
+ /**
155
+ * Profile periodType.
156
+ * @member {perftools.profiles.IValueType|null|undefined} periodType
157
+ * @memberof perftools.profiles.Profile
158
+ * @instance
159
+ */
160
+ Profile.prototype.periodType = null;
161
+
162
+ /**
163
+ * Profile period.
164
+ * @member {number|Long} period
165
+ * @memberof perftools.profiles.Profile
166
+ * @instance
167
+ */
168
+ Profile.prototype.period = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
169
+
170
+ /**
171
+ * Profile comment.
172
+ * @member {Array.<number|Long>} comment
173
+ * @memberof perftools.profiles.Profile
174
+ * @instance
175
+ */
176
+ Profile.prototype.comment = $util.emptyArray;
177
+
178
+ /**
179
+ * Profile defaultSampleType.
180
+ * @member {number|Long} defaultSampleType
181
+ * @memberof perftools.profiles.Profile
182
+ * @instance
183
+ */
184
+ Profile.prototype.defaultSampleType = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
185
+
186
+ /**
187
+ * Creates a new Profile instance using the specified properties.
188
+ * @function create
189
+ * @memberof perftools.profiles.Profile
190
+ * @static
191
+ * @param {perftools.profiles.IProfile=} [properties] Properties to set
192
+ * @returns {perftools.profiles.Profile} Profile instance
193
+ */
194
+ Profile.create = function create(properties) {
195
+ return new Profile(properties);
196
+ };
197
+
198
+ /**
199
+ * Encodes the specified Profile message. Does not implicitly {@link perftools.profiles.Profile.verify|verify} messages.
200
+ * @function encode
201
+ * @memberof perftools.profiles.Profile
202
+ * @static
203
+ * @param {perftools.profiles.IProfile} message Profile message or plain object to encode
204
+ * @param {$protobuf.Writer} [writer] Writer to encode to
205
+ * @returns {$protobuf.Writer} Writer
206
+ */
207
+ Profile.encode = function encode(message, writer) {
208
+ if (!writer)
209
+ writer = $Writer.create();
210
+ if (message.sampleType != null && message.sampleType.length)
211
+ for (var i = 0; i < message.sampleType.length; ++i)
212
+ $root.perftools.profiles.ValueType.encode(message.sampleType[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
213
+ if (message.sample != null && message.sample.length)
214
+ for (var i = 0; i < message.sample.length; ++i)
215
+ $root.perftools.profiles.Sample.encode(message.sample[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
216
+ if (message.mapping != null && message.mapping.length)
217
+ for (var i = 0; i < message.mapping.length; ++i)
218
+ $root.perftools.profiles.Mapping.encode(message.mapping[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
219
+ if (message.location != null && message.location.length)
220
+ for (var i = 0; i < message.location.length; ++i)
221
+ $root.perftools.profiles.Location.encode(message.location[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
222
+ if (message["function"] != null && message["function"].length)
223
+ for (var i = 0; i < message["function"].length; ++i)
224
+ $root.perftools.profiles.Function.encode(message["function"][i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
225
+ if (message.stringTable != null && message.stringTable.length)
226
+ for (var i = 0; i < message.stringTable.length; ++i)
227
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.stringTable[i]);
228
+ if (message.dropFrames != null && Object.hasOwnProperty.call(message, "dropFrames"))
229
+ writer.uint32(/* id 7, wireType 0 =*/56).int64(message.dropFrames);
230
+ if (message.keepFrames != null && Object.hasOwnProperty.call(message, "keepFrames"))
231
+ writer.uint32(/* id 8, wireType 0 =*/64).int64(message.keepFrames);
232
+ if (message.timeNanos != null && Object.hasOwnProperty.call(message, "timeNanos"))
233
+ writer.uint32(/* id 9, wireType 0 =*/72).int64(message.timeNanos);
234
+ if (message.durationNanos != null && Object.hasOwnProperty.call(message, "durationNanos"))
235
+ writer.uint32(/* id 10, wireType 0 =*/80).int64(message.durationNanos);
236
+ if (message.periodType != null && Object.hasOwnProperty.call(message, "periodType"))
237
+ $root.perftools.profiles.ValueType.encode(message.periodType, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
238
+ if (message.period != null && Object.hasOwnProperty.call(message, "period"))
239
+ writer.uint32(/* id 12, wireType 0 =*/96).int64(message.period);
240
+ if (message.comment != null && message.comment.length) {
241
+ writer.uint32(/* id 13, wireType 2 =*/106).fork();
242
+ for (var i = 0; i < message.comment.length; ++i)
243
+ writer.int64(message.comment[i]);
244
+ writer.ldelim();
245
+ }
246
+ if (message.defaultSampleType != null && Object.hasOwnProperty.call(message, "defaultSampleType"))
247
+ writer.uint32(/* id 14, wireType 0 =*/112).int64(message.defaultSampleType);
248
+ return writer;
249
+ };
250
+
251
+ /**
252
+ * Encodes the specified Profile message, length delimited. Does not implicitly {@link perftools.profiles.Profile.verify|verify} messages.
253
+ * @function encodeDelimited
254
+ * @memberof perftools.profiles.Profile
255
+ * @static
256
+ * @param {perftools.profiles.IProfile} message Profile message or plain object to encode
257
+ * @param {$protobuf.Writer} [writer] Writer to encode to
258
+ * @returns {$protobuf.Writer} Writer
259
+ */
260
+ Profile.encodeDelimited = function encodeDelimited(message, writer) {
261
+ return this.encode(message, writer).ldelim();
262
+ };
263
+
264
+ /**
265
+ * Decodes a Profile message from the specified reader or buffer.
266
+ * @function decode
267
+ * @memberof perftools.profiles.Profile
268
+ * @static
269
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
270
+ * @param {number} [length] Message length if known beforehand
271
+ * @returns {perftools.profiles.Profile} Profile
272
+ * @throws {Error} If the payload is not a reader or valid buffer
273
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
274
+ */
275
+ Profile.decode = function decode(reader, length) {
276
+ if (!(reader instanceof $Reader))
277
+ reader = $Reader.create(reader);
278
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.perftools.profiles.Profile();
279
+ while (reader.pos < end) {
280
+ var tag = reader.uint32();
281
+ switch (tag >>> 3) {
282
+ case 1: {
283
+ if (!(message.sampleType && message.sampleType.length))
284
+ message.sampleType = [];
285
+ message.sampleType.push($root.perftools.profiles.ValueType.decode(reader, reader.uint32()));
286
+ break;
287
+ }
288
+ case 2: {
289
+ if (!(message.sample && message.sample.length))
290
+ message.sample = [];
291
+ message.sample.push($root.perftools.profiles.Sample.decode(reader, reader.uint32()));
292
+ break;
293
+ }
294
+ case 3: {
295
+ if (!(message.mapping && message.mapping.length))
296
+ message.mapping = [];
297
+ message.mapping.push($root.perftools.profiles.Mapping.decode(reader, reader.uint32()));
298
+ break;
299
+ }
300
+ case 4: {
301
+ if (!(message.location && message.location.length))
302
+ message.location = [];
303
+ message.location.push($root.perftools.profiles.Location.decode(reader, reader.uint32()));
304
+ break;
305
+ }
306
+ case 5: {
307
+ if (!(message["function"] && message["function"].length))
308
+ message["function"] = [];
309
+ message["function"].push($root.perftools.profiles.Function.decode(reader, reader.uint32()));
310
+ break;
311
+ }
312
+ case 6: {
313
+ if (!(message.stringTable && message.stringTable.length))
314
+ message.stringTable = [];
315
+ message.stringTable.push(reader.string());
316
+ break;
317
+ }
318
+ case 7: {
319
+ message.dropFrames = reader.int64();
320
+ break;
321
+ }
322
+ case 8: {
323
+ message.keepFrames = reader.int64();
324
+ break;
325
+ }
326
+ case 9: {
327
+ message.timeNanos = reader.int64();
328
+ break;
329
+ }
330
+ case 10: {
331
+ message.durationNanos = reader.int64();
332
+ break;
333
+ }
334
+ case 11: {
335
+ message.periodType = $root.perftools.profiles.ValueType.decode(reader, reader.uint32());
336
+ break;
337
+ }
338
+ case 12: {
339
+ message.period = reader.int64();
340
+ break;
341
+ }
342
+ case 13: {
343
+ if (!(message.comment && message.comment.length))
344
+ message.comment = [];
345
+ if ((tag & 7) === 2) {
346
+ var end2 = reader.uint32() + reader.pos;
347
+ while (reader.pos < end2)
348
+ message.comment.push(reader.int64());
349
+ } else
350
+ message.comment.push(reader.int64());
351
+ break;
352
+ }
353
+ case 14: {
354
+ message.defaultSampleType = reader.int64();
355
+ break;
356
+ }
357
+ default:
358
+ reader.skipType(tag & 7);
359
+ break;
360
+ }
361
+ }
362
+ return message;
363
+ };
364
+
365
+ /**
366
+ * Decodes a Profile message from the specified reader or buffer, length delimited.
367
+ * @function decodeDelimited
368
+ * @memberof perftools.profiles.Profile
369
+ * @static
370
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
371
+ * @returns {perftools.profiles.Profile} Profile
372
+ * @throws {Error} If the payload is not a reader or valid buffer
373
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
374
+ */
375
+ Profile.decodeDelimited = function decodeDelimited(reader) {
376
+ if (!(reader instanceof $Reader))
377
+ reader = new $Reader(reader);
378
+ return this.decode(reader, reader.uint32());
379
+ };
380
+
381
+ /**
382
+ * Verifies a Profile message.
383
+ * @function verify
384
+ * @memberof perftools.profiles.Profile
385
+ * @static
386
+ * @param {Object.<string,*>} message Plain object to verify
387
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
388
+ */
389
+ Profile.verify = function verify(message) {
390
+ if (typeof message !== "object" || message === null)
391
+ return "object expected";
392
+ if (message.sampleType != null && message.hasOwnProperty("sampleType")) {
393
+ if (!Array.isArray(message.sampleType))
394
+ return "sampleType: array expected";
395
+ for (var i = 0; i < message.sampleType.length; ++i) {
396
+ var error = $root.perftools.profiles.ValueType.verify(message.sampleType[i]);
397
+ if (error)
398
+ return "sampleType." + error;
399
+ }
400
+ }
401
+ if (message.sample != null && message.hasOwnProperty("sample")) {
402
+ if (!Array.isArray(message.sample))
403
+ return "sample: array expected";
404
+ for (var i = 0; i < message.sample.length; ++i) {
405
+ var error = $root.perftools.profiles.Sample.verify(message.sample[i]);
406
+ if (error)
407
+ return "sample." + error;
408
+ }
409
+ }
410
+ if (message.mapping != null && message.hasOwnProperty("mapping")) {
411
+ if (!Array.isArray(message.mapping))
412
+ return "mapping: array expected";
413
+ for (var i = 0; i < message.mapping.length; ++i) {
414
+ var error = $root.perftools.profiles.Mapping.verify(message.mapping[i]);
415
+ if (error)
416
+ return "mapping." + error;
417
+ }
418
+ }
419
+ if (message.location != null && message.hasOwnProperty("location")) {
420
+ if (!Array.isArray(message.location))
421
+ return "location: array expected";
422
+ for (var i = 0; i < message.location.length; ++i) {
423
+ var error = $root.perftools.profiles.Location.verify(message.location[i]);
424
+ if (error)
425
+ return "location." + error;
426
+ }
427
+ }
428
+ if (message["function"] != null && message.hasOwnProperty("function")) {
429
+ if (!Array.isArray(message["function"]))
430
+ return "function: array expected";
431
+ for (var i = 0; i < message["function"].length; ++i) {
432
+ var error = $root.perftools.profiles.Function.verify(message["function"][i]);
433
+ if (error)
434
+ return "function." + error;
435
+ }
436
+ }
437
+ if (message.stringTable != null && message.hasOwnProperty("stringTable")) {
438
+ if (!Array.isArray(message.stringTable))
439
+ return "stringTable: array expected";
440
+ for (var i = 0; i < message.stringTable.length; ++i)
441
+ if (!$util.isString(message.stringTable[i]))
442
+ return "stringTable: string[] expected";
443
+ }
444
+ if (message.dropFrames != null && message.hasOwnProperty("dropFrames"))
445
+ if (!$util.isInteger(message.dropFrames) && !(message.dropFrames && $util.isInteger(message.dropFrames.low) && $util.isInteger(message.dropFrames.high)))
446
+ return "dropFrames: integer|Long expected";
447
+ if (message.keepFrames != null && message.hasOwnProperty("keepFrames"))
448
+ if (!$util.isInteger(message.keepFrames) && !(message.keepFrames && $util.isInteger(message.keepFrames.low) && $util.isInteger(message.keepFrames.high)))
449
+ return "keepFrames: integer|Long expected";
450
+ if (message.timeNanos != null && message.hasOwnProperty("timeNanos"))
451
+ if (!$util.isInteger(message.timeNanos) && !(message.timeNanos && $util.isInteger(message.timeNanos.low) && $util.isInteger(message.timeNanos.high)))
452
+ return "timeNanos: integer|Long expected";
453
+ if (message.durationNanos != null && message.hasOwnProperty("durationNanos"))
454
+ if (!$util.isInteger(message.durationNanos) && !(message.durationNanos && $util.isInteger(message.durationNanos.low) && $util.isInteger(message.durationNanos.high)))
455
+ return "durationNanos: integer|Long expected";
456
+ if (message.periodType != null && message.hasOwnProperty("periodType")) {
457
+ var error = $root.perftools.profiles.ValueType.verify(message.periodType);
458
+ if (error)
459
+ return "periodType." + error;
460
+ }
461
+ if (message.period != null && message.hasOwnProperty("period"))
462
+ if (!$util.isInteger(message.period) && !(message.period && $util.isInteger(message.period.low) && $util.isInteger(message.period.high)))
463
+ return "period: integer|Long expected";
464
+ if (message.comment != null && message.hasOwnProperty("comment")) {
465
+ if (!Array.isArray(message.comment))
466
+ return "comment: array expected";
467
+ for (var i = 0; i < message.comment.length; ++i)
468
+ if (!$util.isInteger(message.comment[i]) && !(message.comment[i] && $util.isInteger(message.comment[i].low) && $util.isInteger(message.comment[i].high)))
469
+ return "comment: integer|Long[] expected";
470
+ }
471
+ if (message.defaultSampleType != null && message.hasOwnProperty("defaultSampleType"))
472
+ if (!$util.isInteger(message.defaultSampleType) && !(message.defaultSampleType && $util.isInteger(message.defaultSampleType.low) && $util.isInteger(message.defaultSampleType.high)))
473
+ return "defaultSampleType: integer|Long expected";
474
+ return null;
475
+ };
476
+
477
+ /**
478
+ * Creates a Profile message from a plain object. Also converts values to their respective internal types.
479
+ * @function fromObject
480
+ * @memberof perftools.profiles.Profile
481
+ * @static
482
+ * @param {Object.<string,*>} object Plain object
483
+ * @returns {perftools.profiles.Profile} Profile
484
+ */
485
+ Profile.fromObject = function fromObject(object) {
486
+ if (object instanceof $root.perftools.profiles.Profile)
487
+ return object;
488
+ var message = new $root.perftools.profiles.Profile();
489
+ if (object.sampleType) {
490
+ if (!Array.isArray(object.sampleType))
491
+ throw TypeError(".perftools.profiles.Profile.sampleType: array expected");
492
+ message.sampleType = [];
493
+ for (var i = 0; i < object.sampleType.length; ++i) {
494
+ if (typeof object.sampleType[i] !== "object")
495
+ throw TypeError(".perftools.profiles.Profile.sampleType: object expected");
496
+ message.sampleType[i] = $root.perftools.profiles.ValueType.fromObject(object.sampleType[i]);
497
+ }
498
+ }
499
+ if (object.sample) {
500
+ if (!Array.isArray(object.sample))
501
+ throw TypeError(".perftools.profiles.Profile.sample: array expected");
502
+ message.sample = [];
503
+ for (var i = 0; i < object.sample.length; ++i) {
504
+ if (typeof object.sample[i] !== "object")
505
+ throw TypeError(".perftools.profiles.Profile.sample: object expected");
506
+ message.sample[i] = $root.perftools.profiles.Sample.fromObject(object.sample[i]);
507
+ }
508
+ }
509
+ if (object.mapping) {
510
+ if (!Array.isArray(object.mapping))
511
+ throw TypeError(".perftools.profiles.Profile.mapping: array expected");
512
+ message.mapping = [];
513
+ for (var i = 0; i < object.mapping.length; ++i) {
514
+ if (typeof object.mapping[i] !== "object")
515
+ throw TypeError(".perftools.profiles.Profile.mapping: object expected");
516
+ message.mapping[i] = $root.perftools.profiles.Mapping.fromObject(object.mapping[i]);
517
+ }
518
+ }
519
+ if (object.location) {
520
+ if (!Array.isArray(object.location))
521
+ throw TypeError(".perftools.profiles.Profile.location: array expected");
522
+ message.location = [];
523
+ for (var i = 0; i < object.location.length; ++i) {
524
+ if (typeof object.location[i] !== "object")
525
+ throw TypeError(".perftools.profiles.Profile.location: object expected");
526
+ message.location[i] = $root.perftools.profiles.Location.fromObject(object.location[i]);
527
+ }
528
+ }
529
+ if (object["function"]) {
530
+ if (!Array.isArray(object["function"]))
531
+ throw TypeError(".perftools.profiles.Profile.function: array expected");
532
+ message["function"] = [];
533
+ for (var i = 0; i < object["function"].length; ++i) {
534
+ if (typeof object["function"][i] !== "object")
535
+ throw TypeError(".perftools.profiles.Profile.function: object expected");
536
+ message["function"][i] = $root.perftools.profiles.Function.fromObject(object["function"][i]);
537
+ }
538
+ }
539
+ if (object.stringTable) {
540
+ if (!Array.isArray(object.stringTable))
541
+ throw TypeError(".perftools.profiles.Profile.stringTable: array expected");
542
+ message.stringTable = [];
543
+ for (var i = 0; i < object.stringTable.length; ++i)
544
+ message.stringTable[i] = String(object.stringTable[i]);
545
+ }
546
+ if (object.dropFrames != null)
547
+ if ($util.Long)
548
+ (message.dropFrames = $util.Long.fromValue(object.dropFrames)).unsigned = false;
549
+ else if (typeof object.dropFrames === "string")
550
+ message.dropFrames = parseInt(object.dropFrames, 10);
551
+ else if (typeof object.dropFrames === "number")
552
+ message.dropFrames = object.dropFrames;
553
+ else if (typeof object.dropFrames === "object")
554
+ message.dropFrames = new $util.LongBits(object.dropFrames.low >>> 0, object.dropFrames.high >>> 0).toNumber();
555
+ if (object.keepFrames != null)
556
+ if ($util.Long)
557
+ (message.keepFrames = $util.Long.fromValue(object.keepFrames)).unsigned = false;
558
+ else if (typeof object.keepFrames === "string")
559
+ message.keepFrames = parseInt(object.keepFrames, 10);
560
+ else if (typeof object.keepFrames === "number")
561
+ message.keepFrames = object.keepFrames;
562
+ else if (typeof object.keepFrames === "object")
563
+ message.keepFrames = new $util.LongBits(object.keepFrames.low >>> 0, object.keepFrames.high >>> 0).toNumber();
564
+ if (object.timeNanos != null)
565
+ if ($util.Long)
566
+ (message.timeNanos = $util.Long.fromValue(object.timeNanos)).unsigned = false;
567
+ else if (typeof object.timeNanos === "string")
568
+ message.timeNanos = parseInt(object.timeNanos, 10);
569
+ else if (typeof object.timeNanos === "number")
570
+ message.timeNanos = object.timeNanos;
571
+ else if (typeof object.timeNanos === "object")
572
+ message.timeNanos = new $util.LongBits(object.timeNanos.low >>> 0, object.timeNanos.high >>> 0).toNumber();
573
+ if (object.durationNanos != null)
574
+ if ($util.Long)
575
+ (message.durationNanos = $util.Long.fromValue(object.durationNanos)).unsigned = false;
576
+ else if (typeof object.durationNanos === "string")
577
+ message.durationNanos = parseInt(object.durationNanos, 10);
578
+ else if (typeof object.durationNanos === "number")
579
+ message.durationNanos = object.durationNanos;
580
+ else if (typeof object.durationNanos === "object")
581
+ message.durationNanos = new $util.LongBits(object.durationNanos.low >>> 0, object.durationNanos.high >>> 0).toNumber();
582
+ if (object.periodType != null) {
583
+ if (typeof object.periodType !== "object")
584
+ throw TypeError(".perftools.profiles.Profile.periodType: object expected");
585
+ message.periodType = $root.perftools.profiles.ValueType.fromObject(object.periodType);
586
+ }
587
+ if (object.period != null)
588
+ if ($util.Long)
589
+ (message.period = $util.Long.fromValue(object.period)).unsigned = false;
590
+ else if (typeof object.period === "string")
591
+ message.period = parseInt(object.period, 10);
592
+ else if (typeof object.period === "number")
593
+ message.period = object.period;
594
+ else if (typeof object.period === "object")
595
+ message.period = new $util.LongBits(object.period.low >>> 0, object.period.high >>> 0).toNumber();
596
+ if (object.comment) {
597
+ if (!Array.isArray(object.comment))
598
+ throw TypeError(".perftools.profiles.Profile.comment: array expected");
599
+ message.comment = [];
600
+ for (var i = 0; i < object.comment.length; ++i)
601
+ if ($util.Long)
602
+ (message.comment[i] = $util.Long.fromValue(object.comment[i])).unsigned = false;
603
+ else if (typeof object.comment[i] === "string")
604
+ message.comment[i] = parseInt(object.comment[i], 10);
605
+ else if (typeof object.comment[i] === "number")
606
+ message.comment[i] = object.comment[i];
607
+ else if (typeof object.comment[i] === "object")
608
+ message.comment[i] = new $util.LongBits(object.comment[i].low >>> 0, object.comment[i].high >>> 0).toNumber();
609
+ }
610
+ if (object.defaultSampleType != null)
611
+ if ($util.Long)
612
+ (message.defaultSampleType = $util.Long.fromValue(object.defaultSampleType)).unsigned = false;
613
+ else if (typeof object.defaultSampleType === "string")
614
+ message.defaultSampleType = parseInt(object.defaultSampleType, 10);
615
+ else if (typeof object.defaultSampleType === "number")
616
+ message.defaultSampleType = object.defaultSampleType;
617
+ else if (typeof object.defaultSampleType === "object")
618
+ message.defaultSampleType = new $util.LongBits(object.defaultSampleType.low >>> 0, object.defaultSampleType.high >>> 0).toNumber();
619
+ return message;
620
+ };
621
+
622
+ /**
623
+ * Creates a plain object from a Profile message. Also converts values to other types if specified.
624
+ * @function toObject
625
+ * @memberof perftools.profiles.Profile
626
+ * @static
627
+ * @param {perftools.profiles.Profile} message Profile
628
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
629
+ * @returns {Object.<string,*>} Plain object
630
+ */
631
+ Profile.toObject = function toObject(message, options) {
632
+ if (!options)
633
+ options = {};
634
+ var object = {};
635
+ if (options.arrays || options.defaults) {
636
+ object.sampleType = [];
637
+ object.sample = [];
638
+ object.mapping = [];
639
+ object.location = [];
640
+ object["function"] = [];
641
+ object.stringTable = [];
642
+ object.comment = [];
643
+ }
644
+ if (options.defaults) {
645
+ if ($util.Long) {
646
+ var long = new $util.Long(0, 0, false);
647
+ object.dropFrames = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
648
+ } else
649
+ object.dropFrames = options.longs === String ? "0" : 0;
650
+ if ($util.Long) {
651
+ var long = new $util.Long(0, 0, false);
652
+ object.keepFrames = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
653
+ } else
654
+ object.keepFrames = options.longs === String ? "0" : 0;
655
+ if ($util.Long) {
656
+ var long = new $util.Long(0, 0, false);
657
+ object.timeNanos = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
658
+ } else
659
+ object.timeNanos = options.longs === String ? "0" : 0;
660
+ if ($util.Long) {
661
+ var long = new $util.Long(0, 0, false);
662
+ object.durationNanos = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
663
+ } else
664
+ object.durationNanos = options.longs === String ? "0" : 0;
665
+ object.periodType = null;
666
+ if ($util.Long) {
667
+ var long = new $util.Long(0, 0, false);
668
+ object.period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
669
+ } else
670
+ object.period = options.longs === String ? "0" : 0;
671
+ if ($util.Long) {
672
+ var long = new $util.Long(0, 0, false);
673
+ object.defaultSampleType = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
674
+ } else
675
+ object.defaultSampleType = options.longs === String ? "0" : 0;
676
+ }
677
+ if (message.sampleType && message.sampleType.length) {
678
+ object.sampleType = [];
679
+ for (var j = 0; j < message.sampleType.length; ++j)
680
+ object.sampleType[j] = $root.perftools.profiles.ValueType.toObject(message.sampleType[j], options);
681
+ }
682
+ if (message.sample && message.sample.length) {
683
+ object.sample = [];
684
+ for (var j = 0; j < message.sample.length; ++j)
685
+ object.sample[j] = $root.perftools.profiles.Sample.toObject(message.sample[j], options);
686
+ }
687
+ if (message.mapping && message.mapping.length) {
688
+ object.mapping = [];
689
+ for (var j = 0; j < message.mapping.length; ++j)
690
+ object.mapping[j] = $root.perftools.profiles.Mapping.toObject(message.mapping[j], options);
691
+ }
692
+ if (message.location && message.location.length) {
693
+ object.location = [];
694
+ for (var j = 0; j < message.location.length; ++j)
695
+ object.location[j] = $root.perftools.profiles.Location.toObject(message.location[j], options);
696
+ }
697
+ if (message["function"] && message["function"].length) {
698
+ object["function"] = [];
699
+ for (var j = 0; j < message["function"].length; ++j)
700
+ object["function"][j] = $root.perftools.profiles.Function.toObject(message["function"][j], options);
701
+ }
702
+ if (message.stringTable && message.stringTable.length) {
703
+ object.stringTable = [];
704
+ for (var j = 0; j < message.stringTable.length; ++j)
705
+ object.stringTable[j] = message.stringTable[j];
706
+ }
707
+ if (message.dropFrames != null && message.hasOwnProperty("dropFrames"))
708
+ if (typeof message.dropFrames === "number")
709
+ object.dropFrames = options.longs === String ? String(message.dropFrames) : message.dropFrames;
710
+ else
711
+ object.dropFrames = options.longs === String ? $util.Long.prototype.toString.call(message.dropFrames) : options.longs === Number ? new $util.LongBits(message.dropFrames.low >>> 0, message.dropFrames.high >>> 0).toNumber() : message.dropFrames;
712
+ if (message.keepFrames != null && message.hasOwnProperty("keepFrames"))
713
+ if (typeof message.keepFrames === "number")
714
+ object.keepFrames = options.longs === String ? String(message.keepFrames) : message.keepFrames;
715
+ else
716
+ object.keepFrames = options.longs === String ? $util.Long.prototype.toString.call(message.keepFrames) : options.longs === Number ? new $util.LongBits(message.keepFrames.low >>> 0, message.keepFrames.high >>> 0).toNumber() : message.keepFrames;
717
+ if (message.timeNanos != null && message.hasOwnProperty("timeNanos"))
718
+ if (typeof message.timeNanos === "number")
719
+ object.timeNanos = options.longs === String ? String(message.timeNanos) : message.timeNanos;
720
+ else
721
+ object.timeNanos = options.longs === String ? $util.Long.prototype.toString.call(message.timeNanos) : options.longs === Number ? new $util.LongBits(message.timeNanos.low >>> 0, message.timeNanos.high >>> 0).toNumber() : message.timeNanos;
722
+ if (message.durationNanos != null && message.hasOwnProperty("durationNanos"))
723
+ if (typeof message.durationNanos === "number")
724
+ object.durationNanos = options.longs === String ? String(message.durationNanos) : message.durationNanos;
725
+ else
726
+ object.durationNanos = options.longs === String ? $util.Long.prototype.toString.call(message.durationNanos) : options.longs === Number ? new $util.LongBits(message.durationNanos.low >>> 0, message.durationNanos.high >>> 0).toNumber() : message.durationNanos;
727
+ if (message.periodType != null && message.hasOwnProperty("periodType"))
728
+ object.periodType = $root.perftools.profiles.ValueType.toObject(message.periodType, options);
729
+ if (message.period != null && message.hasOwnProperty("period"))
730
+ if (typeof message.period === "number")
731
+ object.period = options.longs === String ? String(message.period) : message.period;
732
+ else
733
+ object.period = options.longs === String ? $util.Long.prototype.toString.call(message.period) : options.longs === Number ? new $util.LongBits(message.period.low >>> 0, message.period.high >>> 0).toNumber() : message.period;
734
+ if (message.comment && message.comment.length) {
735
+ object.comment = [];
736
+ for (var j = 0; j < message.comment.length; ++j)
737
+ if (typeof message.comment[j] === "number")
738
+ object.comment[j] = options.longs === String ? String(message.comment[j]) : message.comment[j];
739
+ else
740
+ object.comment[j] = options.longs === String ? $util.Long.prototype.toString.call(message.comment[j]) : options.longs === Number ? new $util.LongBits(message.comment[j].low >>> 0, message.comment[j].high >>> 0).toNumber() : message.comment[j];
741
+ }
742
+ if (message.defaultSampleType != null && message.hasOwnProperty("defaultSampleType"))
743
+ if (typeof message.defaultSampleType === "number")
744
+ object.defaultSampleType = options.longs === String ? String(message.defaultSampleType) : message.defaultSampleType;
745
+ else
746
+ object.defaultSampleType = options.longs === String ? $util.Long.prototype.toString.call(message.defaultSampleType) : options.longs === Number ? new $util.LongBits(message.defaultSampleType.low >>> 0, message.defaultSampleType.high >>> 0).toNumber() : message.defaultSampleType;
747
+ return object;
748
+ };
749
+
750
+ /**
751
+ * Converts this Profile to JSON.
752
+ * @function toJSON
753
+ * @memberof perftools.profiles.Profile
754
+ * @instance
755
+ * @returns {Object.<string,*>} JSON object
756
+ */
757
+ Profile.prototype.toJSON = function toJSON() {
758
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
759
+ };
760
+
761
+ /**
762
+ * Gets the default type url for Profile
763
+ * @function getTypeUrl
764
+ * @memberof perftools.profiles.Profile
765
+ * @static
766
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
767
+ * @returns {string} The default type url
768
+ */
769
+ Profile.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
770
+ if (typeUrlPrefix === undefined) {
771
+ typeUrlPrefix = "type.googleapis.com";
772
+ }
773
+ return typeUrlPrefix + "/perftools.profiles.Profile";
774
+ };
775
+
776
+ return Profile;
777
+ })();
778
+
779
+ profiles.ValueType = (function() {
780
+
781
+ /**
782
+ * Properties of a ValueType.
783
+ * @memberof perftools.profiles
784
+ * @interface IValueType
785
+ * @property {number|Long|null} [type] ValueType type
786
+ * @property {number|Long|null} [unit] ValueType unit
787
+ */
788
+
789
+ /**
790
+ * Constructs a new ValueType.
791
+ * @memberof perftools.profiles
792
+ * @classdesc Represents a ValueType.
793
+ * @implements IValueType
794
+ * @constructor
795
+ * @param {perftools.profiles.IValueType=} [properties] Properties to set
796
+ */
797
+ function ValueType(properties) {
798
+ if (properties)
799
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
800
+ if (properties[keys[i]] != null)
801
+ this[keys[i]] = properties[keys[i]];
802
+ }
803
+
804
+ /**
805
+ * ValueType type.
806
+ * @member {number|Long} type
807
+ * @memberof perftools.profiles.ValueType
808
+ * @instance
809
+ */
810
+ ValueType.prototype.type = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
811
+
812
+ /**
813
+ * ValueType unit.
814
+ * @member {number|Long} unit
815
+ * @memberof perftools.profiles.ValueType
816
+ * @instance
817
+ */
818
+ ValueType.prototype.unit = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
819
+
820
+ /**
821
+ * Creates a new ValueType instance using the specified properties.
822
+ * @function create
823
+ * @memberof perftools.profiles.ValueType
824
+ * @static
825
+ * @param {perftools.profiles.IValueType=} [properties] Properties to set
826
+ * @returns {perftools.profiles.ValueType} ValueType instance
827
+ */
828
+ ValueType.create = function create(properties) {
829
+ return new ValueType(properties);
830
+ };
831
+
832
+ /**
833
+ * Encodes the specified ValueType message. Does not implicitly {@link perftools.profiles.ValueType.verify|verify} messages.
834
+ * @function encode
835
+ * @memberof perftools.profiles.ValueType
836
+ * @static
837
+ * @param {perftools.profiles.IValueType} message ValueType message or plain object to encode
838
+ * @param {$protobuf.Writer} [writer] Writer to encode to
839
+ * @returns {$protobuf.Writer} Writer
840
+ */
841
+ ValueType.encode = function encode(message, writer) {
842
+ if (!writer)
843
+ writer = $Writer.create();
844
+ if (message.type != null && Object.hasOwnProperty.call(message, "type"))
845
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.type);
846
+ if (message.unit != null && Object.hasOwnProperty.call(message, "unit"))
847
+ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.unit);
848
+ return writer;
849
+ };
850
+
851
+ /**
852
+ * Encodes the specified ValueType message, length delimited. Does not implicitly {@link perftools.profiles.ValueType.verify|verify} messages.
853
+ * @function encodeDelimited
854
+ * @memberof perftools.profiles.ValueType
855
+ * @static
856
+ * @param {perftools.profiles.IValueType} message ValueType message or plain object to encode
857
+ * @param {$protobuf.Writer} [writer] Writer to encode to
858
+ * @returns {$protobuf.Writer} Writer
859
+ */
860
+ ValueType.encodeDelimited = function encodeDelimited(message, writer) {
861
+ return this.encode(message, writer).ldelim();
862
+ };
863
+
864
+ /**
865
+ * Decodes a ValueType message from the specified reader or buffer.
866
+ * @function decode
867
+ * @memberof perftools.profiles.ValueType
868
+ * @static
869
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
870
+ * @param {number} [length] Message length if known beforehand
871
+ * @returns {perftools.profiles.ValueType} ValueType
872
+ * @throws {Error} If the payload is not a reader or valid buffer
873
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
874
+ */
875
+ ValueType.decode = function decode(reader, length) {
876
+ if (!(reader instanceof $Reader))
877
+ reader = $Reader.create(reader);
878
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.perftools.profiles.ValueType();
879
+ while (reader.pos < end) {
880
+ var tag = reader.uint32();
881
+ switch (tag >>> 3) {
882
+ case 1: {
883
+ message.type = reader.int64();
884
+ break;
885
+ }
886
+ case 2: {
887
+ message.unit = reader.int64();
888
+ break;
889
+ }
890
+ default:
891
+ reader.skipType(tag & 7);
892
+ break;
893
+ }
894
+ }
895
+ return message;
896
+ };
897
+
898
+ /**
899
+ * Decodes a ValueType message from the specified reader or buffer, length delimited.
900
+ * @function decodeDelimited
901
+ * @memberof perftools.profiles.ValueType
902
+ * @static
903
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
904
+ * @returns {perftools.profiles.ValueType} ValueType
905
+ * @throws {Error} If the payload is not a reader or valid buffer
906
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
907
+ */
908
+ ValueType.decodeDelimited = function decodeDelimited(reader) {
909
+ if (!(reader instanceof $Reader))
910
+ reader = new $Reader(reader);
911
+ return this.decode(reader, reader.uint32());
912
+ };
913
+
914
+ /**
915
+ * Verifies a ValueType message.
916
+ * @function verify
917
+ * @memberof perftools.profiles.ValueType
918
+ * @static
919
+ * @param {Object.<string,*>} message Plain object to verify
920
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
921
+ */
922
+ ValueType.verify = function verify(message) {
923
+ if (typeof message !== "object" || message === null)
924
+ return "object expected";
925
+ if (message.type != null && message.hasOwnProperty("type"))
926
+ if (!$util.isInteger(message.type) && !(message.type && $util.isInteger(message.type.low) && $util.isInteger(message.type.high)))
927
+ return "type: integer|Long expected";
928
+ if (message.unit != null && message.hasOwnProperty("unit"))
929
+ if (!$util.isInteger(message.unit) && !(message.unit && $util.isInteger(message.unit.low) && $util.isInteger(message.unit.high)))
930
+ return "unit: integer|Long expected";
931
+ return null;
932
+ };
933
+
934
+ /**
935
+ * Creates a ValueType message from a plain object. Also converts values to their respective internal types.
936
+ * @function fromObject
937
+ * @memberof perftools.profiles.ValueType
938
+ * @static
939
+ * @param {Object.<string,*>} object Plain object
940
+ * @returns {perftools.profiles.ValueType} ValueType
941
+ */
942
+ ValueType.fromObject = function fromObject(object) {
943
+ if (object instanceof $root.perftools.profiles.ValueType)
944
+ return object;
945
+ var message = new $root.perftools.profiles.ValueType();
946
+ if (object.type != null)
947
+ if ($util.Long)
948
+ (message.type = $util.Long.fromValue(object.type)).unsigned = false;
949
+ else if (typeof object.type === "string")
950
+ message.type = parseInt(object.type, 10);
951
+ else if (typeof object.type === "number")
952
+ message.type = object.type;
953
+ else if (typeof object.type === "object")
954
+ message.type = new $util.LongBits(object.type.low >>> 0, object.type.high >>> 0).toNumber();
955
+ if (object.unit != null)
956
+ if ($util.Long)
957
+ (message.unit = $util.Long.fromValue(object.unit)).unsigned = false;
958
+ else if (typeof object.unit === "string")
959
+ message.unit = parseInt(object.unit, 10);
960
+ else if (typeof object.unit === "number")
961
+ message.unit = object.unit;
962
+ else if (typeof object.unit === "object")
963
+ message.unit = new $util.LongBits(object.unit.low >>> 0, object.unit.high >>> 0).toNumber();
964
+ return message;
965
+ };
966
+
967
+ /**
968
+ * Creates a plain object from a ValueType message. Also converts values to other types if specified.
969
+ * @function toObject
970
+ * @memberof perftools.profiles.ValueType
971
+ * @static
972
+ * @param {perftools.profiles.ValueType} message ValueType
973
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
974
+ * @returns {Object.<string,*>} Plain object
975
+ */
976
+ ValueType.toObject = function toObject(message, options) {
977
+ if (!options)
978
+ options = {};
979
+ var object = {};
980
+ if (options.defaults) {
981
+ if ($util.Long) {
982
+ var long = new $util.Long(0, 0, false);
983
+ object.type = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
984
+ } else
985
+ object.type = options.longs === String ? "0" : 0;
986
+ if ($util.Long) {
987
+ var long = new $util.Long(0, 0, false);
988
+ object.unit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
989
+ } else
990
+ object.unit = options.longs === String ? "0" : 0;
991
+ }
992
+ if (message.type != null && message.hasOwnProperty("type"))
993
+ if (typeof message.type === "number")
994
+ object.type = options.longs === String ? String(message.type) : message.type;
995
+ else
996
+ object.type = options.longs === String ? $util.Long.prototype.toString.call(message.type) : options.longs === Number ? new $util.LongBits(message.type.low >>> 0, message.type.high >>> 0).toNumber() : message.type;
997
+ if (message.unit != null && message.hasOwnProperty("unit"))
998
+ if (typeof message.unit === "number")
999
+ object.unit = options.longs === String ? String(message.unit) : message.unit;
1000
+ else
1001
+ object.unit = options.longs === String ? $util.Long.prototype.toString.call(message.unit) : options.longs === Number ? new $util.LongBits(message.unit.low >>> 0, message.unit.high >>> 0).toNumber() : message.unit;
1002
+ return object;
1003
+ };
1004
+
1005
+ /**
1006
+ * Converts this ValueType to JSON.
1007
+ * @function toJSON
1008
+ * @memberof perftools.profiles.ValueType
1009
+ * @instance
1010
+ * @returns {Object.<string,*>} JSON object
1011
+ */
1012
+ ValueType.prototype.toJSON = function toJSON() {
1013
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1014
+ };
1015
+
1016
+ /**
1017
+ * Gets the default type url for ValueType
1018
+ * @function getTypeUrl
1019
+ * @memberof perftools.profiles.ValueType
1020
+ * @static
1021
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1022
+ * @returns {string} The default type url
1023
+ */
1024
+ ValueType.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1025
+ if (typeUrlPrefix === undefined) {
1026
+ typeUrlPrefix = "type.googleapis.com";
1027
+ }
1028
+ return typeUrlPrefix + "/perftools.profiles.ValueType";
1029
+ };
1030
+
1031
+ return ValueType;
1032
+ })();
1033
+
1034
+ profiles.Sample = (function() {
1035
+
1036
+ /**
1037
+ * Properties of a Sample.
1038
+ * @memberof perftools.profiles
1039
+ * @interface ISample
1040
+ * @property {Array.<number|Long>|null} [locationId] Sample locationId
1041
+ * @property {Array.<number|Long>|null} [value] Sample value
1042
+ * @property {Array.<perftools.profiles.ILabel>|null} [label] Sample label
1043
+ */
1044
+
1045
+ /**
1046
+ * Constructs a new Sample.
1047
+ * @memberof perftools.profiles
1048
+ * @classdesc Represents a Sample.
1049
+ * @implements ISample
1050
+ * @constructor
1051
+ * @param {perftools.profiles.ISample=} [properties] Properties to set
1052
+ */
1053
+ function Sample(properties) {
1054
+ this.locationId = [];
1055
+ this.value = [];
1056
+ this.label = [];
1057
+ if (properties)
1058
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1059
+ if (properties[keys[i]] != null)
1060
+ this[keys[i]] = properties[keys[i]];
1061
+ }
1062
+
1063
+ /**
1064
+ * Sample locationId.
1065
+ * @member {Array.<number|Long>} locationId
1066
+ * @memberof perftools.profiles.Sample
1067
+ * @instance
1068
+ */
1069
+ Sample.prototype.locationId = $util.emptyArray;
1070
+
1071
+ /**
1072
+ * Sample value.
1073
+ * @member {Array.<number|Long>} value
1074
+ * @memberof perftools.profiles.Sample
1075
+ * @instance
1076
+ */
1077
+ Sample.prototype.value = $util.emptyArray;
1078
+
1079
+ /**
1080
+ * Sample label.
1081
+ * @member {Array.<perftools.profiles.ILabel>} label
1082
+ * @memberof perftools.profiles.Sample
1083
+ * @instance
1084
+ */
1085
+ Sample.prototype.label = $util.emptyArray;
1086
+
1087
+ /**
1088
+ * Creates a new Sample instance using the specified properties.
1089
+ * @function create
1090
+ * @memberof perftools.profiles.Sample
1091
+ * @static
1092
+ * @param {perftools.profiles.ISample=} [properties] Properties to set
1093
+ * @returns {perftools.profiles.Sample} Sample instance
1094
+ */
1095
+ Sample.create = function create(properties) {
1096
+ return new Sample(properties);
1097
+ };
1098
+
1099
+ /**
1100
+ * Encodes the specified Sample message. Does not implicitly {@link perftools.profiles.Sample.verify|verify} messages.
1101
+ * @function encode
1102
+ * @memberof perftools.profiles.Sample
1103
+ * @static
1104
+ * @param {perftools.profiles.ISample} message Sample message or plain object to encode
1105
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1106
+ * @returns {$protobuf.Writer} Writer
1107
+ */
1108
+ Sample.encode = function encode(message, writer) {
1109
+ if (!writer)
1110
+ writer = $Writer.create();
1111
+ if (message.locationId != null && message.locationId.length) {
1112
+ writer.uint32(/* id 1, wireType 2 =*/10).fork();
1113
+ for (var i = 0; i < message.locationId.length; ++i)
1114
+ writer.uint64(message.locationId[i]);
1115
+ writer.ldelim();
1116
+ }
1117
+ if (message.value != null && message.value.length) {
1118
+ writer.uint32(/* id 2, wireType 2 =*/18).fork();
1119
+ for (var i = 0; i < message.value.length; ++i)
1120
+ writer.int64(message.value[i]);
1121
+ writer.ldelim();
1122
+ }
1123
+ if (message.label != null && message.label.length)
1124
+ for (var i = 0; i < message.label.length; ++i)
1125
+ $root.perftools.profiles.Label.encode(message.label[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
1126
+ return writer;
1127
+ };
1128
+
1129
+ /**
1130
+ * Encodes the specified Sample message, length delimited. Does not implicitly {@link perftools.profiles.Sample.verify|verify} messages.
1131
+ * @function encodeDelimited
1132
+ * @memberof perftools.profiles.Sample
1133
+ * @static
1134
+ * @param {perftools.profiles.ISample} message Sample message or plain object to encode
1135
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1136
+ * @returns {$protobuf.Writer} Writer
1137
+ */
1138
+ Sample.encodeDelimited = function encodeDelimited(message, writer) {
1139
+ return this.encode(message, writer).ldelim();
1140
+ };
1141
+
1142
+ /**
1143
+ * Decodes a Sample message from the specified reader or buffer.
1144
+ * @function decode
1145
+ * @memberof perftools.profiles.Sample
1146
+ * @static
1147
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1148
+ * @param {number} [length] Message length if known beforehand
1149
+ * @returns {perftools.profiles.Sample} Sample
1150
+ * @throws {Error} If the payload is not a reader or valid buffer
1151
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1152
+ */
1153
+ Sample.decode = function decode(reader, length) {
1154
+ if (!(reader instanceof $Reader))
1155
+ reader = $Reader.create(reader);
1156
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.perftools.profiles.Sample();
1157
+ while (reader.pos < end) {
1158
+ var tag = reader.uint32();
1159
+ switch (tag >>> 3) {
1160
+ case 1: {
1161
+ if (!(message.locationId && message.locationId.length))
1162
+ message.locationId = [];
1163
+ if ((tag & 7) === 2) {
1164
+ var end2 = reader.uint32() + reader.pos;
1165
+ while (reader.pos < end2)
1166
+ message.locationId.push(reader.uint64());
1167
+ } else
1168
+ message.locationId.push(reader.uint64());
1169
+ break;
1170
+ }
1171
+ case 2: {
1172
+ if (!(message.value && message.value.length))
1173
+ message.value = [];
1174
+ if ((tag & 7) === 2) {
1175
+ var end2 = reader.uint32() + reader.pos;
1176
+ while (reader.pos < end2)
1177
+ message.value.push(reader.int64());
1178
+ } else
1179
+ message.value.push(reader.int64());
1180
+ break;
1181
+ }
1182
+ case 3: {
1183
+ if (!(message.label && message.label.length))
1184
+ message.label = [];
1185
+ message.label.push($root.perftools.profiles.Label.decode(reader, reader.uint32()));
1186
+ break;
1187
+ }
1188
+ default:
1189
+ reader.skipType(tag & 7);
1190
+ break;
1191
+ }
1192
+ }
1193
+ return message;
1194
+ };
1195
+
1196
+ /**
1197
+ * Decodes a Sample message from the specified reader or buffer, length delimited.
1198
+ * @function decodeDelimited
1199
+ * @memberof perftools.profiles.Sample
1200
+ * @static
1201
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1202
+ * @returns {perftools.profiles.Sample} Sample
1203
+ * @throws {Error} If the payload is not a reader or valid buffer
1204
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1205
+ */
1206
+ Sample.decodeDelimited = function decodeDelimited(reader) {
1207
+ if (!(reader instanceof $Reader))
1208
+ reader = new $Reader(reader);
1209
+ return this.decode(reader, reader.uint32());
1210
+ };
1211
+
1212
+ /**
1213
+ * Verifies a Sample message.
1214
+ * @function verify
1215
+ * @memberof perftools.profiles.Sample
1216
+ * @static
1217
+ * @param {Object.<string,*>} message Plain object to verify
1218
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1219
+ */
1220
+ Sample.verify = function verify(message) {
1221
+ if (typeof message !== "object" || message === null)
1222
+ return "object expected";
1223
+ if (message.locationId != null && message.hasOwnProperty("locationId")) {
1224
+ if (!Array.isArray(message.locationId))
1225
+ return "locationId: array expected";
1226
+ for (var i = 0; i < message.locationId.length; ++i)
1227
+ if (!$util.isInteger(message.locationId[i]) && !(message.locationId[i] && $util.isInteger(message.locationId[i].low) && $util.isInteger(message.locationId[i].high)))
1228
+ return "locationId: integer|Long[] expected";
1229
+ }
1230
+ if (message.value != null && message.hasOwnProperty("value")) {
1231
+ if (!Array.isArray(message.value))
1232
+ return "value: array expected";
1233
+ for (var i = 0; i < message.value.length; ++i)
1234
+ if (!$util.isInteger(message.value[i]) && !(message.value[i] && $util.isInteger(message.value[i].low) && $util.isInteger(message.value[i].high)))
1235
+ return "value: integer|Long[] expected";
1236
+ }
1237
+ if (message.label != null && message.hasOwnProperty("label")) {
1238
+ if (!Array.isArray(message.label))
1239
+ return "label: array expected";
1240
+ for (var i = 0; i < message.label.length; ++i) {
1241
+ var error = $root.perftools.profiles.Label.verify(message.label[i]);
1242
+ if (error)
1243
+ return "label." + error;
1244
+ }
1245
+ }
1246
+ return null;
1247
+ };
1248
+
1249
+ /**
1250
+ * Creates a Sample message from a plain object. Also converts values to their respective internal types.
1251
+ * @function fromObject
1252
+ * @memberof perftools.profiles.Sample
1253
+ * @static
1254
+ * @param {Object.<string,*>} object Plain object
1255
+ * @returns {perftools.profiles.Sample} Sample
1256
+ */
1257
+ Sample.fromObject = function fromObject(object) {
1258
+ if (object instanceof $root.perftools.profiles.Sample)
1259
+ return object;
1260
+ var message = new $root.perftools.profiles.Sample();
1261
+ if (object.locationId) {
1262
+ if (!Array.isArray(object.locationId))
1263
+ throw TypeError(".perftools.profiles.Sample.locationId: array expected");
1264
+ message.locationId = [];
1265
+ for (var i = 0; i < object.locationId.length; ++i)
1266
+ if ($util.Long)
1267
+ (message.locationId[i] = $util.Long.fromValue(object.locationId[i])).unsigned = true;
1268
+ else if (typeof object.locationId[i] === "string")
1269
+ message.locationId[i] = parseInt(object.locationId[i], 10);
1270
+ else if (typeof object.locationId[i] === "number")
1271
+ message.locationId[i] = object.locationId[i];
1272
+ else if (typeof object.locationId[i] === "object")
1273
+ message.locationId[i] = new $util.LongBits(object.locationId[i].low >>> 0, object.locationId[i].high >>> 0).toNumber(true);
1274
+ }
1275
+ if (object.value) {
1276
+ if (!Array.isArray(object.value))
1277
+ throw TypeError(".perftools.profiles.Sample.value: array expected");
1278
+ message.value = [];
1279
+ for (var i = 0; i < object.value.length; ++i)
1280
+ if ($util.Long)
1281
+ (message.value[i] = $util.Long.fromValue(object.value[i])).unsigned = false;
1282
+ else if (typeof object.value[i] === "string")
1283
+ message.value[i] = parseInt(object.value[i], 10);
1284
+ else if (typeof object.value[i] === "number")
1285
+ message.value[i] = object.value[i];
1286
+ else if (typeof object.value[i] === "object")
1287
+ message.value[i] = new $util.LongBits(object.value[i].low >>> 0, object.value[i].high >>> 0).toNumber();
1288
+ }
1289
+ if (object.label) {
1290
+ if (!Array.isArray(object.label))
1291
+ throw TypeError(".perftools.profiles.Sample.label: array expected");
1292
+ message.label = [];
1293
+ for (var i = 0; i < object.label.length; ++i) {
1294
+ if (typeof object.label[i] !== "object")
1295
+ throw TypeError(".perftools.profiles.Sample.label: object expected");
1296
+ message.label[i] = $root.perftools.profiles.Label.fromObject(object.label[i]);
1297
+ }
1298
+ }
1299
+ return message;
1300
+ };
1301
+
1302
+ /**
1303
+ * Creates a plain object from a Sample message. Also converts values to other types if specified.
1304
+ * @function toObject
1305
+ * @memberof perftools.profiles.Sample
1306
+ * @static
1307
+ * @param {perftools.profiles.Sample} message Sample
1308
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1309
+ * @returns {Object.<string,*>} Plain object
1310
+ */
1311
+ Sample.toObject = function toObject(message, options) {
1312
+ if (!options)
1313
+ options = {};
1314
+ var object = {};
1315
+ if (options.arrays || options.defaults) {
1316
+ object.locationId = [];
1317
+ object.value = [];
1318
+ object.label = [];
1319
+ }
1320
+ if (message.locationId && message.locationId.length) {
1321
+ object.locationId = [];
1322
+ for (var j = 0; j < message.locationId.length; ++j)
1323
+ if (typeof message.locationId[j] === "number")
1324
+ object.locationId[j] = options.longs === String ? String(message.locationId[j]) : message.locationId[j];
1325
+ else
1326
+ object.locationId[j] = options.longs === String ? $util.Long.prototype.toString.call(message.locationId[j]) : options.longs === Number ? new $util.LongBits(message.locationId[j].low >>> 0, message.locationId[j].high >>> 0).toNumber(true) : message.locationId[j];
1327
+ }
1328
+ if (message.value && message.value.length) {
1329
+ object.value = [];
1330
+ for (var j = 0; j < message.value.length; ++j)
1331
+ if (typeof message.value[j] === "number")
1332
+ object.value[j] = options.longs === String ? String(message.value[j]) : message.value[j];
1333
+ else
1334
+ object.value[j] = options.longs === String ? $util.Long.prototype.toString.call(message.value[j]) : options.longs === Number ? new $util.LongBits(message.value[j].low >>> 0, message.value[j].high >>> 0).toNumber() : message.value[j];
1335
+ }
1336
+ if (message.label && message.label.length) {
1337
+ object.label = [];
1338
+ for (var j = 0; j < message.label.length; ++j)
1339
+ object.label[j] = $root.perftools.profiles.Label.toObject(message.label[j], options);
1340
+ }
1341
+ return object;
1342
+ };
1343
+
1344
+ /**
1345
+ * Converts this Sample to JSON.
1346
+ * @function toJSON
1347
+ * @memberof perftools.profiles.Sample
1348
+ * @instance
1349
+ * @returns {Object.<string,*>} JSON object
1350
+ */
1351
+ Sample.prototype.toJSON = function toJSON() {
1352
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1353
+ };
1354
+
1355
+ /**
1356
+ * Gets the default type url for Sample
1357
+ * @function getTypeUrl
1358
+ * @memberof perftools.profiles.Sample
1359
+ * @static
1360
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1361
+ * @returns {string} The default type url
1362
+ */
1363
+ Sample.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1364
+ if (typeUrlPrefix === undefined) {
1365
+ typeUrlPrefix = "type.googleapis.com";
1366
+ }
1367
+ return typeUrlPrefix + "/perftools.profiles.Sample";
1368
+ };
1369
+
1370
+ return Sample;
1371
+ })();
1372
+
1373
+ profiles.Label = (function() {
1374
+
1375
+ /**
1376
+ * Properties of a Label.
1377
+ * @memberof perftools.profiles
1378
+ * @interface ILabel
1379
+ * @property {number|Long|null} [key] Label key
1380
+ * @property {number|Long|null} [str] Label str
1381
+ * @property {number|Long|null} [num] Label num
1382
+ * @property {number|Long|null} [numUnit] Label numUnit
1383
+ */
1384
+
1385
+ /**
1386
+ * Constructs a new Label.
1387
+ * @memberof perftools.profiles
1388
+ * @classdesc Represents a Label.
1389
+ * @implements ILabel
1390
+ * @constructor
1391
+ * @param {perftools.profiles.ILabel=} [properties] Properties to set
1392
+ */
1393
+ function Label(properties) {
1394
+ if (properties)
1395
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1396
+ if (properties[keys[i]] != null)
1397
+ this[keys[i]] = properties[keys[i]];
1398
+ }
1399
+
1400
+ /**
1401
+ * Label key.
1402
+ * @member {number|Long} key
1403
+ * @memberof perftools.profiles.Label
1404
+ * @instance
1405
+ */
1406
+ Label.prototype.key = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
1407
+
1408
+ /**
1409
+ * Label str.
1410
+ * @member {number|Long} str
1411
+ * @memberof perftools.profiles.Label
1412
+ * @instance
1413
+ */
1414
+ Label.prototype.str = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
1415
+
1416
+ /**
1417
+ * Label num.
1418
+ * @member {number|Long} num
1419
+ * @memberof perftools.profiles.Label
1420
+ * @instance
1421
+ */
1422
+ Label.prototype.num = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
1423
+
1424
+ /**
1425
+ * Label numUnit.
1426
+ * @member {number|Long} numUnit
1427
+ * @memberof perftools.profiles.Label
1428
+ * @instance
1429
+ */
1430
+ Label.prototype.numUnit = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
1431
+
1432
+ /**
1433
+ * Creates a new Label instance using the specified properties.
1434
+ * @function create
1435
+ * @memberof perftools.profiles.Label
1436
+ * @static
1437
+ * @param {perftools.profiles.ILabel=} [properties] Properties to set
1438
+ * @returns {perftools.profiles.Label} Label instance
1439
+ */
1440
+ Label.create = function create(properties) {
1441
+ return new Label(properties);
1442
+ };
1443
+
1444
+ /**
1445
+ * Encodes the specified Label message. Does not implicitly {@link perftools.profiles.Label.verify|verify} messages.
1446
+ * @function encode
1447
+ * @memberof perftools.profiles.Label
1448
+ * @static
1449
+ * @param {perftools.profiles.ILabel} message Label message or plain object to encode
1450
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1451
+ * @returns {$protobuf.Writer} Writer
1452
+ */
1453
+ Label.encode = function encode(message, writer) {
1454
+ if (!writer)
1455
+ writer = $Writer.create();
1456
+ if (message.key != null && Object.hasOwnProperty.call(message, "key"))
1457
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.key);
1458
+ if (message.str != null && Object.hasOwnProperty.call(message, "str"))
1459
+ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.str);
1460
+ if (message.num != null && Object.hasOwnProperty.call(message, "num"))
1461
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.num);
1462
+ if (message.numUnit != null && Object.hasOwnProperty.call(message, "numUnit"))
1463
+ writer.uint32(/* id 4, wireType 0 =*/32).int64(message.numUnit);
1464
+ return writer;
1465
+ };
1466
+
1467
+ /**
1468
+ * Encodes the specified Label message, length delimited. Does not implicitly {@link perftools.profiles.Label.verify|verify} messages.
1469
+ * @function encodeDelimited
1470
+ * @memberof perftools.profiles.Label
1471
+ * @static
1472
+ * @param {perftools.profiles.ILabel} message Label message or plain object to encode
1473
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1474
+ * @returns {$protobuf.Writer} Writer
1475
+ */
1476
+ Label.encodeDelimited = function encodeDelimited(message, writer) {
1477
+ return this.encode(message, writer).ldelim();
1478
+ };
1479
+
1480
+ /**
1481
+ * Decodes a Label message from the specified reader or buffer.
1482
+ * @function decode
1483
+ * @memberof perftools.profiles.Label
1484
+ * @static
1485
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1486
+ * @param {number} [length] Message length if known beforehand
1487
+ * @returns {perftools.profiles.Label} Label
1488
+ * @throws {Error} If the payload is not a reader or valid buffer
1489
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1490
+ */
1491
+ Label.decode = function decode(reader, length) {
1492
+ if (!(reader instanceof $Reader))
1493
+ reader = $Reader.create(reader);
1494
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.perftools.profiles.Label();
1495
+ while (reader.pos < end) {
1496
+ var tag = reader.uint32();
1497
+ switch (tag >>> 3) {
1498
+ case 1: {
1499
+ message.key = reader.int64();
1500
+ break;
1501
+ }
1502
+ case 2: {
1503
+ message.str = reader.int64();
1504
+ break;
1505
+ }
1506
+ case 3: {
1507
+ message.num = reader.int64();
1508
+ break;
1509
+ }
1510
+ case 4: {
1511
+ message.numUnit = reader.int64();
1512
+ break;
1513
+ }
1514
+ default:
1515
+ reader.skipType(tag & 7);
1516
+ break;
1517
+ }
1518
+ }
1519
+ return message;
1520
+ };
1521
+
1522
+ /**
1523
+ * Decodes a Label message from the specified reader or buffer, length delimited.
1524
+ * @function decodeDelimited
1525
+ * @memberof perftools.profiles.Label
1526
+ * @static
1527
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1528
+ * @returns {perftools.profiles.Label} Label
1529
+ * @throws {Error} If the payload is not a reader or valid buffer
1530
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1531
+ */
1532
+ Label.decodeDelimited = function decodeDelimited(reader) {
1533
+ if (!(reader instanceof $Reader))
1534
+ reader = new $Reader(reader);
1535
+ return this.decode(reader, reader.uint32());
1536
+ };
1537
+
1538
+ /**
1539
+ * Verifies a Label message.
1540
+ * @function verify
1541
+ * @memberof perftools.profiles.Label
1542
+ * @static
1543
+ * @param {Object.<string,*>} message Plain object to verify
1544
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1545
+ */
1546
+ Label.verify = function verify(message) {
1547
+ if (typeof message !== "object" || message === null)
1548
+ return "object expected";
1549
+ if (message.key != null && message.hasOwnProperty("key"))
1550
+ if (!$util.isInteger(message.key) && !(message.key && $util.isInteger(message.key.low) && $util.isInteger(message.key.high)))
1551
+ return "key: integer|Long expected";
1552
+ if (message.str != null && message.hasOwnProperty("str"))
1553
+ if (!$util.isInteger(message.str) && !(message.str && $util.isInteger(message.str.low) && $util.isInteger(message.str.high)))
1554
+ return "str: integer|Long expected";
1555
+ if (message.num != null && message.hasOwnProperty("num"))
1556
+ if (!$util.isInteger(message.num) && !(message.num && $util.isInteger(message.num.low) && $util.isInteger(message.num.high)))
1557
+ return "num: integer|Long expected";
1558
+ if (message.numUnit != null && message.hasOwnProperty("numUnit"))
1559
+ if (!$util.isInteger(message.numUnit) && !(message.numUnit && $util.isInteger(message.numUnit.low) && $util.isInteger(message.numUnit.high)))
1560
+ return "numUnit: integer|Long expected";
1561
+ return null;
1562
+ };
1563
+
1564
+ /**
1565
+ * Creates a Label message from a plain object. Also converts values to their respective internal types.
1566
+ * @function fromObject
1567
+ * @memberof perftools.profiles.Label
1568
+ * @static
1569
+ * @param {Object.<string,*>} object Plain object
1570
+ * @returns {perftools.profiles.Label} Label
1571
+ */
1572
+ Label.fromObject = function fromObject(object) {
1573
+ if (object instanceof $root.perftools.profiles.Label)
1574
+ return object;
1575
+ var message = new $root.perftools.profiles.Label();
1576
+ if (object.key != null)
1577
+ if ($util.Long)
1578
+ (message.key = $util.Long.fromValue(object.key)).unsigned = false;
1579
+ else if (typeof object.key === "string")
1580
+ message.key = parseInt(object.key, 10);
1581
+ else if (typeof object.key === "number")
1582
+ message.key = object.key;
1583
+ else if (typeof object.key === "object")
1584
+ message.key = new $util.LongBits(object.key.low >>> 0, object.key.high >>> 0).toNumber();
1585
+ if (object.str != null)
1586
+ if ($util.Long)
1587
+ (message.str = $util.Long.fromValue(object.str)).unsigned = false;
1588
+ else if (typeof object.str === "string")
1589
+ message.str = parseInt(object.str, 10);
1590
+ else if (typeof object.str === "number")
1591
+ message.str = object.str;
1592
+ else if (typeof object.str === "object")
1593
+ message.str = new $util.LongBits(object.str.low >>> 0, object.str.high >>> 0).toNumber();
1594
+ if (object.num != null)
1595
+ if ($util.Long)
1596
+ (message.num = $util.Long.fromValue(object.num)).unsigned = false;
1597
+ else if (typeof object.num === "string")
1598
+ message.num = parseInt(object.num, 10);
1599
+ else if (typeof object.num === "number")
1600
+ message.num = object.num;
1601
+ else if (typeof object.num === "object")
1602
+ message.num = new $util.LongBits(object.num.low >>> 0, object.num.high >>> 0).toNumber();
1603
+ if (object.numUnit != null)
1604
+ if ($util.Long)
1605
+ (message.numUnit = $util.Long.fromValue(object.numUnit)).unsigned = false;
1606
+ else if (typeof object.numUnit === "string")
1607
+ message.numUnit = parseInt(object.numUnit, 10);
1608
+ else if (typeof object.numUnit === "number")
1609
+ message.numUnit = object.numUnit;
1610
+ else if (typeof object.numUnit === "object")
1611
+ message.numUnit = new $util.LongBits(object.numUnit.low >>> 0, object.numUnit.high >>> 0).toNumber();
1612
+ return message;
1613
+ };
1614
+
1615
+ /**
1616
+ * Creates a plain object from a Label message. Also converts values to other types if specified.
1617
+ * @function toObject
1618
+ * @memberof perftools.profiles.Label
1619
+ * @static
1620
+ * @param {perftools.profiles.Label} message Label
1621
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1622
+ * @returns {Object.<string,*>} Plain object
1623
+ */
1624
+ Label.toObject = function toObject(message, options) {
1625
+ if (!options)
1626
+ options = {};
1627
+ var object = {};
1628
+ if (options.defaults) {
1629
+ if ($util.Long) {
1630
+ var long = new $util.Long(0, 0, false);
1631
+ object.key = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1632
+ } else
1633
+ object.key = options.longs === String ? "0" : 0;
1634
+ if ($util.Long) {
1635
+ var long = new $util.Long(0, 0, false);
1636
+ object.str = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1637
+ } else
1638
+ object.str = options.longs === String ? "0" : 0;
1639
+ if ($util.Long) {
1640
+ var long = new $util.Long(0, 0, false);
1641
+ object.num = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1642
+ } else
1643
+ object.num = options.longs === String ? "0" : 0;
1644
+ if ($util.Long) {
1645
+ var long = new $util.Long(0, 0, false);
1646
+ object.numUnit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1647
+ } else
1648
+ object.numUnit = options.longs === String ? "0" : 0;
1649
+ }
1650
+ if (message.key != null && message.hasOwnProperty("key"))
1651
+ if (typeof message.key === "number")
1652
+ object.key = options.longs === String ? String(message.key) : message.key;
1653
+ else
1654
+ object.key = options.longs === String ? $util.Long.prototype.toString.call(message.key) : options.longs === Number ? new $util.LongBits(message.key.low >>> 0, message.key.high >>> 0).toNumber() : message.key;
1655
+ if (message.str != null && message.hasOwnProperty("str"))
1656
+ if (typeof message.str === "number")
1657
+ object.str = options.longs === String ? String(message.str) : message.str;
1658
+ else
1659
+ object.str = options.longs === String ? $util.Long.prototype.toString.call(message.str) : options.longs === Number ? new $util.LongBits(message.str.low >>> 0, message.str.high >>> 0).toNumber() : message.str;
1660
+ if (message.num != null && message.hasOwnProperty("num"))
1661
+ if (typeof message.num === "number")
1662
+ object.num = options.longs === String ? String(message.num) : message.num;
1663
+ else
1664
+ object.num = options.longs === String ? $util.Long.prototype.toString.call(message.num) : options.longs === Number ? new $util.LongBits(message.num.low >>> 0, message.num.high >>> 0).toNumber() : message.num;
1665
+ if (message.numUnit != null && message.hasOwnProperty("numUnit"))
1666
+ if (typeof message.numUnit === "number")
1667
+ object.numUnit = options.longs === String ? String(message.numUnit) : message.numUnit;
1668
+ else
1669
+ object.numUnit = options.longs === String ? $util.Long.prototype.toString.call(message.numUnit) : options.longs === Number ? new $util.LongBits(message.numUnit.low >>> 0, message.numUnit.high >>> 0).toNumber() : message.numUnit;
1670
+ return object;
1671
+ };
1672
+
1673
+ /**
1674
+ * Converts this Label to JSON.
1675
+ * @function toJSON
1676
+ * @memberof perftools.profiles.Label
1677
+ * @instance
1678
+ * @returns {Object.<string,*>} JSON object
1679
+ */
1680
+ Label.prototype.toJSON = function toJSON() {
1681
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1682
+ };
1683
+
1684
+ /**
1685
+ * Gets the default type url for Label
1686
+ * @function getTypeUrl
1687
+ * @memberof perftools.profiles.Label
1688
+ * @static
1689
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1690
+ * @returns {string} The default type url
1691
+ */
1692
+ Label.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1693
+ if (typeUrlPrefix === undefined) {
1694
+ typeUrlPrefix = "type.googleapis.com";
1695
+ }
1696
+ return typeUrlPrefix + "/perftools.profiles.Label";
1697
+ };
1698
+
1699
+ return Label;
1700
+ })();
1701
+
1702
+ profiles.Mapping = (function() {
1703
+
1704
+ /**
1705
+ * Properties of a Mapping.
1706
+ * @memberof perftools.profiles
1707
+ * @interface IMapping
1708
+ * @property {number|Long|null} [id] Mapping id
1709
+ * @property {number|Long|null} [memoryStart] Mapping memoryStart
1710
+ * @property {number|Long|null} [memoryLimit] Mapping memoryLimit
1711
+ * @property {number|Long|null} [fileOffset] Mapping fileOffset
1712
+ * @property {number|Long|null} [filename] Mapping filename
1713
+ * @property {number|Long|null} [buildId] Mapping buildId
1714
+ * @property {boolean|null} [hasFunctions] Mapping hasFunctions
1715
+ * @property {boolean|null} [hasFilenames] Mapping hasFilenames
1716
+ * @property {boolean|null} [hasLineNumbers] Mapping hasLineNumbers
1717
+ * @property {boolean|null} [hasInlineFrames] Mapping hasInlineFrames
1718
+ */
1719
+
1720
+ /**
1721
+ * Constructs a new Mapping.
1722
+ * @memberof perftools.profiles
1723
+ * @classdesc Represents a Mapping.
1724
+ * @implements IMapping
1725
+ * @constructor
1726
+ * @param {perftools.profiles.IMapping=} [properties] Properties to set
1727
+ */
1728
+ function Mapping(properties) {
1729
+ if (properties)
1730
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1731
+ if (properties[keys[i]] != null)
1732
+ this[keys[i]] = properties[keys[i]];
1733
+ }
1734
+
1735
+ /**
1736
+ * Mapping id.
1737
+ * @member {number|Long} id
1738
+ * @memberof perftools.profiles.Mapping
1739
+ * @instance
1740
+ */
1741
+ Mapping.prototype.id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
1742
+
1743
+ /**
1744
+ * Mapping memoryStart.
1745
+ * @member {number|Long} memoryStart
1746
+ * @memberof perftools.profiles.Mapping
1747
+ * @instance
1748
+ */
1749
+ Mapping.prototype.memoryStart = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
1750
+
1751
+ /**
1752
+ * Mapping memoryLimit.
1753
+ * @member {number|Long} memoryLimit
1754
+ * @memberof perftools.profiles.Mapping
1755
+ * @instance
1756
+ */
1757
+ Mapping.prototype.memoryLimit = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
1758
+
1759
+ /**
1760
+ * Mapping fileOffset.
1761
+ * @member {number|Long} fileOffset
1762
+ * @memberof perftools.profiles.Mapping
1763
+ * @instance
1764
+ */
1765
+ Mapping.prototype.fileOffset = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
1766
+
1767
+ /**
1768
+ * Mapping filename.
1769
+ * @member {number|Long} filename
1770
+ * @memberof perftools.profiles.Mapping
1771
+ * @instance
1772
+ */
1773
+ Mapping.prototype.filename = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
1774
+
1775
+ /**
1776
+ * Mapping buildId.
1777
+ * @member {number|Long} buildId
1778
+ * @memberof perftools.profiles.Mapping
1779
+ * @instance
1780
+ */
1781
+ Mapping.prototype.buildId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
1782
+
1783
+ /**
1784
+ * Mapping hasFunctions.
1785
+ * @member {boolean} hasFunctions
1786
+ * @memberof perftools.profiles.Mapping
1787
+ * @instance
1788
+ */
1789
+ Mapping.prototype.hasFunctions = false;
1790
+
1791
+ /**
1792
+ * Mapping hasFilenames.
1793
+ * @member {boolean} hasFilenames
1794
+ * @memberof perftools.profiles.Mapping
1795
+ * @instance
1796
+ */
1797
+ Mapping.prototype.hasFilenames = false;
1798
+
1799
+ /**
1800
+ * Mapping hasLineNumbers.
1801
+ * @member {boolean} hasLineNumbers
1802
+ * @memberof perftools.profiles.Mapping
1803
+ * @instance
1804
+ */
1805
+ Mapping.prototype.hasLineNumbers = false;
1806
+
1807
+ /**
1808
+ * Mapping hasInlineFrames.
1809
+ * @member {boolean} hasInlineFrames
1810
+ * @memberof perftools.profiles.Mapping
1811
+ * @instance
1812
+ */
1813
+ Mapping.prototype.hasInlineFrames = false;
1814
+
1815
+ /**
1816
+ * Creates a new Mapping instance using the specified properties.
1817
+ * @function create
1818
+ * @memberof perftools.profiles.Mapping
1819
+ * @static
1820
+ * @param {perftools.profiles.IMapping=} [properties] Properties to set
1821
+ * @returns {perftools.profiles.Mapping} Mapping instance
1822
+ */
1823
+ Mapping.create = function create(properties) {
1824
+ return new Mapping(properties);
1825
+ };
1826
+
1827
+ /**
1828
+ * Encodes the specified Mapping message. Does not implicitly {@link perftools.profiles.Mapping.verify|verify} messages.
1829
+ * @function encode
1830
+ * @memberof perftools.profiles.Mapping
1831
+ * @static
1832
+ * @param {perftools.profiles.IMapping} message Mapping message or plain object to encode
1833
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1834
+ * @returns {$protobuf.Writer} Writer
1835
+ */
1836
+ Mapping.encode = function encode(message, writer) {
1837
+ if (!writer)
1838
+ writer = $Writer.create();
1839
+ if (message.id != null && Object.hasOwnProperty.call(message, "id"))
1840
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.id);
1841
+ if (message.memoryStart != null && Object.hasOwnProperty.call(message, "memoryStart"))
1842
+ writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.memoryStart);
1843
+ if (message.memoryLimit != null && Object.hasOwnProperty.call(message, "memoryLimit"))
1844
+ writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.memoryLimit);
1845
+ if (message.fileOffset != null && Object.hasOwnProperty.call(message, "fileOffset"))
1846
+ writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fileOffset);
1847
+ if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
1848
+ writer.uint32(/* id 5, wireType 0 =*/40).int64(message.filename);
1849
+ if (message.buildId != null && Object.hasOwnProperty.call(message, "buildId"))
1850
+ writer.uint32(/* id 6, wireType 0 =*/48).int64(message.buildId);
1851
+ if (message.hasFunctions != null && Object.hasOwnProperty.call(message, "hasFunctions"))
1852
+ writer.uint32(/* id 7, wireType 0 =*/56).bool(message.hasFunctions);
1853
+ if (message.hasFilenames != null && Object.hasOwnProperty.call(message, "hasFilenames"))
1854
+ writer.uint32(/* id 8, wireType 0 =*/64).bool(message.hasFilenames);
1855
+ if (message.hasLineNumbers != null && Object.hasOwnProperty.call(message, "hasLineNumbers"))
1856
+ writer.uint32(/* id 9, wireType 0 =*/72).bool(message.hasLineNumbers);
1857
+ if (message.hasInlineFrames != null && Object.hasOwnProperty.call(message, "hasInlineFrames"))
1858
+ writer.uint32(/* id 10, wireType 0 =*/80).bool(message.hasInlineFrames);
1859
+ return writer;
1860
+ };
1861
+
1862
+ /**
1863
+ * Encodes the specified Mapping message, length delimited. Does not implicitly {@link perftools.profiles.Mapping.verify|verify} messages.
1864
+ * @function encodeDelimited
1865
+ * @memberof perftools.profiles.Mapping
1866
+ * @static
1867
+ * @param {perftools.profiles.IMapping} message Mapping message or plain object to encode
1868
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1869
+ * @returns {$protobuf.Writer} Writer
1870
+ */
1871
+ Mapping.encodeDelimited = function encodeDelimited(message, writer) {
1872
+ return this.encode(message, writer).ldelim();
1873
+ };
1874
+
1875
+ /**
1876
+ * Decodes a Mapping message from the specified reader or buffer.
1877
+ * @function decode
1878
+ * @memberof perftools.profiles.Mapping
1879
+ * @static
1880
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1881
+ * @param {number} [length] Message length if known beforehand
1882
+ * @returns {perftools.profiles.Mapping} Mapping
1883
+ * @throws {Error} If the payload is not a reader or valid buffer
1884
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1885
+ */
1886
+ Mapping.decode = function decode(reader, length) {
1887
+ if (!(reader instanceof $Reader))
1888
+ reader = $Reader.create(reader);
1889
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.perftools.profiles.Mapping();
1890
+ while (reader.pos < end) {
1891
+ var tag = reader.uint32();
1892
+ switch (tag >>> 3) {
1893
+ case 1: {
1894
+ message.id = reader.uint64();
1895
+ break;
1896
+ }
1897
+ case 2: {
1898
+ message.memoryStart = reader.uint64();
1899
+ break;
1900
+ }
1901
+ case 3: {
1902
+ message.memoryLimit = reader.uint64();
1903
+ break;
1904
+ }
1905
+ case 4: {
1906
+ message.fileOffset = reader.uint64();
1907
+ break;
1908
+ }
1909
+ case 5: {
1910
+ message.filename = reader.int64();
1911
+ break;
1912
+ }
1913
+ case 6: {
1914
+ message.buildId = reader.int64();
1915
+ break;
1916
+ }
1917
+ case 7: {
1918
+ message.hasFunctions = reader.bool();
1919
+ break;
1920
+ }
1921
+ case 8: {
1922
+ message.hasFilenames = reader.bool();
1923
+ break;
1924
+ }
1925
+ case 9: {
1926
+ message.hasLineNumbers = reader.bool();
1927
+ break;
1928
+ }
1929
+ case 10: {
1930
+ message.hasInlineFrames = reader.bool();
1931
+ break;
1932
+ }
1933
+ default:
1934
+ reader.skipType(tag & 7);
1935
+ break;
1936
+ }
1937
+ }
1938
+ return message;
1939
+ };
1940
+
1941
+ /**
1942
+ * Decodes a Mapping message from the specified reader or buffer, length delimited.
1943
+ * @function decodeDelimited
1944
+ * @memberof perftools.profiles.Mapping
1945
+ * @static
1946
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1947
+ * @returns {perftools.profiles.Mapping} Mapping
1948
+ * @throws {Error} If the payload is not a reader or valid buffer
1949
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1950
+ */
1951
+ Mapping.decodeDelimited = function decodeDelimited(reader) {
1952
+ if (!(reader instanceof $Reader))
1953
+ reader = new $Reader(reader);
1954
+ return this.decode(reader, reader.uint32());
1955
+ };
1956
+
1957
+ /**
1958
+ * Verifies a Mapping message.
1959
+ * @function verify
1960
+ * @memberof perftools.profiles.Mapping
1961
+ * @static
1962
+ * @param {Object.<string,*>} message Plain object to verify
1963
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1964
+ */
1965
+ Mapping.verify = function verify(message) {
1966
+ if (typeof message !== "object" || message === null)
1967
+ return "object expected";
1968
+ if (message.id != null && message.hasOwnProperty("id"))
1969
+ if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
1970
+ return "id: integer|Long expected";
1971
+ if (message.memoryStart != null && message.hasOwnProperty("memoryStart"))
1972
+ if (!$util.isInteger(message.memoryStart) && !(message.memoryStart && $util.isInteger(message.memoryStart.low) && $util.isInteger(message.memoryStart.high)))
1973
+ return "memoryStart: integer|Long expected";
1974
+ if (message.memoryLimit != null && message.hasOwnProperty("memoryLimit"))
1975
+ if (!$util.isInteger(message.memoryLimit) && !(message.memoryLimit && $util.isInteger(message.memoryLimit.low) && $util.isInteger(message.memoryLimit.high)))
1976
+ return "memoryLimit: integer|Long expected";
1977
+ if (message.fileOffset != null && message.hasOwnProperty("fileOffset"))
1978
+ if (!$util.isInteger(message.fileOffset) && !(message.fileOffset && $util.isInteger(message.fileOffset.low) && $util.isInteger(message.fileOffset.high)))
1979
+ return "fileOffset: integer|Long expected";
1980
+ if (message.filename != null && message.hasOwnProperty("filename"))
1981
+ if (!$util.isInteger(message.filename) && !(message.filename && $util.isInteger(message.filename.low) && $util.isInteger(message.filename.high)))
1982
+ return "filename: integer|Long expected";
1983
+ if (message.buildId != null && message.hasOwnProperty("buildId"))
1984
+ if (!$util.isInteger(message.buildId) && !(message.buildId && $util.isInteger(message.buildId.low) && $util.isInteger(message.buildId.high)))
1985
+ return "buildId: integer|Long expected";
1986
+ if (message.hasFunctions != null && message.hasOwnProperty("hasFunctions"))
1987
+ if (typeof message.hasFunctions !== "boolean")
1988
+ return "hasFunctions: boolean expected";
1989
+ if (message.hasFilenames != null && message.hasOwnProperty("hasFilenames"))
1990
+ if (typeof message.hasFilenames !== "boolean")
1991
+ return "hasFilenames: boolean expected";
1992
+ if (message.hasLineNumbers != null && message.hasOwnProperty("hasLineNumbers"))
1993
+ if (typeof message.hasLineNumbers !== "boolean")
1994
+ return "hasLineNumbers: boolean expected";
1995
+ if (message.hasInlineFrames != null && message.hasOwnProperty("hasInlineFrames"))
1996
+ if (typeof message.hasInlineFrames !== "boolean")
1997
+ return "hasInlineFrames: boolean expected";
1998
+ return null;
1999
+ };
2000
+
2001
+ /**
2002
+ * Creates a Mapping message from a plain object. Also converts values to their respective internal types.
2003
+ * @function fromObject
2004
+ * @memberof perftools.profiles.Mapping
2005
+ * @static
2006
+ * @param {Object.<string,*>} object Plain object
2007
+ * @returns {perftools.profiles.Mapping} Mapping
2008
+ */
2009
+ Mapping.fromObject = function fromObject(object) {
2010
+ if (object instanceof $root.perftools.profiles.Mapping)
2011
+ return object;
2012
+ var message = new $root.perftools.profiles.Mapping();
2013
+ if (object.id != null)
2014
+ if ($util.Long)
2015
+ (message.id = $util.Long.fromValue(object.id)).unsigned = true;
2016
+ else if (typeof object.id === "string")
2017
+ message.id = parseInt(object.id, 10);
2018
+ else if (typeof object.id === "number")
2019
+ message.id = object.id;
2020
+ else if (typeof object.id === "object")
2021
+ message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true);
2022
+ if (object.memoryStart != null)
2023
+ if ($util.Long)
2024
+ (message.memoryStart = $util.Long.fromValue(object.memoryStart)).unsigned = true;
2025
+ else if (typeof object.memoryStart === "string")
2026
+ message.memoryStart = parseInt(object.memoryStart, 10);
2027
+ else if (typeof object.memoryStart === "number")
2028
+ message.memoryStart = object.memoryStart;
2029
+ else if (typeof object.memoryStart === "object")
2030
+ message.memoryStart = new $util.LongBits(object.memoryStart.low >>> 0, object.memoryStart.high >>> 0).toNumber(true);
2031
+ if (object.memoryLimit != null)
2032
+ if ($util.Long)
2033
+ (message.memoryLimit = $util.Long.fromValue(object.memoryLimit)).unsigned = true;
2034
+ else if (typeof object.memoryLimit === "string")
2035
+ message.memoryLimit = parseInt(object.memoryLimit, 10);
2036
+ else if (typeof object.memoryLimit === "number")
2037
+ message.memoryLimit = object.memoryLimit;
2038
+ else if (typeof object.memoryLimit === "object")
2039
+ message.memoryLimit = new $util.LongBits(object.memoryLimit.low >>> 0, object.memoryLimit.high >>> 0).toNumber(true);
2040
+ if (object.fileOffset != null)
2041
+ if ($util.Long)
2042
+ (message.fileOffset = $util.Long.fromValue(object.fileOffset)).unsigned = true;
2043
+ else if (typeof object.fileOffset === "string")
2044
+ message.fileOffset = parseInt(object.fileOffset, 10);
2045
+ else if (typeof object.fileOffset === "number")
2046
+ message.fileOffset = object.fileOffset;
2047
+ else if (typeof object.fileOffset === "object")
2048
+ message.fileOffset = new $util.LongBits(object.fileOffset.low >>> 0, object.fileOffset.high >>> 0).toNumber(true);
2049
+ if (object.filename != null)
2050
+ if ($util.Long)
2051
+ (message.filename = $util.Long.fromValue(object.filename)).unsigned = false;
2052
+ else if (typeof object.filename === "string")
2053
+ message.filename = parseInt(object.filename, 10);
2054
+ else if (typeof object.filename === "number")
2055
+ message.filename = object.filename;
2056
+ else if (typeof object.filename === "object")
2057
+ message.filename = new $util.LongBits(object.filename.low >>> 0, object.filename.high >>> 0).toNumber();
2058
+ if (object.buildId != null)
2059
+ if ($util.Long)
2060
+ (message.buildId = $util.Long.fromValue(object.buildId)).unsigned = false;
2061
+ else if (typeof object.buildId === "string")
2062
+ message.buildId = parseInt(object.buildId, 10);
2063
+ else if (typeof object.buildId === "number")
2064
+ message.buildId = object.buildId;
2065
+ else if (typeof object.buildId === "object")
2066
+ message.buildId = new $util.LongBits(object.buildId.low >>> 0, object.buildId.high >>> 0).toNumber();
2067
+ if (object.hasFunctions != null)
2068
+ message.hasFunctions = Boolean(object.hasFunctions);
2069
+ if (object.hasFilenames != null)
2070
+ message.hasFilenames = Boolean(object.hasFilenames);
2071
+ if (object.hasLineNumbers != null)
2072
+ message.hasLineNumbers = Boolean(object.hasLineNumbers);
2073
+ if (object.hasInlineFrames != null)
2074
+ message.hasInlineFrames = Boolean(object.hasInlineFrames);
2075
+ return message;
2076
+ };
2077
+
2078
+ /**
2079
+ * Creates a plain object from a Mapping message. Also converts values to other types if specified.
2080
+ * @function toObject
2081
+ * @memberof perftools.profiles.Mapping
2082
+ * @static
2083
+ * @param {perftools.profiles.Mapping} message Mapping
2084
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2085
+ * @returns {Object.<string,*>} Plain object
2086
+ */
2087
+ Mapping.toObject = function toObject(message, options) {
2088
+ if (!options)
2089
+ options = {};
2090
+ var object = {};
2091
+ if (options.defaults) {
2092
+ if ($util.Long) {
2093
+ var long = new $util.Long(0, 0, true);
2094
+ object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2095
+ } else
2096
+ object.id = options.longs === String ? "0" : 0;
2097
+ if ($util.Long) {
2098
+ var long = new $util.Long(0, 0, true);
2099
+ object.memoryStart = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2100
+ } else
2101
+ object.memoryStart = options.longs === String ? "0" : 0;
2102
+ if ($util.Long) {
2103
+ var long = new $util.Long(0, 0, true);
2104
+ object.memoryLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2105
+ } else
2106
+ object.memoryLimit = options.longs === String ? "0" : 0;
2107
+ if ($util.Long) {
2108
+ var long = new $util.Long(0, 0, true);
2109
+ object.fileOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2110
+ } else
2111
+ object.fileOffset = options.longs === String ? "0" : 0;
2112
+ if ($util.Long) {
2113
+ var long = new $util.Long(0, 0, false);
2114
+ object.filename = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2115
+ } else
2116
+ object.filename = options.longs === String ? "0" : 0;
2117
+ if ($util.Long) {
2118
+ var long = new $util.Long(0, 0, false);
2119
+ object.buildId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2120
+ } else
2121
+ object.buildId = options.longs === String ? "0" : 0;
2122
+ object.hasFunctions = false;
2123
+ object.hasFilenames = false;
2124
+ object.hasLineNumbers = false;
2125
+ object.hasInlineFrames = false;
2126
+ }
2127
+ if (message.id != null && message.hasOwnProperty("id"))
2128
+ if (typeof message.id === "number")
2129
+ object.id = options.longs === String ? String(message.id) : message.id;
2130
+ else
2131
+ object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id;
2132
+ if (message.memoryStart != null && message.hasOwnProperty("memoryStart"))
2133
+ if (typeof message.memoryStart === "number")
2134
+ object.memoryStart = options.longs === String ? String(message.memoryStart) : message.memoryStart;
2135
+ else
2136
+ object.memoryStart = options.longs === String ? $util.Long.prototype.toString.call(message.memoryStart) : options.longs === Number ? new $util.LongBits(message.memoryStart.low >>> 0, message.memoryStart.high >>> 0).toNumber(true) : message.memoryStart;
2137
+ if (message.memoryLimit != null && message.hasOwnProperty("memoryLimit"))
2138
+ if (typeof message.memoryLimit === "number")
2139
+ object.memoryLimit = options.longs === String ? String(message.memoryLimit) : message.memoryLimit;
2140
+ else
2141
+ object.memoryLimit = options.longs === String ? $util.Long.prototype.toString.call(message.memoryLimit) : options.longs === Number ? new $util.LongBits(message.memoryLimit.low >>> 0, message.memoryLimit.high >>> 0).toNumber(true) : message.memoryLimit;
2142
+ if (message.fileOffset != null && message.hasOwnProperty("fileOffset"))
2143
+ if (typeof message.fileOffset === "number")
2144
+ object.fileOffset = options.longs === String ? String(message.fileOffset) : message.fileOffset;
2145
+ else
2146
+ object.fileOffset = options.longs === String ? $util.Long.prototype.toString.call(message.fileOffset) : options.longs === Number ? new $util.LongBits(message.fileOffset.low >>> 0, message.fileOffset.high >>> 0).toNumber(true) : message.fileOffset;
2147
+ if (message.filename != null && message.hasOwnProperty("filename"))
2148
+ if (typeof message.filename === "number")
2149
+ object.filename = options.longs === String ? String(message.filename) : message.filename;
2150
+ else
2151
+ object.filename = options.longs === String ? $util.Long.prototype.toString.call(message.filename) : options.longs === Number ? new $util.LongBits(message.filename.low >>> 0, message.filename.high >>> 0).toNumber() : message.filename;
2152
+ if (message.buildId != null && message.hasOwnProperty("buildId"))
2153
+ if (typeof message.buildId === "number")
2154
+ object.buildId = options.longs === String ? String(message.buildId) : message.buildId;
2155
+ else
2156
+ object.buildId = options.longs === String ? $util.Long.prototype.toString.call(message.buildId) : options.longs === Number ? new $util.LongBits(message.buildId.low >>> 0, message.buildId.high >>> 0).toNumber() : message.buildId;
2157
+ if (message.hasFunctions != null && message.hasOwnProperty("hasFunctions"))
2158
+ object.hasFunctions = message.hasFunctions;
2159
+ if (message.hasFilenames != null && message.hasOwnProperty("hasFilenames"))
2160
+ object.hasFilenames = message.hasFilenames;
2161
+ if (message.hasLineNumbers != null && message.hasOwnProperty("hasLineNumbers"))
2162
+ object.hasLineNumbers = message.hasLineNumbers;
2163
+ if (message.hasInlineFrames != null && message.hasOwnProperty("hasInlineFrames"))
2164
+ object.hasInlineFrames = message.hasInlineFrames;
2165
+ return object;
2166
+ };
2167
+
2168
+ /**
2169
+ * Converts this Mapping to JSON.
2170
+ * @function toJSON
2171
+ * @memberof perftools.profiles.Mapping
2172
+ * @instance
2173
+ * @returns {Object.<string,*>} JSON object
2174
+ */
2175
+ Mapping.prototype.toJSON = function toJSON() {
2176
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2177
+ };
2178
+
2179
+ /**
2180
+ * Gets the default type url for Mapping
2181
+ * @function getTypeUrl
2182
+ * @memberof perftools.profiles.Mapping
2183
+ * @static
2184
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2185
+ * @returns {string} The default type url
2186
+ */
2187
+ Mapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2188
+ if (typeUrlPrefix === undefined) {
2189
+ typeUrlPrefix = "type.googleapis.com";
2190
+ }
2191
+ return typeUrlPrefix + "/perftools.profiles.Mapping";
2192
+ };
2193
+
2194
+ return Mapping;
2195
+ })();
2196
+
2197
+ profiles.Location = (function() {
2198
+
2199
+ /**
2200
+ * Properties of a Location.
2201
+ * @memberof perftools.profiles
2202
+ * @interface ILocation
2203
+ * @property {number|Long|null} [id] Location id
2204
+ * @property {number|Long|null} [mappingId] Location mappingId
2205
+ * @property {number|Long|null} [address] Location address
2206
+ * @property {Array.<perftools.profiles.ILine>|null} [line] Location line
2207
+ */
2208
+
2209
+ /**
2210
+ * Constructs a new Location.
2211
+ * @memberof perftools.profiles
2212
+ * @classdesc Represents a Location.
2213
+ * @implements ILocation
2214
+ * @constructor
2215
+ * @param {perftools.profiles.ILocation=} [properties] Properties to set
2216
+ */
2217
+ function Location(properties) {
2218
+ this.line = [];
2219
+ if (properties)
2220
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2221
+ if (properties[keys[i]] != null)
2222
+ this[keys[i]] = properties[keys[i]];
2223
+ }
2224
+
2225
+ /**
2226
+ * Location id.
2227
+ * @member {number|Long} id
2228
+ * @memberof perftools.profiles.Location
2229
+ * @instance
2230
+ */
2231
+ Location.prototype.id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
2232
+
2233
+ /**
2234
+ * Location mappingId.
2235
+ * @member {number|Long} mappingId
2236
+ * @memberof perftools.profiles.Location
2237
+ * @instance
2238
+ */
2239
+ Location.prototype.mappingId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
2240
+
2241
+ /**
2242
+ * Location address.
2243
+ * @member {number|Long} address
2244
+ * @memberof perftools.profiles.Location
2245
+ * @instance
2246
+ */
2247
+ Location.prototype.address = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
2248
+
2249
+ /**
2250
+ * Location line.
2251
+ * @member {Array.<perftools.profiles.ILine>} line
2252
+ * @memberof perftools.profiles.Location
2253
+ * @instance
2254
+ */
2255
+ Location.prototype.line = $util.emptyArray;
2256
+
2257
+ /**
2258
+ * Creates a new Location instance using the specified properties.
2259
+ * @function create
2260
+ * @memberof perftools.profiles.Location
2261
+ * @static
2262
+ * @param {perftools.profiles.ILocation=} [properties] Properties to set
2263
+ * @returns {perftools.profiles.Location} Location instance
2264
+ */
2265
+ Location.create = function create(properties) {
2266
+ return new Location(properties);
2267
+ };
2268
+
2269
+ /**
2270
+ * Encodes the specified Location message. Does not implicitly {@link perftools.profiles.Location.verify|verify} messages.
2271
+ * @function encode
2272
+ * @memberof perftools.profiles.Location
2273
+ * @static
2274
+ * @param {perftools.profiles.ILocation} message Location message or plain object to encode
2275
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2276
+ * @returns {$protobuf.Writer} Writer
2277
+ */
2278
+ Location.encode = function encode(message, writer) {
2279
+ if (!writer)
2280
+ writer = $Writer.create();
2281
+ if (message.id != null && Object.hasOwnProperty.call(message, "id"))
2282
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.id);
2283
+ if (message.mappingId != null && Object.hasOwnProperty.call(message, "mappingId"))
2284
+ writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.mappingId);
2285
+ if (message.address != null && Object.hasOwnProperty.call(message, "address"))
2286
+ writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.address);
2287
+ if (message.line != null && message.line.length)
2288
+ for (var i = 0; i < message.line.length; ++i)
2289
+ $root.perftools.profiles.Line.encode(message.line[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
2290
+ return writer;
2291
+ };
2292
+
2293
+ /**
2294
+ * Encodes the specified Location message, length delimited. Does not implicitly {@link perftools.profiles.Location.verify|verify} messages.
2295
+ * @function encodeDelimited
2296
+ * @memberof perftools.profiles.Location
2297
+ * @static
2298
+ * @param {perftools.profiles.ILocation} message Location message or plain object to encode
2299
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2300
+ * @returns {$protobuf.Writer} Writer
2301
+ */
2302
+ Location.encodeDelimited = function encodeDelimited(message, writer) {
2303
+ return this.encode(message, writer).ldelim();
2304
+ };
2305
+
2306
+ /**
2307
+ * Decodes a Location message from the specified reader or buffer.
2308
+ * @function decode
2309
+ * @memberof perftools.profiles.Location
2310
+ * @static
2311
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2312
+ * @param {number} [length] Message length if known beforehand
2313
+ * @returns {perftools.profiles.Location} Location
2314
+ * @throws {Error} If the payload is not a reader or valid buffer
2315
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2316
+ */
2317
+ Location.decode = function decode(reader, length) {
2318
+ if (!(reader instanceof $Reader))
2319
+ reader = $Reader.create(reader);
2320
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.perftools.profiles.Location();
2321
+ while (reader.pos < end) {
2322
+ var tag = reader.uint32();
2323
+ switch (tag >>> 3) {
2324
+ case 1: {
2325
+ message.id = reader.uint64();
2326
+ break;
2327
+ }
2328
+ case 2: {
2329
+ message.mappingId = reader.uint64();
2330
+ break;
2331
+ }
2332
+ case 3: {
2333
+ message.address = reader.uint64();
2334
+ break;
2335
+ }
2336
+ case 4: {
2337
+ if (!(message.line && message.line.length))
2338
+ message.line = [];
2339
+ message.line.push($root.perftools.profiles.Line.decode(reader, reader.uint32()));
2340
+ break;
2341
+ }
2342
+ default:
2343
+ reader.skipType(tag & 7);
2344
+ break;
2345
+ }
2346
+ }
2347
+ return message;
2348
+ };
2349
+
2350
+ /**
2351
+ * Decodes a Location message from the specified reader or buffer, length delimited.
2352
+ * @function decodeDelimited
2353
+ * @memberof perftools.profiles.Location
2354
+ * @static
2355
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2356
+ * @returns {perftools.profiles.Location} Location
2357
+ * @throws {Error} If the payload is not a reader or valid buffer
2358
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2359
+ */
2360
+ Location.decodeDelimited = function decodeDelimited(reader) {
2361
+ if (!(reader instanceof $Reader))
2362
+ reader = new $Reader(reader);
2363
+ return this.decode(reader, reader.uint32());
2364
+ };
2365
+
2366
+ /**
2367
+ * Verifies a Location message.
2368
+ * @function verify
2369
+ * @memberof perftools.profiles.Location
2370
+ * @static
2371
+ * @param {Object.<string,*>} message Plain object to verify
2372
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2373
+ */
2374
+ Location.verify = function verify(message) {
2375
+ if (typeof message !== "object" || message === null)
2376
+ return "object expected";
2377
+ if (message.id != null && message.hasOwnProperty("id"))
2378
+ if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
2379
+ return "id: integer|Long expected";
2380
+ if (message.mappingId != null && message.hasOwnProperty("mappingId"))
2381
+ if (!$util.isInteger(message.mappingId) && !(message.mappingId && $util.isInteger(message.mappingId.low) && $util.isInteger(message.mappingId.high)))
2382
+ return "mappingId: integer|Long expected";
2383
+ if (message.address != null && message.hasOwnProperty("address"))
2384
+ if (!$util.isInteger(message.address) && !(message.address && $util.isInteger(message.address.low) && $util.isInteger(message.address.high)))
2385
+ return "address: integer|Long expected";
2386
+ if (message.line != null && message.hasOwnProperty("line")) {
2387
+ if (!Array.isArray(message.line))
2388
+ return "line: array expected";
2389
+ for (var i = 0; i < message.line.length; ++i) {
2390
+ var error = $root.perftools.profiles.Line.verify(message.line[i]);
2391
+ if (error)
2392
+ return "line." + error;
2393
+ }
2394
+ }
2395
+ return null;
2396
+ };
2397
+
2398
+ /**
2399
+ * Creates a Location message from a plain object. Also converts values to their respective internal types.
2400
+ * @function fromObject
2401
+ * @memberof perftools.profiles.Location
2402
+ * @static
2403
+ * @param {Object.<string,*>} object Plain object
2404
+ * @returns {perftools.profiles.Location} Location
2405
+ */
2406
+ Location.fromObject = function fromObject(object) {
2407
+ if (object instanceof $root.perftools.profiles.Location)
2408
+ return object;
2409
+ var message = new $root.perftools.profiles.Location();
2410
+ if (object.id != null)
2411
+ if ($util.Long)
2412
+ (message.id = $util.Long.fromValue(object.id)).unsigned = true;
2413
+ else if (typeof object.id === "string")
2414
+ message.id = parseInt(object.id, 10);
2415
+ else if (typeof object.id === "number")
2416
+ message.id = object.id;
2417
+ else if (typeof object.id === "object")
2418
+ message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true);
2419
+ if (object.mappingId != null)
2420
+ if ($util.Long)
2421
+ (message.mappingId = $util.Long.fromValue(object.mappingId)).unsigned = true;
2422
+ else if (typeof object.mappingId === "string")
2423
+ message.mappingId = parseInt(object.mappingId, 10);
2424
+ else if (typeof object.mappingId === "number")
2425
+ message.mappingId = object.mappingId;
2426
+ else if (typeof object.mappingId === "object")
2427
+ message.mappingId = new $util.LongBits(object.mappingId.low >>> 0, object.mappingId.high >>> 0).toNumber(true);
2428
+ if (object.address != null)
2429
+ if ($util.Long)
2430
+ (message.address = $util.Long.fromValue(object.address)).unsigned = true;
2431
+ else if (typeof object.address === "string")
2432
+ message.address = parseInt(object.address, 10);
2433
+ else if (typeof object.address === "number")
2434
+ message.address = object.address;
2435
+ else if (typeof object.address === "object")
2436
+ message.address = new $util.LongBits(object.address.low >>> 0, object.address.high >>> 0).toNumber(true);
2437
+ if (object.line) {
2438
+ if (!Array.isArray(object.line))
2439
+ throw TypeError(".perftools.profiles.Location.line: array expected");
2440
+ message.line = [];
2441
+ for (var i = 0; i < object.line.length; ++i) {
2442
+ if (typeof object.line[i] !== "object")
2443
+ throw TypeError(".perftools.profiles.Location.line: object expected");
2444
+ message.line[i] = $root.perftools.profiles.Line.fromObject(object.line[i]);
2445
+ }
2446
+ }
2447
+ return message;
2448
+ };
2449
+
2450
+ /**
2451
+ * Creates a plain object from a Location message. Also converts values to other types if specified.
2452
+ * @function toObject
2453
+ * @memberof perftools.profiles.Location
2454
+ * @static
2455
+ * @param {perftools.profiles.Location} message Location
2456
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2457
+ * @returns {Object.<string,*>} Plain object
2458
+ */
2459
+ Location.toObject = function toObject(message, options) {
2460
+ if (!options)
2461
+ options = {};
2462
+ var object = {};
2463
+ if (options.arrays || options.defaults)
2464
+ object.line = [];
2465
+ if (options.defaults) {
2466
+ if ($util.Long) {
2467
+ var long = new $util.Long(0, 0, true);
2468
+ object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2469
+ } else
2470
+ object.id = options.longs === String ? "0" : 0;
2471
+ if ($util.Long) {
2472
+ var long = new $util.Long(0, 0, true);
2473
+ object.mappingId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2474
+ } else
2475
+ object.mappingId = options.longs === String ? "0" : 0;
2476
+ if ($util.Long) {
2477
+ var long = new $util.Long(0, 0, true);
2478
+ object.address = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2479
+ } else
2480
+ object.address = options.longs === String ? "0" : 0;
2481
+ }
2482
+ if (message.id != null && message.hasOwnProperty("id"))
2483
+ if (typeof message.id === "number")
2484
+ object.id = options.longs === String ? String(message.id) : message.id;
2485
+ else
2486
+ object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id;
2487
+ if (message.mappingId != null && message.hasOwnProperty("mappingId"))
2488
+ if (typeof message.mappingId === "number")
2489
+ object.mappingId = options.longs === String ? String(message.mappingId) : message.mappingId;
2490
+ else
2491
+ object.mappingId = options.longs === String ? $util.Long.prototype.toString.call(message.mappingId) : options.longs === Number ? new $util.LongBits(message.mappingId.low >>> 0, message.mappingId.high >>> 0).toNumber(true) : message.mappingId;
2492
+ if (message.address != null && message.hasOwnProperty("address"))
2493
+ if (typeof message.address === "number")
2494
+ object.address = options.longs === String ? String(message.address) : message.address;
2495
+ else
2496
+ object.address = options.longs === String ? $util.Long.prototype.toString.call(message.address) : options.longs === Number ? new $util.LongBits(message.address.low >>> 0, message.address.high >>> 0).toNumber(true) : message.address;
2497
+ if (message.line && message.line.length) {
2498
+ object.line = [];
2499
+ for (var j = 0; j < message.line.length; ++j)
2500
+ object.line[j] = $root.perftools.profiles.Line.toObject(message.line[j], options);
2501
+ }
2502
+ return object;
2503
+ };
2504
+
2505
+ /**
2506
+ * Converts this Location to JSON.
2507
+ * @function toJSON
2508
+ * @memberof perftools.profiles.Location
2509
+ * @instance
2510
+ * @returns {Object.<string,*>} JSON object
2511
+ */
2512
+ Location.prototype.toJSON = function toJSON() {
2513
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2514
+ };
2515
+
2516
+ /**
2517
+ * Gets the default type url for Location
2518
+ * @function getTypeUrl
2519
+ * @memberof perftools.profiles.Location
2520
+ * @static
2521
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2522
+ * @returns {string} The default type url
2523
+ */
2524
+ Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2525
+ if (typeUrlPrefix === undefined) {
2526
+ typeUrlPrefix = "type.googleapis.com";
2527
+ }
2528
+ return typeUrlPrefix + "/perftools.profiles.Location";
2529
+ };
2530
+
2531
+ return Location;
2532
+ })();
2533
+
2534
+ profiles.Line = (function() {
2535
+
2536
+ /**
2537
+ * Properties of a Line.
2538
+ * @memberof perftools.profiles
2539
+ * @interface ILine
2540
+ * @property {number|Long|null} [functionId] Line functionId
2541
+ * @property {number|Long|null} [line] Line line
2542
+ */
2543
+
2544
+ /**
2545
+ * Constructs a new Line.
2546
+ * @memberof perftools.profiles
2547
+ * @classdesc Represents a Line.
2548
+ * @implements ILine
2549
+ * @constructor
2550
+ * @param {perftools.profiles.ILine=} [properties] Properties to set
2551
+ */
2552
+ function Line(properties) {
2553
+ if (properties)
2554
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2555
+ if (properties[keys[i]] != null)
2556
+ this[keys[i]] = properties[keys[i]];
2557
+ }
2558
+
2559
+ /**
2560
+ * Line functionId.
2561
+ * @member {number|Long} functionId
2562
+ * @memberof perftools.profiles.Line
2563
+ * @instance
2564
+ */
2565
+ Line.prototype.functionId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
2566
+
2567
+ /**
2568
+ * Line line.
2569
+ * @member {number|Long} line
2570
+ * @memberof perftools.profiles.Line
2571
+ * @instance
2572
+ */
2573
+ Line.prototype.line = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
2574
+
2575
+ /**
2576
+ * Creates a new Line instance using the specified properties.
2577
+ * @function create
2578
+ * @memberof perftools.profiles.Line
2579
+ * @static
2580
+ * @param {perftools.profiles.ILine=} [properties] Properties to set
2581
+ * @returns {perftools.profiles.Line} Line instance
2582
+ */
2583
+ Line.create = function create(properties) {
2584
+ return new Line(properties);
2585
+ };
2586
+
2587
+ /**
2588
+ * Encodes the specified Line message. Does not implicitly {@link perftools.profiles.Line.verify|verify} messages.
2589
+ * @function encode
2590
+ * @memberof perftools.profiles.Line
2591
+ * @static
2592
+ * @param {perftools.profiles.ILine} message Line message or plain object to encode
2593
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2594
+ * @returns {$protobuf.Writer} Writer
2595
+ */
2596
+ Line.encode = function encode(message, writer) {
2597
+ if (!writer)
2598
+ writer = $Writer.create();
2599
+ if (message.functionId != null && Object.hasOwnProperty.call(message, "functionId"))
2600
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.functionId);
2601
+ if (message.line != null && Object.hasOwnProperty.call(message, "line"))
2602
+ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.line);
2603
+ return writer;
2604
+ };
2605
+
2606
+ /**
2607
+ * Encodes the specified Line message, length delimited. Does not implicitly {@link perftools.profiles.Line.verify|verify} messages.
2608
+ * @function encodeDelimited
2609
+ * @memberof perftools.profiles.Line
2610
+ * @static
2611
+ * @param {perftools.profiles.ILine} message Line message or plain object to encode
2612
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2613
+ * @returns {$protobuf.Writer} Writer
2614
+ */
2615
+ Line.encodeDelimited = function encodeDelimited(message, writer) {
2616
+ return this.encode(message, writer).ldelim();
2617
+ };
2618
+
2619
+ /**
2620
+ * Decodes a Line message from the specified reader or buffer.
2621
+ * @function decode
2622
+ * @memberof perftools.profiles.Line
2623
+ * @static
2624
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2625
+ * @param {number} [length] Message length if known beforehand
2626
+ * @returns {perftools.profiles.Line} Line
2627
+ * @throws {Error} If the payload is not a reader or valid buffer
2628
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2629
+ */
2630
+ Line.decode = function decode(reader, length) {
2631
+ if (!(reader instanceof $Reader))
2632
+ reader = $Reader.create(reader);
2633
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.perftools.profiles.Line();
2634
+ while (reader.pos < end) {
2635
+ var tag = reader.uint32();
2636
+ switch (tag >>> 3) {
2637
+ case 1: {
2638
+ message.functionId = reader.uint64();
2639
+ break;
2640
+ }
2641
+ case 2: {
2642
+ message.line = reader.int64();
2643
+ break;
2644
+ }
2645
+ default:
2646
+ reader.skipType(tag & 7);
2647
+ break;
2648
+ }
2649
+ }
2650
+ return message;
2651
+ };
2652
+
2653
+ /**
2654
+ * Decodes a Line message from the specified reader or buffer, length delimited.
2655
+ * @function decodeDelimited
2656
+ * @memberof perftools.profiles.Line
2657
+ * @static
2658
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2659
+ * @returns {perftools.profiles.Line} Line
2660
+ * @throws {Error} If the payload is not a reader or valid buffer
2661
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2662
+ */
2663
+ Line.decodeDelimited = function decodeDelimited(reader) {
2664
+ if (!(reader instanceof $Reader))
2665
+ reader = new $Reader(reader);
2666
+ return this.decode(reader, reader.uint32());
2667
+ };
2668
+
2669
+ /**
2670
+ * Verifies a Line message.
2671
+ * @function verify
2672
+ * @memberof perftools.profiles.Line
2673
+ * @static
2674
+ * @param {Object.<string,*>} message Plain object to verify
2675
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2676
+ */
2677
+ Line.verify = function verify(message) {
2678
+ if (typeof message !== "object" || message === null)
2679
+ return "object expected";
2680
+ if (message.functionId != null && message.hasOwnProperty("functionId"))
2681
+ if (!$util.isInteger(message.functionId) && !(message.functionId && $util.isInteger(message.functionId.low) && $util.isInteger(message.functionId.high)))
2682
+ return "functionId: integer|Long expected";
2683
+ if (message.line != null && message.hasOwnProperty("line"))
2684
+ if (!$util.isInteger(message.line) && !(message.line && $util.isInteger(message.line.low) && $util.isInteger(message.line.high)))
2685
+ return "line: integer|Long expected";
2686
+ return null;
2687
+ };
2688
+
2689
+ /**
2690
+ * Creates a Line message from a plain object. Also converts values to their respective internal types.
2691
+ * @function fromObject
2692
+ * @memberof perftools.profiles.Line
2693
+ * @static
2694
+ * @param {Object.<string,*>} object Plain object
2695
+ * @returns {perftools.profiles.Line} Line
2696
+ */
2697
+ Line.fromObject = function fromObject(object) {
2698
+ if (object instanceof $root.perftools.profiles.Line)
2699
+ return object;
2700
+ var message = new $root.perftools.profiles.Line();
2701
+ if (object.functionId != null)
2702
+ if ($util.Long)
2703
+ (message.functionId = $util.Long.fromValue(object.functionId)).unsigned = true;
2704
+ else if (typeof object.functionId === "string")
2705
+ message.functionId = parseInt(object.functionId, 10);
2706
+ else if (typeof object.functionId === "number")
2707
+ message.functionId = object.functionId;
2708
+ else if (typeof object.functionId === "object")
2709
+ message.functionId = new $util.LongBits(object.functionId.low >>> 0, object.functionId.high >>> 0).toNumber(true);
2710
+ if (object.line != null)
2711
+ if ($util.Long)
2712
+ (message.line = $util.Long.fromValue(object.line)).unsigned = false;
2713
+ else if (typeof object.line === "string")
2714
+ message.line = parseInt(object.line, 10);
2715
+ else if (typeof object.line === "number")
2716
+ message.line = object.line;
2717
+ else if (typeof object.line === "object")
2718
+ message.line = new $util.LongBits(object.line.low >>> 0, object.line.high >>> 0).toNumber();
2719
+ return message;
2720
+ };
2721
+
2722
+ /**
2723
+ * Creates a plain object from a Line message. Also converts values to other types if specified.
2724
+ * @function toObject
2725
+ * @memberof perftools.profiles.Line
2726
+ * @static
2727
+ * @param {perftools.profiles.Line} message Line
2728
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2729
+ * @returns {Object.<string,*>} Plain object
2730
+ */
2731
+ Line.toObject = function toObject(message, options) {
2732
+ if (!options)
2733
+ options = {};
2734
+ var object = {};
2735
+ if (options.defaults) {
2736
+ if ($util.Long) {
2737
+ var long = new $util.Long(0, 0, true);
2738
+ object.functionId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2739
+ } else
2740
+ object.functionId = options.longs === String ? "0" : 0;
2741
+ if ($util.Long) {
2742
+ var long = new $util.Long(0, 0, false);
2743
+ object.line = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2744
+ } else
2745
+ object.line = options.longs === String ? "0" : 0;
2746
+ }
2747
+ if (message.functionId != null && message.hasOwnProperty("functionId"))
2748
+ if (typeof message.functionId === "number")
2749
+ object.functionId = options.longs === String ? String(message.functionId) : message.functionId;
2750
+ else
2751
+ object.functionId = options.longs === String ? $util.Long.prototype.toString.call(message.functionId) : options.longs === Number ? new $util.LongBits(message.functionId.low >>> 0, message.functionId.high >>> 0).toNumber(true) : message.functionId;
2752
+ if (message.line != null && message.hasOwnProperty("line"))
2753
+ if (typeof message.line === "number")
2754
+ object.line = options.longs === String ? String(message.line) : message.line;
2755
+ else
2756
+ object.line = options.longs === String ? $util.Long.prototype.toString.call(message.line) : options.longs === Number ? new $util.LongBits(message.line.low >>> 0, message.line.high >>> 0).toNumber() : message.line;
2757
+ return object;
2758
+ };
2759
+
2760
+ /**
2761
+ * Converts this Line to JSON.
2762
+ * @function toJSON
2763
+ * @memberof perftools.profiles.Line
2764
+ * @instance
2765
+ * @returns {Object.<string,*>} JSON object
2766
+ */
2767
+ Line.prototype.toJSON = function toJSON() {
2768
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2769
+ };
2770
+
2771
+ /**
2772
+ * Gets the default type url for Line
2773
+ * @function getTypeUrl
2774
+ * @memberof perftools.profiles.Line
2775
+ * @static
2776
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2777
+ * @returns {string} The default type url
2778
+ */
2779
+ Line.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2780
+ if (typeUrlPrefix === undefined) {
2781
+ typeUrlPrefix = "type.googleapis.com";
2782
+ }
2783
+ return typeUrlPrefix + "/perftools.profiles.Line";
2784
+ };
2785
+
2786
+ return Line;
2787
+ })();
2788
+
2789
+ profiles.Function = (function() {
2790
+
2791
+ /**
2792
+ * Properties of a Function.
2793
+ * @memberof perftools.profiles
2794
+ * @interface IFunction
2795
+ * @property {number|Long|null} [id] Function id
2796
+ * @property {number|Long|null} [name] Function name
2797
+ * @property {number|Long|null} [systemName] Function systemName
2798
+ * @property {number|Long|null} [filename] Function filename
2799
+ * @property {number|Long|null} [startLine] Function startLine
2800
+ */
2801
+
2802
+ /**
2803
+ * Constructs a new Function.
2804
+ * @memberof perftools.profiles
2805
+ * @classdesc Represents a Function.
2806
+ * @implements IFunction
2807
+ * @constructor
2808
+ * @param {perftools.profiles.IFunction=} [properties] Properties to set
2809
+ */
2810
+ function Function(properties) {
2811
+ if (properties)
2812
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2813
+ if (properties[keys[i]] != null)
2814
+ this[keys[i]] = properties[keys[i]];
2815
+ }
2816
+
2817
+ /**
2818
+ * Function id.
2819
+ * @member {number|Long} id
2820
+ * @memberof perftools.profiles.Function
2821
+ * @instance
2822
+ */
2823
+ Function.prototype.id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
2824
+
2825
+ /**
2826
+ * Function name.
2827
+ * @member {number|Long} name
2828
+ * @memberof perftools.profiles.Function
2829
+ * @instance
2830
+ */
2831
+ Function.prototype.name = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
2832
+
2833
+ /**
2834
+ * Function systemName.
2835
+ * @member {number|Long} systemName
2836
+ * @memberof perftools.profiles.Function
2837
+ * @instance
2838
+ */
2839
+ Function.prototype.systemName = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
2840
+
2841
+ /**
2842
+ * Function filename.
2843
+ * @member {number|Long} filename
2844
+ * @memberof perftools.profiles.Function
2845
+ * @instance
2846
+ */
2847
+ Function.prototype.filename = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
2848
+
2849
+ /**
2850
+ * Function startLine.
2851
+ * @member {number|Long} startLine
2852
+ * @memberof perftools.profiles.Function
2853
+ * @instance
2854
+ */
2855
+ Function.prototype.startLine = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
2856
+
2857
+ /**
2858
+ * Creates a new Function instance using the specified properties.
2859
+ * @function create
2860
+ * @memberof perftools.profiles.Function
2861
+ * @static
2862
+ * @param {perftools.profiles.IFunction=} [properties] Properties to set
2863
+ * @returns {perftools.profiles.Function} Function instance
2864
+ */
2865
+ Function.create = function create(properties) {
2866
+ return new Function(properties);
2867
+ };
2868
+
2869
+ /**
2870
+ * Encodes the specified Function message. Does not implicitly {@link perftools.profiles.Function.verify|verify} messages.
2871
+ * @function encode
2872
+ * @memberof perftools.profiles.Function
2873
+ * @static
2874
+ * @param {perftools.profiles.IFunction} message Function message or plain object to encode
2875
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2876
+ * @returns {$protobuf.Writer} Writer
2877
+ */
2878
+ Function.encode = function encode(message, writer) {
2879
+ if (!writer)
2880
+ writer = $Writer.create();
2881
+ if (message.id != null && Object.hasOwnProperty.call(message, "id"))
2882
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.id);
2883
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
2884
+ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.name);
2885
+ if (message.systemName != null && Object.hasOwnProperty.call(message, "systemName"))
2886
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.systemName);
2887
+ if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
2888
+ writer.uint32(/* id 4, wireType 0 =*/32).int64(message.filename);
2889
+ if (message.startLine != null && Object.hasOwnProperty.call(message, "startLine"))
2890
+ writer.uint32(/* id 5, wireType 0 =*/40).int64(message.startLine);
2891
+ return writer;
2892
+ };
2893
+
2894
+ /**
2895
+ * Encodes the specified Function message, length delimited. Does not implicitly {@link perftools.profiles.Function.verify|verify} messages.
2896
+ * @function encodeDelimited
2897
+ * @memberof perftools.profiles.Function
2898
+ * @static
2899
+ * @param {perftools.profiles.IFunction} message Function message or plain object to encode
2900
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2901
+ * @returns {$protobuf.Writer} Writer
2902
+ */
2903
+ Function.encodeDelimited = function encodeDelimited(message, writer) {
2904
+ return this.encode(message, writer).ldelim();
2905
+ };
2906
+
2907
+ /**
2908
+ * Decodes a Function message from the specified reader or buffer.
2909
+ * @function decode
2910
+ * @memberof perftools.profiles.Function
2911
+ * @static
2912
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2913
+ * @param {number} [length] Message length if known beforehand
2914
+ * @returns {perftools.profiles.Function} Function
2915
+ * @throws {Error} If the payload is not a reader or valid buffer
2916
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2917
+ */
2918
+ Function.decode = function decode(reader, length) {
2919
+ if (!(reader instanceof $Reader))
2920
+ reader = $Reader.create(reader);
2921
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.perftools.profiles.Function();
2922
+ while (reader.pos < end) {
2923
+ var tag = reader.uint32();
2924
+ switch (tag >>> 3) {
2925
+ case 1: {
2926
+ message.id = reader.uint64();
2927
+ break;
2928
+ }
2929
+ case 2: {
2930
+ message.name = reader.int64();
2931
+ break;
2932
+ }
2933
+ case 3: {
2934
+ message.systemName = reader.int64();
2935
+ break;
2936
+ }
2937
+ case 4: {
2938
+ message.filename = reader.int64();
2939
+ break;
2940
+ }
2941
+ case 5: {
2942
+ message.startLine = reader.int64();
2943
+ break;
2944
+ }
2945
+ default:
2946
+ reader.skipType(tag & 7);
2947
+ break;
2948
+ }
2949
+ }
2950
+ return message;
2951
+ };
2952
+
2953
+ /**
2954
+ * Decodes a Function message from the specified reader or buffer, length delimited.
2955
+ * @function decodeDelimited
2956
+ * @memberof perftools.profiles.Function
2957
+ * @static
2958
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2959
+ * @returns {perftools.profiles.Function} Function
2960
+ * @throws {Error} If the payload is not a reader or valid buffer
2961
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2962
+ */
2963
+ Function.decodeDelimited = function decodeDelimited(reader) {
2964
+ if (!(reader instanceof $Reader))
2965
+ reader = new $Reader(reader);
2966
+ return this.decode(reader, reader.uint32());
2967
+ };
2968
+
2969
+ /**
2970
+ * Verifies a Function message.
2971
+ * @function verify
2972
+ * @memberof perftools.profiles.Function
2973
+ * @static
2974
+ * @param {Object.<string,*>} message Plain object to verify
2975
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2976
+ */
2977
+ Function.verify = function verify(message) {
2978
+ if (typeof message !== "object" || message === null)
2979
+ return "object expected";
2980
+ if (message.id != null && message.hasOwnProperty("id"))
2981
+ if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
2982
+ return "id: integer|Long expected";
2983
+ if (message.name != null && message.hasOwnProperty("name"))
2984
+ if (!$util.isInteger(message.name) && !(message.name && $util.isInteger(message.name.low) && $util.isInteger(message.name.high)))
2985
+ return "name: integer|Long expected";
2986
+ if (message.systemName != null && message.hasOwnProperty("systemName"))
2987
+ if (!$util.isInteger(message.systemName) && !(message.systemName && $util.isInteger(message.systemName.low) && $util.isInteger(message.systemName.high)))
2988
+ return "systemName: integer|Long expected";
2989
+ if (message.filename != null && message.hasOwnProperty("filename"))
2990
+ if (!$util.isInteger(message.filename) && !(message.filename && $util.isInteger(message.filename.low) && $util.isInteger(message.filename.high)))
2991
+ return "filename: integer|Long expected";
2992
+ if (message.startLine != null && message.hasOwnProperty("startLine"))
2993
+ if (!$util.isInteger(message.startLine) && !(message.startLine && $util.isInteger(message.startLine.low) && $util.isInteger(message.startLine.high)))
2994
+ return "startLine: integer|Long expected";
2995
+ return null;
2996
+ };
2997
+
2998
+ /**
2999
+ * Creates a Function message from a plain object. Also converts values to their respective internal types.
3000
+ * @function fromObject
3001
+ * @memberof perftools.profiles.Function
3002
+ * @static
3003
+ * @param {Object.<string,*>} object Plain object
3004
+ * @returns {perftools.profiles.Function} Function
3005
+ */
3006
+ Function.fromObject = function fromObject(object) {
3007
+ if (object instanceof $root.perftools.profiles.Function)
3008
+ return object;
3009
+ var message = new $root.perftools.profiles.Function();
3010
+ if (object.id != null)
3011
+ if ($util.Long)
3012
+ (message.id = $util.Long.fromValue(object.id)).unsigned = true;
3013
+ else if (typeof object.id === "string")
3014
+ message.id = parseInt(object.id, 10);
3015
+ else if (typeof object.id === "number")
3016
+ message.id = object.id;
3017
+ else if (typeof object.id === "object")
3018
+ message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true);
3019
+ if (object.name != null)
3020
+ if ($util.Long)
3021
+ (message.name = $util.Long.fromValue(object.name)).unsigned = false;
3022
+ else if (typeof object.name === "string")
3023
+ message.name = parseInt(object.name, 10);
3024
+ else if (typeof object.name === "number")
3025
+ message.name = object.name;
3026
+ else if (typeof object.name === "object")
3027
+ message.name = new $util.LongBits(object.name.low >>> 0, object.name.high >>> 0).toNumber();
3028
+ if (object.systemName != null)
3029
+ if ($util.Long)
3030
+ (message.systemName = $util.Long.fromValue(object.systemName)).unsigned = false;
3031
+ else if (typeof object.systemName === "string")
3032
+ message.systemName = parseInt(object.systemName, 10);
3033
+ else if (typeof object.systemName === "number")
3034
+ message.systemName = object.systemName;
3035
+ else if (typeof object.systemName === "object")
3036
+ message.systemName = new $util.LongBits(object.systemName.low >>> 0, object.systemName.high >>> 0).toNumber();
3037
+ if (object.filename != null)
3038
+ if ($util.Long)
3039
+ (message.filename = $util.Long.fromValue(object.filename)).unsigned = false;
3040
+ else if (typeof object.filename === "string")
3041
+ message.filename = parseInt(object.filename, 10);
3042
+ else if (typeof object.filename === "number")
3043
+ message.filename = object.filename;
3044
+ else if (typeof object.filename === "object")
3045
+ message.filename = new $util.LongBits(object.filename.low >>> 0, object.filename.high >>> 0).toNumber();
3046
+ if (object.startLine != null)
3047
+ if ($util.Long)
3048
+ (message.startLine = $util.Long.fromValue(object.startLine)).unsigned = false;
3049
+ else if (typeof object.startLine === "string")
3050
+ message.startLine = parseInt(object.startLine, 10);
3051
+ else if (typeof object.startLine === "number")
3052
+ message.startLine = object.startLine;
3053
+ else if (typeof object.startLine === "object")
3054
+ message.startLine = new $util.LongBits(object.startLine.low >>> 0, object.startLine.high >>> 0).toNumber();
3055
+ return message;
3056
+ };
3057
+
3058
+ /**
3059
+ * Creates a plain object from a Function message. Also converts values to other types if specified.
3060
+ * @function toObject
3061
+ * @memberof perftools.profiles.Function
3062
+ * @static
3063
+ * @param {perftools.profiles.Function} message Function
3064
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
3065
+ * @returns {Object.<string,*>} Plain object
3066
+ */
3067
+ Function.toObject = function toObject(message, options) {
3068
+ if (!options)
3069
+ options = {};
3070
+ var object = {};
3071
+ if (options.defaults) {
3072
+ if ($util.Long) {
3073
+ var long = new $util.Long(0, 0, true);
3074
+ object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
3075
+ } else
3076
+ object.id = options.longs === String ? "0" : 0;
3077
+ if ($util.Long) {
3078
+ var long = new $util.Long(0, 0, false);
3079
+ object.name = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
3080
+ } else
3081
+ object.name = options.longs === String ? "0" : 0;
3082
+ if ($util.Long) {
3083
+ var long = new $util.Long(0, 0, false);
3084
+ object.systemName = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
3085
+ } else
3086
+ object.systemName = options.longs === String ? "0" : 0;
3087
+ if ($util.Long) {
3088
+ var long = new $util.Long(0, 0, false);
3089
+ object.filename = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
3090
+ } else
3091
+ object.filename = options.longs === String ? "0" : 0;
3092
+ if ($util.Long) {
3093
+ var long = new $util.Long(0, 0, false);
3094
+ object.startLine = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
3095
+ } else
3096
+ object.startLine = options.longs === String ? "0" : 0;
3097
+ }
3098
+ if (message.id != null && message.hasOwnProperty("id"))
3099
+ if (typeof message.id === "number")
3100
+ object.id = options.longs === String ? String(message.id) : message.id;
3101
+ else
3102
+ object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id;
3103
+ if (message.name != null && message.hasOwnProperty("name"))
3104
+ if (typeof message.name === "number")
3105
+ object.name = options.longs === String ? String(message.name) : message.name;
3106
+ else
3107
+ object.name = options.longs === String ? $util.Long.prototype.toString.call(message.name) : options.longs === Number ? new $util.LongBits(message.name.low >>> 0, message.name.high >>> 0).toNumber() : message.name;
3108
+ if (message.systemName != null && message.hasOwnProperty("systemName"))
3109
+ if (typeof message.systemName === "number")
3110
+ object.systemName = options.longs === String ? String(message.systemName) : message.systemName;
3111
+ else
3112
+ object.systemName = options.longs === String ? $util.Long.prototype.toString.call(message.systemName) : options.longs === Number ? new $util.LongBits(message.systemName.low >>> 0, message.systemName.high >>> 0).toNumber() : message.systemName;
3113
+ if (message.filename != null && message.hasOwnProperty("filename"))
3114
+ if (typeof message.filename === "number")
3115
+ object.filename = options.longs === String ? String(message.filename) : message.filename;
3116
+ else
3117
+ object.filename = options.longs === String ? $util.Long.prototype.toString.call(message.filename) : options.longs === Number ? new $util.LongBits(message.filename.low >>> 0, message.filename.high >>> 0).toNumber() : message.filename;
3118
+ if (message.startLine != null && message.hasOwnProperty("startLine"))
3119
+ if (typeof message.startLine === "number")
3120
+ object.startLine = options.longs === String ? String(message.startLine) : message.startLine;
3121
+ else
3122
+ object.startLine = options.longs === String ? $util.Long.prototype.toString.call(message.startLine) : options.longs === Number ? new $util.LongBits(message.startLine.low >>> 0, message.startLine.high >>> 0).toNumber() : message.startLine;
3123
+ return object;
3124
+ };
3125
+
3126
+ /**
3127
+ * Converts this Function to JSON.
3128
+ * @function toJSON
3129
+ * @memberof perftools.profiles.Function
3130
+ * @instance
3131
+ * @returns {Object.<string,*>} JSON object
3132
+ */
3133
+ Function.prototype.toJSON = function toJSON() {
3134
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3135
+ };
3136
+
3137
+ /**
3138
+ * Gets the default type url for Function
3139
+ * @function getTypeUrl
3140
+ * @memberof perftools.profiles.Function
3141
+ * @static
3142
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3143
+ * @returns {string} The default type url
3144
+ */
3145
+ Function.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3146
+ if (typeUrlPrefix === undefined) {
3147
+ typeUrlPrefix = "type.googleapis.com";
3148
+ }
3149
+ return typeUrlPrefix + "/perftools.profiles.Function";
3150
+ };
3151
+
3152
+ return Function;
3153
+ })();
3154
+
3155
+ return profiles;
3156
+ })();
3157
+
3158
+ return perftools;
3159
+ })();
3160
+
3161
+ module.exports = $root;