aboutsummaryrefslogtreecommitdiff
path: root/stats.go
diff options
context:
space:
mode:
Diffstat (limited to 'stats.go')
-rw-r--r--stats.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/stats.go b/stats.go
deleted file mode 100644
index dd8ea1d..0000000
--- a/stats.go
+++ /dev/null
@@ -1,33 +0,0 @@
-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,
- )
-}