aboutsummaryrefslogtreecommitdiff
path: root/weed/mq/balancer/balancer.go
blob: 74871925ff494bbf0540c0390b97de22dc817d39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package balancer

import (
	cmap "github.com/orcaman/concurrent-map/v2"
)

type Balancer struct {
	Brokers cmap.ConcurrentMap[string, *BrokerStats]
}
type BrokerStats struct {
	TopicPartitionCount int32
	ConsumerCount       int32
	CpuUsagePercent     int32
}

func NewBalancer() *Balancer {
	return &Balancer{
		Brokers: cmap.New[*BrokerStats](),
	}
}

func NewBrokerStats() *BrokerStats {
	return &BrokerStats{}
}