Skip to content

Commit

Permalink
update usage stats
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Nov 13, 2024
1 parent 61f603b commit e73a9f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/usage/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

"github.com/centrifugal/centrifugo/v5/internal/build"
"github.com/centrifugal/centrifugo/v5/internal/config"
"github.com/centrifugal/centrifugo/v5/internal/configtypes"
"github.com/centrifugal/centrifugo/v5/internal/consuming"

"github.com/centrifugal/centrifuge"
Expand Down Expand Up @@ -626,8 +627,12 @@ func (s *Sender) sendUsageStats(metrics []*metric, statsEndpoint, statsToken str
func GetEnabledConsumers(consumers []consuming.ConsumerConfig) []string {
var enabledConsumers []string
for _, c := range consumers {
if c.Enabled && !slices.Contains(enabledConsumers, string(c.Type)) {
enabledConsumers = append(enabledConsumers, string(c.Type))
consumerType := c.Type
if c.Type == configtypes.ConsumerTypeKafka && c.Kafka.PublicationDataMode.Enabled {
consumerType += "_publication_data"
}
if c.Enabled && !slices.Contains(enabledConsumers, consumerType) {
enabledConsumers = append(enabledConsumers, consumerType)
}
}
return enabledConsumers
Expand Down

0 comments on commit e73a9f2

Please sign in to comment.