MCPcopy Index your code
hub / github.com/coder/coder / Count

Method Count

coderd/files/cache.go:283–288  ·  view source on GitHub ↗

Count returns the number of files currently in the cache. Mainly used for unit testing assertions.

()

Source from the content-addressed store, hash-verified

281// Count returns the number of files currently in the cache.
282// Mainly used for unit testing assertions.
283func (c *Cache) Count() int {
284 c.lock.Lock()
285 defer c.lock.Unlock()
286
287 return len(c.data)
288}
289
290func fetch(store database.Store, fileID uuid.UUID) (CacheEntryValue, error) {
291 // Because many callers can be waiting on the same file fetch concurrently, we

Callers 15

setupDynamicParamsTestFunction · 0.80
TestConcurrentFetchFunction · 0.80
TestCacheRBACFunction · 0.80
TestConcurrencyFunction · 0.80
TestReleaseFunction · 0.80
CompileHostnamePatternFunction · 0.80
TestConstantQueryParamsFunction · 0.80
NormalizeWorkspaceInputFunction · 0.80
TestExpTaskDeleteFunction · 0.80

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by 14

setupDynamicParamsTestFunction · 0.64
TestConcurrentFetchFunction · 0.64
TestCacheRBACFunction · 0.64
TestConcurrencyFunction · 0.64
TestReleaseFunction · 0.64
TestConstantQueryParamsFunction · 0.64
TestExpTaskDeleteFunction · 0.64
TestAgentMetadata_TimingFunction · 0.64