From 7cd900d61edbd6d322db3cecb913adf574389320 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Mon, 20 Jun 2022 20:14:32 -0700 Subject: Add initial support for resource and info forks --- hotline/stats.go | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) (limited to '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"` } -- cgit