X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/22c599abc18895f73e96095f35b71cf3357d41b4..89e46a200bc05aabd8350ff2fb0df599cdc15ba3:/hotline/stats.go?ds=sidebyside diff --git a/hotline/stats.go b/hotline/stats.go index dd8ea1d..bc06a69 100644 --- a/hotline/stats.go +++ b/hotline/stats.go @@ -1,33 +1,17 @@ package hotline import ( - "fmt" "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 - - 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 }