Class LoadBalancerUtils


  • public abstract class LoadBalancerUtils
    extends java.lang.Object
    The 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 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)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 milliseconds
        warmup - the warmup time in milliseconds
        weight - the weight of an invoker
        Returns:
        weight which takes warmup into account