]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/stats.go
Update README.md
[rbdr/mobius] / hotline / stats.go
index dd8ea1d14dbad7944ce6095783b4d5af54e1717a..d1a3c5f84dcb6bc572baff87fb64f017ce09c73d 100644 (file)
@@ -1,33 +1,20 @@
 package hotline
 
 import (
-       "fmt"
+       "sync"
        "time"
 )
 
 type Stats struct {
-       LoginCount int           `yaml:"login count"`
-       StartTime  time.Time     `yaml:"start time"`
-       Uptime     time.Duration `yaml:"uptime"`
-}
-
-func (s *Stats) String() string {
-       template := `
-Server Stats:
-  Start Time:          %v
-  Uptime:                      %s
-  Login Count: %v
-`
-       d := time.Since(s.StartTime)
-       d = d.Round(time.Minute)
-       h := d / time.Hour
-       d -= h * time.Hour
-       m := d / time.Minute
+       CurrentlyConnected  int
+       DownloadsInProgress int
+       UploadsInProgress   int
+       WaitingDownloads    int
+       ConnectionPeak      int
+       ConnectionCounter   int
+       DownloadCounter     int
+       UploadCounter       int
+       Since               time.Time
 
-       return fmt.Sprintf(
-               template,
-               s.StartTime.Format(time.RFC1123Z),
-               fmt.Sprintf("%02d:%02d", h, m),
-               s.LoginCount,
-       )
+       sync.Mutex
 }