@@ -20,7 +20,6 @@ import (
2020 "go.opentelemetry.io/collector/config/configopaque"
2121 "go.opentelemetry.io/collector/config/configtls"
2222 "go.opentelemetry.io/collector/exporter/exportertest"
23- "go.opentelemetry.io/collector/pdata/pcommon"
2423 "go.opentelemetry.io/collector/pdata/pprofile"
2524 "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp"
2625 "go.uber.org/zap"
@@ -305,7 +304,7 @@ func BenchmarkProfilesExporter_PushProfiles(b *testing.B) {
305304 var id [16 ]byte
306305 binary .LittleEndian .PutUint64 (id [:8 ], uint64 (j ))
307306 profile .SetProfileID (id )
308- profile .SetDuration (1000000000 ) // 1 second in nanoseconds
307+ profile .SetDurationNano (1000000000 ) // 1 second in nanoseconds
309308 }
310309 _ = exp .pushProfiles (b .Context (), profiles )
311310 }
@@ -428,7 +427,7 @@ func TestProfilesExporter_PushProfiles_Performance(t *testing.T) {
428427 var id [16 ]byte
429428 binary .LittleEndian .PutUint64 (id [:8 ], uint64 (i ))
430429 profile .SetProfileID (id )
431- profile .SetDuration ( pcommon . NewTimestampFromTime ( time . Now (). Add ( time . Second )) )
430+ profile .SetDurationNano ( 1000000000 )
432431 }
433432
434433 start := time .Now ()
@@ -458,7 +457,7 @@ func TestProfilesExporter_PushProfiles_Performance(t *testing.T) {
458457 var id [16 ]byte
459458 binary .LittleEndian .PutUint64 (id [:8 ], uint64 (i ))
460459 profile .SetProfileID (id )
461- profile .SetDuration ( pcommon . NewTimestampFromTime ( time . Now (). Add ( time . Second )) )
460+ profile .SetDurationNano ( 1000000000 )
462461 }
463462
464463 start := time .Now ()
@@ -503,7 +502,7 @@ func TestProfilesExporter_PushProfiles_Performance(t *testing.T) {
503502 var id [16 ]byte
504503 binary .LittleEndian .PutUint64 (id [:8 ], uint64 (i ))
505504 profile .SetProfileID (id )
506- profile .SetDuration ( pcommon . NewTimestampFromTime ( time . Now (). Add ( time . Second )) )
505+ profile .SetDurationNano ( 1000000000 )
507506 }
508507
509508 start := time .Now ()
@@ -559,7 +558,7 @@ func TestProfilesExporter_RateLimitErrorCountReset(t *testing.T) {
559558 var id [16 ]byte
560559 binary .LittleEndian .PutUint64 (id [:8 ], uint64 (1 ))
561560 profile .SetProfileID (id )
562- profile .SetDuration ( pcommon . NewTimestampFromTime ( time . Now (). Add ( time . Second )) )
561+ profile .SetDurationNano ( 1000000000 )
563562
564563 err = exp .pushProfiles (t .Context (), profiles )
565564 assert .Error (t , err )
@@ -613,7 +612,7 @@ func TestProfilesExporter_RateLimitCounterResetOnSuccess(t *testing.T) {
613612 var id [16 ]byte
614613 binary .LittleEndian .PutUint64 (id [:8 ], uint64 (1 ))
615614 profile .SetProfileID (id )
616- profile .SetDuration ( pcommon . NewTimestampFromTime ( time . Now (). Add ( time . Second )) )
615+ profile .SetDurationNano ( 1000000000 )
617616 return profiles
618617 }
619618
0 commit comments