MCPcopy
hub / github.com/uber-go/zap / TestSamplerDisabledLevels

Function TestSamplerDisabledLevels

zapcore/sampler_test.go:105–112  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func TestSamplerDisabledLevels(t *testing.T) {
106 sampler, logs := fakeSampler(InfoLevel, time.Minute, 1, 100)
107
108 // Shouldn't be counted, because debug logging isn't enabled.
109 writeSequence(sampler, 1, DebugLevel)
110 writeSequence(sampler, 2, InfoLevel)
111 assertSequence(t, logs.TakeAll(), InfoLevel, 2)
112}
113
114func TestSamplerTicking(t *testing.T) {
115 // Ensure that we're resetting the sampler's counter every tick.

Callers

nothing calls this directly

Calls 4

fakeSamplerFunction · 0.85
writeSequenceFunction · 0.85
assertSequenceFunction · 0.85
TakeAllMethod · 0.80

Tested by

no test coverage detected