code: func (h *apiExecutor) PresenceStats(ctx context.Context, cmd *PresenceStatsRequest) *PresenceStatsResponse {
  	defer func(started time.Time) {
  		apiCommandDurationSummary.WithLabelValues(h.protocol, "presence_stats").Observe(time.Since(started).Seconds())
  	}(time.Now())
  
  	resp := &PresenceStatsResponse{}
  
  	ch := cmd.Channel
  
  	if ch == "" {
  		resp.Error = ErrorBadRequest
  		return resp
  	}
  
  	chOpts, ok := h.node.ChannelOpts(ch)
  	if !ok {
  		resp.Error = ErrorNamespaceNotFound
  		return resp
  	}
  
  	if !chOpts.Presence {
  		resp.Error = ErrorNotAvailable
  		return resp
  	}
  
  	stats, err := h.node.PresenceStats(cmd.Channel)
  	if err != nil {
  		h.node.Log(centrifuge.NewLogEntry(centrifuge.LogLevelError, "error calling presence stats", map[string]interface{}{"error": err.Error()}))
  		resp.Error = ErrorInternal
  		return resp
  	}
  
  	resp.Result = &PresenceStatsResult{
  		NumClients: uint32(stats.NumClients),
  		NumUsers:   uint32(stats.NumUsers),
  	}
  
  	return resp
  }
docs: // PresenceStats returns response with presence stats information for channel.