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 Summary
Modifier 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
-
calculateWarmupWeight
public 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 millisecondswarmup- the warmup time in millisecondsweight- the weight of an invoker- Returns:
- weight which takes warmup into account
-