Class LatencyUtils

java.lang.Object
com.linkedin.venice.utils.LatencyUtils

public class LatencyUtils extends Object
  • Constructor Details

    • LatencyUtils

      public LatencyUtils()
  • Method Details

    • getElapsedTimeFromNSToMS

      public static double getElapsedTimeFromNSToMS(long startTimeInNS)
      Parameters:
      startTimeInNS - input start time should use nanosecond unit
      Returns:
      latency in millisecond
    • convertNSToMS

      public static double convertNSToMS(long nanoseconds)
    • getElapsedTimeFromMsToMs

      public static long getElapsedTimeFromMsToMs(long startTimeInMs)
      Parameters:
      startTimeInMs - input start time should use millisecond unit
      Returns:
      elapsed time in millisecond
    • sleep

      public static boolean sleep(long millis)
      Sleep until number of milliseconds have passed, or the operation is interrupted. This method will swallow the InterruptedException and terminate, if this is used in a loop it may become difficult to cleanly break out of the loop.
      Parameters:
      millis -
      Returns:
      true on success and false if sleep was interrupted