@google-cloud/profiler 5.0.4 → 6.0.0

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