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

Method Len

internal/stats/user_agent_parser.go:118–126  ·  view source on GitHub ↗

Len 读取当前缓存数量

()

Source from the content-addressed store, hash-verified

116
117// Len 读取当前缓存数量
118func (this *UserAgentParser) Len() int {
119 var total = 0
120 for i := 0; i < userAgentShardingCount; i++ {
121 this.mu.RLock(i)
122 total += len(this.cacheMaps[i])
123 this.mu.RUnlock(i)
124 }
125 return total
126}
127
128// GC 回收多余的缓存
129func (this *UserAgentParser) GC() {

Calls 2

RLockMethod · 0.80
RUnlockMethod · 0.80