stats for user sessions

alpha
alex 2023-02-24 07:39:12 +01:00
parent 75b4893a2b
commit a01d716eed
2 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package structs
// swagger:model StatsResponse // swagger:model StatsResponse
type StatsResponse struct { type StatsResponse struct {
Users int Users int
UserSessions int
Chats int Chats int
WebSocketSessions int WebSocketSessions int
UserSignUpProcesses int UserSignUpProcesses int

View File

@ -29,6 +29,10 @@ func GetStats(c *fiber.Ctx) error {
stats.Users = count stats.Users = count
} }
if count, err := getCount(gocnjhelper.DbMSessions.Name()); err == nil {
stats.UserSessions = count
}
if count, err := getCount(gocnjhelper.DbMChats.Name()); err == nil { if count, err := getCount(gocnjhelper.DbMChats.Name()); err == nil {
stats.Chats = count stats.Chats = count
} }