mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2024-12-10 09:50:58 +02:00
fix b3 propagation benchmark to include iterations. (#212)
also include byte allocation report. rename file to match http_trace_context propagator.
This commit is contained in:
parent
388d3248fe
commit
7e5fc4e6aa
@ -62,9 +62,11 @@ func BenchmarkExtractB3(b *testing.B) {
|
||||
for h, v := range tt.headers {
|
||||
req.Header.Set(h, v)
|
||||
}
|
||||
|
||||
b.ReportAllocs()
|
||||
b.ResetTimer()
|
||||
_ = propagator.Extract(ctx, req.Header)
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = propagator.Extract(ctx, req.Header)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -107,9 +109,11 @@ func BenchmarkInjectB3(b *testing.B) {
|
||||
} else {
|
||||
ctx, _ = mockTracer.Start(ctx, "inject")
|
||||
}
|
||||
|
||||
b.ReportAllocs()
|
||||
b.ResetTimer()
|
||||
propagator.Inject(ctx, req.Header)
|
||||
for i := 0; i < b.N; i++ {
|
||||
propagator.Inject(ctx, req.Header)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user