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

Method GetCacheSize

internal/resolver/resolver.go:143–147  ·  view source on GitHub ↗

GetCacheSize returns the number of cached entries

()

Source from the content-addressed store, hash-verified

141
142// GetCacheSize returns the number of cached entries
143func (r *Resolver) GetCacheSize() int {
144 r.mutex.RLock()
145 defer r.mutex.RUnlock()
146 return len(r.cache)
147}
148
149// getServiceName returns well-known service names for common ports
150func getServiceName(port int, proto string) string {

Callers 11

BenchmarkGetCacheSizeFunction · 0.80
TestResolveAddr_CachingFunction · 0.80
TestResolvePort_CachingFunction · 0.80
TestClearCacheFunction · 0.80
TestGetCacheSizeFunction · 0.80
TestResolveAddrsParallelFunction · 0.80
TestConcurrentAccessFunction · 0.80

Calls

no outgoing calls

Tested by 11

BenchmarkGetCacheSizeFunction · 0.64
TestResolveAddr_CachingFunction · 0.64
TestResolvePort_CachingFunction · 0.64
TestClearCacheFunction · 0.64
TestGetCacheSizeFunction · 0.64
TestResolveAddrsParallelFunction · 0.64
TestConcurrentAccessFunction · 0.64