MCPcopy
hub / github.com/op/go-logging / RunLogBenchmark

Function RunLogBenchmark

log_test.go:133–141  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

131}
132
133func RunLogBenchmark(b *testing.B) {
134 password := Password("foo")
135 log := MustGetLogger("test")
136
137 b.ResetTimer()
138 for i := 0; i < b.N; i++ {
139 log.Debug("log line for %d and this is rectified: %s", i, password)
140 }
141}
142
143func BenchmarkLogFixed(b *testing.B) {
144 backend := SetBackend(NewLogBackend(ioutil.Discard, "", 0))

Calls 3

MustGetLoggerFunction · 0.85
DebugMethod · 0.80
PasswordTypeAlias · 0.70

Tested by

no test coverage detected