diff --git a/modules/structs/stats.go b/modules/structs/stats.go index 8f73b80..1ee7a4d 100644 --- a/modules/structs/stats.go +++ b/modules/structs/stats.go @@ -3,6 +3,7 @@ package structs // swagger:model StatsResponse type StatsResponse struct { Users int + UserSessions int Chats int WebSocketSessions int UserSignUpProcesses int diff --git a/routers/api/v1/stats/stats.go b/routers/api/v1/stats/stats.go index 4b6a0a1..b05bf4e 100644 --- a/routers/api/v1/stats/stats.go +++ b/routers/api/v1/stats/stats.go @@ -29,6 +29,10 @@ func GetStats(c *fiber.Ctx) error { stats.Users = count } + if count, err := getCount(gocnjhelper.DbMSessions.Name()); err == nil { + stats.UserSessions = count + } + if count, err := getCount(gocnjhelper.DbMChats.Name()); err == nil { stats.Chats = count }