MCPcopy
hub / github.com/karol-broda/snitch / BenchmarkGetCacheSize

Function BenchmarkGetCacheSize

internal/resolver/resolver_bench_test.go:133–145  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

131}
132
133func BenchmarkGetCacheSize(b *testing.B) {
134 r := New(100 * time.Millisecond)
135
136 // populate with some entries
137 for i := 0; i < 100; i++ {
138 r.ResolvePort(i+1, "tcp")
139 }
140
141 b.ResetTimer()
142 for i := 0; i < b.N; i++ {
143 r.GetCacheSize()
144 }
145}
146
147func BenchmarkClearCache(b *testing.B) {
148 r := New(100 * time.Millisecond)

Callers

nothing calls this directly

Calls 3

ResolvePortMethod · 0.80
GetCacheSizeMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected