X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/23411fc23dcf82e0ed35a780bfdda2341bedf819..f22acf38da970aa0d865a9978c9499dad01d235f:/hotline/stats.go diff --git a/hotline/stats.go b/hotline/stats.go index 4b9119d..4fa683a 100644 --- a/hotline/stats.go +++ b/hotline/stats.go @@ -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 + CurrentlyConnected int + DownloadsInProgress int + UploadsInProgress int + ConnectionPeak int + DownloadCounter int + UploadCounter int - return fmt.Sprintf( - template, - s.StartTime.Format(time.RFC1123Z), - fmt.Sprintf("%02d:%02d", h, m), - s.LoginCount, - ) + LoginCount int `yaml:"login count"` + StartTime time.Time `yaml:"start time"` }