Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Batch Processor benchmark to really test OnEnd (open-telemet…
…ry#5600) This benchmark was not only testing the batch processor, since it was starting a span, and ending it. So the entire process of recording span was being accounted. This changes the benchmark to only account for the batch processor being tested, not the entire stack. Before: ``` pkg: go.opentelemetry.io/otel/sdk/trace BenchmarkSpanProcessor-10 137320 8696 ns/op 11184 B/op 155 allocs/op BenchmarkSpanProcessorVerboseLogging-10 135483 8881 ns/op 11184 B/op 155 allocs/op PASS ok go.opentelemetry.io/otel/sdk/trace 3.984s ``` After: ``` pkg: go.opentelemetry.io/otel/sdk/trace BenchmarkSpanProcessorOnEnd/batch:_10,_spans:_10-10 6055572 173.2 ns/op 0 B/op 0 allocs/op BenchmarkSpanProcessorOnEnd/batch:_10,_spans:_100-10 684236 1733 ns/op 0 B/op 0 allocs/op BenchmarkSpanProcessorOnEnd/batch:_100,_spans:_10-10 6930391 173.8 ns/op 0 B/op 0 allocs/op BenchmarkSpanProcessorOnEnd/batch:_100,_spans:_100-10 677128 1731 ns/op 0 B/op 0 allocs/op BenchmarkSpanProcessorVerboseLogging-10 128823 9318 ns/op 11184 B/op 155 allocs/op PASS ok go.opentelemetry.io/otel/sdk/trace 6.763s ``` I haven't touched the verbose logging benchmark, as I suppose a benchmark with verbose logging could actually benefit from the entire stack. I also feel one benchmark testing the entire stack up to there could be nice.
- Loading branch information