Выпуск WDTT Plus v11
This commit is contained in:
1 parent
a842c6965e
commit
b3aad32990
25 files changed
+1722
-146
No files matched your search
+6
-6
@@ -9,9 +9,9 @@ import (
|
||||
var globalActiveConnections atomic.Int32
|
||||
|
||||
type Stats struct {
|
||||
ActiveConnections int32
|
||||
TotalBytesUp int64
|
||||
TotalBytesDown int64
|
||||
ActiveConnections atomic.Int32
|
||||
TotalBytesUp atomic.Int64
|
||||
TotalBytesDown atomic.Int64
|
||||
}
|
||||
|
||||
func NewStats() *Stats {
|
||||
@@ -27,9 +27,9 @@ func (s *Stats) RunLoop(shutdown <-chan struct{}) {
|
||||
case <-shutdown:
|
||||
return
|
||||
case <-ticker.C:
|
||||
active := atomic.LoadInt32(&s.ActiveConnections)
|
||||
up := atomic.LoadInt64(&s.TotalBytesUp)
|
||||
down := atomic.LoadInt64(&s.TotalBytesDown)
|
||||
active := s.ActiveConnections.Load()
|
||||
up := s.TotalBytesUp.Load()
|
||||
down := s.TotalBytesDown.Load()
|
||||
upMB := float64(up) / (1024.0 * 1024.0)
|
||||
downMB := float64(down) / (1024.0 * 1024.0)
|
||||
|
||||
|
||||
Reference in new issue
Block a user