You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
415 B

1 year ago
  1. package balancer
  2. import (
  3. cmap "github.com/orcaman/concurrent-map/v2"
  4. )
  5. type Balancer struct {
  6. Brokers cmap.ConcurrentMap[string, *BrokerStats]
  7. }
  8. type BrokerStats struct {
  9. TopicPartitionCount int32
  10. ConsumerCount int32
  11. CpuUsagePercent int32
  12. }
  13. func NewBalancer() *Balancer {
  14. return &Balancer{
  15. Brokers: cmap.New[*BrokerStats](),
  16. }
  17. }
  18. func NewBrokerStats() *BrokerStats {
  19. return &BrokerStats{}
  20. }