aboutsummaryrefslogtreecommitdiff
path: root/hotline/stats.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-20 20:14:32 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-20 20:14:32 -0700
commit7cd900d61edbd6d322db3cecb913adf574389320 (patch)
tree7da8ac3658fa4b6204330f1f9c980428b6a6fdc5 /hotline/stats.go
parentbb1e98842e35b3affaf94971e78c86f8b9547928 (diff)
Add initial support for resource and info forks
Diffstat (limited to 'hotline/stats.go')
-rw-r--r--hotline/stats.go33
1 files changed, 8 insertions, 25 deletions
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"`
}