Add least time load balancing strategy
This commit is contained in:
parent
067c7e7152
commit
a754236ce5
25 changed files with 1830 additions and 134 deletions
|
|
@ -190,6 +190,12 @@ type WRRService struct {
|
|||
GRPCStatus *GRPCStatus `json:"-" toml:"-" yaml:"-" label:"-" file:"-"`
|
||||
}
|
||||
|
||||
// SetDefaults Default values for a WRRService.
|
||||
func (w *WRRService) SetDefaults() {
|
||||
defaultWeight := 1
|
||||
w.Weight = &defaultWeight
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen=true
|
||||
|
||||
// HRWService is a reference to a service load-balanced with highest random weight.
|
||||
|
|
@ -204,12 +210,6 @@ func (w *HRWService) SetDefaults() {
|
|||
w.Weight = &defaultWeight
|
||||
}
|
||||
|
||||
// SetDefaults Default values for a WRRService.
|
||||
func (w *WRRService) SetDefaults() {
|
||||
defaultWeight := 1
|
||||
w.Weight = &defaultWeight
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen=true
|
||||
|
||||
type GRPCStatus struct {
|
||||
|
|
@ -267,6 +267,8 @@ const (
|
|||
BalancerStrategyP2C BalancerStrategy = "p2c"
|
||||
// BalancerStrategyHRW is the highest random weight strategy.
|
||||
BalancerStrategyHRW BalancerStrategy = "hrw"
|
||||
// BalancerStrategyLeastTime is the least-time strategy.
|
||||
BalancerStrategyLeastTime BalancerStrategy = "leasttime"
|
||||
)
|
||||
|
||||
// +k8s:deepcopy-gen=true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue