Class LoadBalancerUtils
java.lang.Object
io.microsphere.spring.cloud.fault.tolerance.loadbalancer.util.LoadBalancerUtils
The utilities class of Load Balancer
- Since:
- 1.0.0
- Author:
- Mercy
- 
Method SummaryModifier and TypeMethodDescriptionstatic intcalculateWarmupWeight(long uptime, long warmup, int weight) Calculate the weight according to the uptime proportion of warmup time the new weight will be within 1(inclusive) to weight(inclusive)
- 
Method Details- 
calculateWarmupWeightpublic static int calculateWarmupWeight(long uptime, long warmup, int weight) Calculate the weight according to the uptime proportion of warmup time the new weight will be within 1(inclusive) to weight(inclusive)- Parameters:
- uptime- the uptime in milliseconds
- warmup- the warmup time in milliseconds
- weight- the weight of an invoker
- Returns:
- weight which takes warmup into account
 
 
-