TotalItems get items count
()
| 133 | |
| 134 | // TotalItems get items count |
| 135 | func (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 |
| 148 | func (this *Counter[T]) GC() { |