[#15] Fix partial encoder bench

'benchmarkLog' and 'benchmarkEncoder'
are pretty much the same, but it can
be changed later.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
Alexey Vanin 2024-01-24 14:42:13 +03:00
parent 045b966ecb
commit cb2e66427d

View file

@ -24,7 +24,7 @@ func BenchmarkEncoder(b *testing.B) {
SyslogPid(), SyslogPid(),
}) })
l := zap.New(coreWithContext) l := zap.New(coreWithContext)
benchmarkLog(b, l) benchmarkEncoder(b, l)
}) })
b.Run("partial", func(b *testing.B) { b.Run("partial", func(b *testing.B) {
encoder := NewPartialEncoder(zapcore.NewConsoleEncoder(zc.EncoderConfig), SyslogFields) encoder := NewPartialEncoder(zapcore.NewConsoleEncoder(zc.EncoderConfig), SyslogFields)
@ -37,7 +37,7 @@ func BenchmarkEncoder(b *testing.B) {
SyslogPid(), SyslogPid(),
}) })
l := zap.New(coreWithContext) l := zap.New(coreWithContext)
benchmarkLog(b, l) benchmarkEncoder(b, l)
}) })
} }