func (r *Room) AfterInit() {
	r.timer = pitaya.NewTimer(time.Minute, func() {
		count, err := r.app.GroupCountMembers(context.Background(), "room")
		println("UserCount: Time=>", time.Now().String(), "Count=>", count, "Error=>", err)
		println("OutboundBytes", r.Stats.OutboundBytes)
		println("InboundBytes", r.Stats.OutboundBytes)
	})
}
AfterInit component lifetime callback
package services
import (
	"context"
	"fmt"
	"time"
	"github.com/topfreegames/pitaya/v2"
	"github.com/topfreegames/pitaya/v2/component"
	"github.com/topfreegames/pitaya/v2/examples/demo/protos"
	"github.com/topfreegames/pitaya/v2/timer"
)
type (
	Room struct {
		component.Base
		timer *timer.Timer
		app   pitaya.Pitaya
		Stats *protos.Stats
	}
	UserMessage struct {
		Name    string `json:"name"`
		Content string `json:"content"`
	}
	Stats struct {
		outboundBytes int
		inboundBytes  int
	}
	RPCResponse struct {
		Msg string `json:"msg"`
	}
	SendRPCMsg struct {
		ServerID string `json:"serverId"`
		Route    string `json:"route"`
		Msg      string `json:"msg"`
	}
	NewUser struct {
		Content string `json:"content"`
	}
	AllMembers struct {
		Members []string `json:"members"`
	}
	JoinResponse struct {
		Code   int    `json:"code"`
		Result string `json:"result"`
	}
)
func NewRoom(app pitaya.Pitaya) *Room {
	return &Room{
		app:   app,
		Stats: &protos.Stats{},
	}
}
func (r *Room) Init() {
	r.app.GroupCreate(context.Background(), "room")
}