1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-10-08 23:21:56 +02:00

Removed benchmark that doesn't test anything anymore

This commit is contained in:
Aaron Clawson
2021-11-29 17:09:56 +00:00
committed by GitHub
parent 3090ceacdc
commit cbf8bad66c

View File

@@ -183,7 +183,6 @@ func BenchmarkGetDelegatedErrorHandler(b *testing.B) {
eh = GetErrorHandler()
}
b.StopTimer()
reset()
}
@@ -201,7 +200,6 @@ func BenchmarkDefaultErrorHandlerHandle(b *testing.B) {
eh.Handle(err)
}
b.StopTimer()
reset()
}
@@ -216,7 +214,6 @@ func BenchmarkDelegatedErrorHandlerHandle(b *testing.B) {
eh.Handle(err)
}
b.StopTimer()
reset()
}
@@ -232,25 +229,6 @@ func BenchmarkSetErrorHandlerDelegation(b *testing.B) {
}
}
func BenchmarkSetErrorHandlerNoDelegation(b *testing.B) {
eh := []ErrorHandler{
&errLogger{l: log.New(ioutil.Discard, "", 0)},
&errLogger{l: log.New(ioutil.Discard, "", 0)},
}
mod := len(eh)
// Do not measure delegation.
SetErrorHandler(eh[1])
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
SetErrorHandler(eh[i%mod])
}
b.StopTimer()
reset()
}
func reset() {
globalErrorHandler = defaultErrorHandler()
}