MCPcopy
hub / github.com/CodisLabs/codis / incrOpStats

Function incrOpStats

pkg/proxy/stats.go:156–168  ·  view source on GitHub ↗
(e *opStats)

Source from the content-addressed store, hash-verified

154}
155
156func incrOpStats(e *opStats) {
157 s := getOpStats(e.opstr, true)
158 s.calls.Add(e.calls.Swap(0))
159 s.nsecs.Add(e.nsecs.Swap(0))
160 if n := e.fails.Swap(0); n != 0 {
161 s.fails.Add(n)
162 cmdstats.fails.Add(n)
163 }
164 if n := e.redis.errors.Swap(0); n != 0 {
165 s.redis.errors.Add(n)
166 cmdstats.redis.errors.Add(n)
167 }
168}
169
170var sessions struct {
171 total atomic2.Int64

Callers 1

flushOpStatsMethod · 0.85

Calls 3

getOpStatsFunction · 0.85
AddMethod · 0.45
SwapMethod · 0.45

Tested by

no test coverage detected