MCPcopy
hub / github.com/kubernetes/client-go / BenchmarkReflectorResyncChanMany

Function BenchmarkReflectorResyncChanMany

tools/cache/reflector_test.go:115–125  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

113}
114
115func BenchmarkReflectorResyncChanMany(b *testing.B) {
116 s := NewStore(MetaNamespaceKeyFunc)
117 g := NewReflector(&testLW{}, &v1.Pod{}, s, 25*time.Millisecond)
118 // The improvement to this (calling the timer's Stop() method) makes
119 // this benchmark about 40% faster.
120 for i := 0; i < b.N; i++ {
121 g.resyncPeriod = time.Duration(rand.Float64() * float64(time.Millisecond) * 25)
122 _, stop := g.resyncChan()
123 stop()
124 }
125}
126
127func TestReflectorWatchHandlerError(t *testing.T) {
128 s := NewStore(MetaNamespaceKeyFunc)

Callers

nothing calls this directly

Calls 3

resyncChanMethod · 0.95
NewStoreFunction · 0.85
NewReflectorFunction · 0.85

Tested by

no test coverage detected