@@ -303,7 +303,7 @@ func (b *dataBuffer) logExemplars(description string, se pmetric.ExemplarSlice)
303
303
}
304
304
}
305
305
306
- func (b * dataBuffer ) logProfileSamples (ss pprofile.SampleSlice ) {
306
+ func (b * dataBuffer ) logProfileSamples (ss pprofile.SampleSlice , attrs pprofile. AttributeTableSlice ) {
307
307
if ss .Len () == 0 {
308
308
return
309
309
}
@@ -312,21 +312,16 @@ func (b *dataBuffer) logProfileSamples(ss pprofile.SampleSlice) {
312
312
b .logEntry (" Sample #%d" , i )
313
313
sample := ss .At (i )
314
314
315
- b .logEntry (" Location index: %d" , sample .LocationIndex ().AsRaw ())
316
315
b .logEntry (" Location length: %d" , sample .LocationsLength ())
317
- b .logEntry (" Stacktrace ID index: %d" , sample .StacktraceIdIndex ())
318
- if lb := sample .Label ().Len (); lb > 0 {
319
- for j := 0 ; j < lb ; j ++ {
320
- b .logEntry (" Label #%d" , j )
321
- b .logEntry (" -> Key: %d" , sample .Label ().At (j ).Key ())
322
- b .logEntry (" -> Str: %d" , sample .Label ().At (j ).Str ())
323
- b .logEntry (" -> Num: %d" , sample .Label ().At (j ).Num ())
324
- b .logEntry (" -> Num unit: %d" , sample .Label ().At (j ).NumUnit ())
316
+ b .logEntry (" Value: %d" , sample .Value ().AsRaw ())
317
+
318
+ if lai := sample .AttributeIndices ().Len (); lai > 0 {
319
+ b .logEntry (" Attributes:" )
320
+ for j := 0 ; j < lai ; j ++ {
321
+ attr := attrs .At (int (sample .AttributeIndices ().At (j )))
322
+ b .logEntry (" -> %s: %s" , attr .Key (), attr .Value ().AsRaw ())
325
323
}
326
324
}
327
- b .logEntry (" Value: %d" , sample .Value ().AsRaw ())
328
- b .logEntry (" Attributes: %d" , sample .Attributes ().AsRaw ())
329
- b .logEntry (" Link: %d" , sample .Link ())
330
325
}
331
326
}
332
327
@@ -339,13 +334,11 @@ func (b *dataBuffer) logProfileMappings(ms pprofile.MappingSlice) {
339
334
b .logEntry (" Mapping #%d" , i )
340
335
mapping := ms .At (i )
341
336
342
- b .logEntry (" ID: %d" , mapping .ID ())
343
337
b .logEntry (" Memory start: %d" , mapping .MemoryStart ())
344
338
b .logEntry (" Memory limit: %d" , mapping .MemoryLimit ())
345
339
b .logEntry (" File offset: %d" , mapping .FileOffset ())
346
- b .logEntry (" File name: %d" , mapping .Filename ())
347
- b .logEntry (" Build ID: %d" , mapping .BuildID ())
348
- b .logEntry (" Attributes: %d" , mapping .Attributes ().AsRaw ())
340
+ b .logEntry (" File name: %d" , mapping .FilenameStrindex ())
341
+ b .logEntry (" Attributes: %d" , mapping .AttributeIndices ().AsRaw ())
349
342
b .logEntry (" Has functions: %t" , mapping .HasFunctions ())
350
343
b .logEntry (" Has filenames: %t" , mapping .HasFilenames ())
351
344
b .logEntry (" Has line numbers: %t" , mapping .HasLineNumbers ())
@@ -362,7 +355,6 @@ func (b *dataBuffer) logProfileLocations(ls pprofile.LocationSlice) {
362
355
b .logEntry (" Location #%d" , i )
363
356
location := ls .At (i )
364
357
365
- b .logEntry (" ID: %d" , location .ID ())
366
358
b .logEntry (" Mapping index: %d" , location .MappingIndex ())
367
359
b .logEntry (" Address: %d" , location .Address ())
368
360
if ll := location .Line ().Len (); ll > 0 {
@@ -375,8 +367,7 @@ func (b *dataBuffer) logProfileLocations(ls pprofile.LocationSlice) {
375
367
}
376
368
}
377
369
b .logEntry (" Is folded: %t" , location .IsFolded ())
378
- b .logEntry (" Type index: %d" , location .TypeIndex ())
379
- b .logEntry (" Attributes: %d" , location .Attributes ().AsRaw ())
370
+ b .logEntry (" Attributes: %d" , location .AttributeIndices ().AsRaw ())
380
371
}
381
372
}
382
373
@@ -389,10 +380,9 @@ func (b *dataBuffer) logProfileFunctions(fs pprofile.FunctionSlice) {
389
380
b .logEntry (" Function #%d" , i )
390
381
function := fs .At (i )
391
382
392
- b .logEntry (" ID: %d" , function .ID ())
393
- b .logEntry (" Name: %d" , function .Name ())
394
- b .logEntry (" System name: %d" , function .SystemName ())
395
- b .logEntry (" Filename: %d" , function .Filename ())
383
+ b .logEntry (" Name: %d" , function .NameStrindex ())
384
+ b .logEntry (" System name: %d" , function .SystemNameStrindex ())
385
+ b .logEntry (" Filename: %d" , function .FilenameStrindex ())
396
386
b .logEntry (" Start line: %d" , function .StartLine ())
397
387
}
398
388
}
@@ -408,7 +398,7 @@ func (b *dataBuffer) logStringTable(ss pcommon.StringSlice) {
408
398
}
409
399
}
410
400
411
- func (b * dataBuffer ) logComment (c pcommon.Int64Slice ) {
401
+ func (b * dataBuffer ) logComment (c pcommon.Int32Slice ) {
412
402
if c .Len () == 0 {
413
403
return
414
404
}
@@ -423,8 +413,8 @@ func attributeUnitsToMap(aus pprofile.AttributeUnitSlice) pcommon.Map {
423
413
m := pcommon .NewMap ()
424
414
for i := 0 ; i < aus .Len (); i ++ {
425
415
au := aus .At (i )
426
- m .PutInt ("attributeKey" , au .AttributeKey ( ))
427
- m .PutInt ("unit" , au .Unit ( ))
416
+ m .PutInt ("attributeKey" , int64 ( au .AttributeKeyStrindex () ))
417
+ m .PutInt ("unit" , int64 ( au .UnitStrindex () ))
428
418
}
429
419
return m
430
420
}
0 commit comments