(b *testing.B)
| 28 | ) |
| 29 | |
| 30 | func BenchmarkZapConsole(b *testing.B) { |
| 31 | b.RunParallel(func(pb *testing.PB) { |
| 32 | for pb.Next() { |
| 33 | enc := NewConsoleEncoder(humanEncoderConfig()) |
| 34 | enc.AddString("str", "foo") |
| 35 | enc.AddInt64("int64-1", 1) |
| 36 | enc.AddInt64("int64-2", 2) |
| 37 | enc.AddFloat64("float64", 1.0) |
| 38 | enc.AddString("string1", "\n") |
| 39 | enc.AddString("string2", "💩") |
| 40 | enc.AddString("string3", "🤔") |
| 41 | enc.AddString("string4", "🙊") |
| 42 | enc.AddBool("bool", true) |
| 43 | buf, _ := enc.EncodeEntry(Entry{ |
| 44 | Message: "fake", |
| 45 | Level: DebugLevel, |
| 46 | }, nil) |
| 47 | buf.Free() |
| 48 | } |
| 49 | }) |
| 50 | } |
nothing calls this directly
no test coverage detected