From 8878ca1e88fe6f79f27ef0369334fc8e6e27b1b6 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Wed, 24 Jun 2020 22:52:05 -0700 Subject: [PATCH] Have both connect and disconnect time in the status API --- core/status.go | 2 ++ models/status.go | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/core/status.go b/core/status.go index 93e553f56..9d0521e76 100644 --- a/core/status.go +++ b/core/status.go @@ -19,6 +19,8 @@ func GetStatus() models.Status { ViewerCount: len(_stats.Clients), OverallMaxViewerCount: _stats.OverallMaxViewerCount, SessionMaxViewerCount: _stats.SessionMaxViewerCount, + LastDisconnectTime: _stats.LastDisconnectTime, + LastConnectTime: _stats.LastConnectTime, } } diff --git a/models/status.go b/models/status.go index 15a720a4a..f81d747fe 100644 --- a/models/status.go +++ b/models/status.go @@ -1,9 +1,16 @@ package models +import ( + "time" +) + //Status represents the status of the system type Status struct { Online bool `json:"online"` ViewerCount int `json:"viewerCount"` OverallMaxViewerCount int `json:"overallMaxViewerCount"` SessionMaxViewerCount int `json:"sessionMaxViewerCount"` + + LastConnectTime time.Time `json:"lastConnectTime"` + LastDisconnectTime time.Time `json:"lastDisconnectTime"` }