stats for user sessions
parent
75b4893a2b
commit
a01d716eed
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue