Skip to content

Commit

Permalink
fix b3 propagation benchmark to include iterations. (#212)
Browse files Browse the repository at this point in the history
also include byte allocation report.
 rename file to match http_trace_context propagator.
  • Loading branch information
rghetia authored Oct 15, 2019
1 parent 388d324 commit 7e5fc4e
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}
}
Expand Down Expand Up @@ -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)
}
})
}
}
Expand Down

0 comments on commit 7e5fc4e

Please sign in to comment.