java.lang.Object
io.microsphere.spring.cloud.fault.tolerance.loadbalancer.util.LoadBalancerUtils

public abstract class LoadBalancerUtils extends Object
The utilities class of Load Balancer
Since:
1.0.0
Author:
Mercy
  • 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 milliseconds
      warmup - the warmup time in milliseconds
      weight - the weight of an invoker
      Returns:
      weight which takes warmup into account