// limit is used if and only if it is configured to a value greater than zero and the number of instances that
// the memberCounter reports is greater than zero. Otherwise, the per-instance limit is used.
func getQuota(memberCounter MemberCounter, instanceLimit, clusterLimit int) float64 {
cluster_aware_quota_calculator.go
if clusterLimit > 0 && memberCounter != nil {
if clusterSize := memberCounter.AvailableMemberCount(); clusterSize > 0 {
return float64(clusterLimit) / float64(clusterSize)