8000 fix concurrent access to logs · nginx/agent@1fa281f · GitHub
[go: up one dir, main page]

Skip to content

Commit 1fa281f

Browse files
committed
fix concurrent access to logs
1 parent 60046f8 commit 1fa281f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/collector/logsgzipprocessor/processor_benchmark_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ func BenchmarkGzipProcessor_Concurrent(b *testing.B) {
8383
b.ResetTimer()
8484
b.RunParallel(func(pb *testing.PB) {
8585
for pb.Next() {
86-
_ = p.ConsumeLogs(context.Background(), logs)
86+
logsCopy := plog.NewLogs()
87+
logs.CopyTo(logsCopy)
88+
_ = p.ConsumeLogs(context.Background(), logsCopy)
8789
}
8890
})
8991
}

0 commit comments

Comments
 (0)
0