Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exporter/elasticsearchexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func TestExporterLogs(t *testing.T) {
body := pcommon.NewValueMap()
m := body.Map()
s := m.PutEmptySlice("a")
for i := 0; i < 2; i++ {
for i := range 2 {
s.AppendEmpty().SetInt(int64(i))
}
return body
Expand Down Expand Up @@ -826,7 +826,7 @@ func TestExporterLogs(t *testing.T) {
cfg.Retry.InitialInterval = 1 * time.Millisecond
cfg.Retry.MaxInterval = 10 * time.Millisecond
})
for i := 0; i < 3; i++ {
for i := range 3 {
logRecord := plog.NewLogRecord()
logRecord.Attributes().PutInt("idx", int64(i))
mustSendLogRecords(t, exporter, logRecord)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func BenchmarkLRUSetCheck(b *testing.B) {
_ = cache.WithLock(func(lock LockedLRUSet) error {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
for b.Loop() {
lock.CheckAndAdd("a")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,8 @@ func BenchmarkSerializeProfile(b *testing.B) {
}

b.ReportAllocs()
b.ResetTimer()

for i := 0; i < b.N; i++ {
for b.Loop() {
_ = ser.SerializeProfile(profiles.Dictionary(), resource.Resource(), scope.Scope(), profile, pushData)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func BenchmarkTransform(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()

for i := 0; i < b.N; i++ {
for b.Loop() {
_, _ = Transform(dic, rp.Resource(), sp.Scope(), p)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func newUnixTime64(t uint64) unixTime64 {
func (t unixTime64) MarshalJSON() ([]byte, error) {
// Nanoseconds, ES does not support 'epoch_nanoseconds' so
// we have to pass it a value formatted as 'strict_date_optional_time_nanos'.
out := []byte(fmt.Sprintf("%q",
time.Unix(0, int64(t)).UTC().Format(time.RFC3339Nano)))
out := fmt.Appendf(nil, "%q",
time.Unix(0, int64(t)).UTC().Format(time.RFC3339Nano))
return out, nil
}

Expand Down
2 changes: 1 addition & 1 deletion exporter/elasticsearchexporter/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func TestEncodeSpan_Events(t *testing.T) {
t.Parallel()

span := ptrace.NewSpan()
for i := 0; i < 4; i++ {
for i := range 4 {
event := span.Events().AppendEmpty()
event.SetName(fmt.Sprintf("event_%d", i))
}
Expand Down
4 changes: 2 additions & 2 deletions exporter/elasticsearchexporter/partitioner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func BenchmarkGetKey(b *testing.B) {
})

b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {

for b.Loop() {
_ = p.GetKey(ctx, nil)
}
}
Loading