1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00
This commit is contained in:
2023-08-25 15:31:00 +08:00
parent 04aecd4abc
commit b0a97978d8
58 changed files with 1330 additions and 476 deletions

6
cache/qps.go vendored
View File

@ -31,7 +31,9 @@ func (q *qps) statisticsTotal() {
}
}()
ticker := time.NewTicker(time.Second)
ticker := time.NewTicker(time.Minute)
defer ticker.Stop()
for range ticker.C {
q.all.viewTotal = atomic.SwapInt64(&q.all.total, 0)
q.memoryTotal.viewTotal = atomic.SwapInt64(&q.memoryTotal.total, 0)
@ -39,5 +41,7 @@ func (q *qps) statisticsTotal() {
q.redisTotal.viewTotal = atomic.SwapInt64(&q.redisTotal.total, 0)
q.redisHit.viewTotal = atomic.SwapInt64(&q.redisHit.total, 0)
q.sourceTotal.viewTotal = atomic.SwapInt64(&q.sourceTotal.total, 0)
// percnt := 0
}
}