Class LoadBalancerUtils
- java.lang.Object
-
- io.microsphere.spring.cloud.fault.tolerance.loadbalancer.util.LoadBalancerUtils
-
public abstract class LoadBalancerUtils extends java.lang.ObjectThe utilities class of Load Balancer- Since:
- 1.0.0
- Author:
- Mercy
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
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
-
-