// Retrieve the desired maximum count, based on current cluster state
Retrieve the desired maximum count, based on current cluster state
// Retrieve the desired maximum count based on current cluster state
func (e *FairBalancer) desiredCount(current map[string]int) int {
	total := 0
	for _, c := range current {
		total += c
	}
	avg := 0
	if len(current) > 0 {
		avg = total / len(current)
	}
	return int(math.Ceil(float64(avg) * e.releaseThreshold))
}
func ( e * FairBalancer ) desiredCount ( current map [ string ] int ) int { total := 0 for _ , c := range current { total += c } avg := 0 if len ( current ) > 0 { avg = total / len ( current ) } return int ( math . Ceil ( float64 ( avg ) * e . releaseThreshold ) ) }
Retrieve the desired maximum count, based on current cluster state
Retrieve the desired maximum count based on current cluster state