]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/stats.go
patch: v0.10.17
[rbdr/mobius] / hotline / stats.go
index 4b9119d6a21aa60516fc9af8e3c2e323d4d7400b..bc06a6915776b6ed36bc86917fe256066046a71e 100644 (file)
@@ -1,34 +1,17 @@
 package hotline
 
 import (
-       "fmt"
        "time"
 )
 
 type Stats struct {
-       LoginCount      int       `yaml:"login count"`
-       StartTime       time.Time `yaml:"start time"`
-       DownloadCounter int
-       UploadCounter   int
-}
-
-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
-
-       return fmt.Sprintf(
-               template,
-               s.StartTime.Format(time.RFC1123Z),
-               fmt.Sprintf("%02d:%02d", h, m),
-               s.LoginCount,
-       )
+       CurrentlyConnected  int
+       DownloadsInProgress int
+       UploadsInProgress   int
+       WaitingDownloads    int
+       ConnectionPeak      int
+       ConnectionCounter   int
+       DownloadCounter     int
+       UploadCounter       int
+       Since               time.Time
 }