Documentation ¶
Index ¶
Constants ¶
const ( // LastSentUpdateNotificationOp is an op for Centrifuge Notification in which we // send last sent time to all nodes. LastSentUpdateNotificationOp = "usage_stats.last_sent_at" )
Variables ¶
This section is empty.
Functions ¶
func GetEnabledConsumers ¶ added in v5.2.0
func GetEnabledConsumers(consumers []consuming.ConsumerConfig) []string
Types ¶
type Features ¶
type Features struct { // Build info. Version string Edition string // Engine or broker usage. Engine string EngineMode string Broker string BrokerMode string // Transports. Websocket bool HTTPStream bool SSE bool SockJS bool UniWebsocket bool UniGRPC bool UniSSE bool UniHTTPStream bool // Proxies. ConnectProxy bool RefreshProxy bool SubscribeProxy bool PublishProxy bool RPCProxy bool SubRefreshProxy bool SubscribeStreamProxy bool EnabledConsumers []string // Uses GRPC server API. GrpcAPI bool // Admin interface enabled. Admin bool // Uses automatic personal channel subscribe. SubscribeToPersonal bool // PRO features. ClickhouseAnalytics bool UserStatus bool Throttling bool Singleflight bool }
Features is a helper struct to build metrics.
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender can send anonymous usage stats. Centrifugo does not collect any sensitive info. Only impersonal counters to estimate installation size distribution and feature use.
func (*Sender) Run ¶ added in v5.2.0
Run usage stats sender. How it works: First send in between 24-48h from node start. After the initial delay has passed: every hour check last time stats were sent by all the nodes in a Centrifugo cluster. If no points were sent in last 24h, then push metrics and update push time on all nodes (broadcast current time). There is still a chance of duplicate data sending – but should be rare and tolerable for the purpose.
func (*Sender) UpdateLastSentAt ¶
UpdateLastSentAt sets the lastSentAt received from other node only if received value greater than local one (so that we can avoid sending duplicated stats).