MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TotalItems

Method TotalItems

internal/utils/counters/counter.go:135–145  ·  view source on GitHub ↗

TotalItems get items count

()

Source from the content-addressed store, hash-verified

133
134// TotalItems get items count
135func (this *Counter[T]) TotalItems() int {
136 var total = 0
137
138 for i := 0; i < int(this.countMaps); i++ {
139 this.locker.RLock(i)
140 total += len(this.itemMaps[i])
141 this.locker.RUnlock(i)
142 }
143
144 return total
145}
146
147// GC garbage expired items
148func (this *Counter[T]) GC() {

Callers 2

TestCounter_GC2Function · 0.80
TestCounterMemoryFunction · 0.80

Calls 2

RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by 2

TestCounter_GC2Function · 0.64
TestCounterMemoryFunction · 0.64