@Test public void calcLoadInputPositivePositiveZeroOutputPositiveInfinity() { final Long deltaCpuTime = 4_194_304L; final long deltaUptime = 4_611_686_018_427_387_904L; final long factor = 0L; final double retval = Utils.calcLoad(deltaCpuTime, deltaUptime, factor); Assert.assertEquals(Double.POSITIVE_INFINITY, retval, 0.0); }
public static double calcLoad(long deltaCpuTime, long deltaUptime) { if (deltaCpuTime <= 0 || deltaUptime == 0) { return 0.0; } return deltaCpuTime * 100d / deltaUptime; }
Utils { public static double calcLoad(long deltaCpuTime, long deltaUptime) { if (deltaCpuTime <= 0 || deltaUptime == 0) { return 0.0; } return deltaCpuTime * 100d / deltaUptime; } }
Utils { public static double calcLoad(long deltaCpuTime, long deltaUptime) { if (deltaCpuTime <= 0 || deltaUptime == 0) { return 0.0; } return deltaCpuTime * 100d / deltaUptime; }  }
Utils { public static double calcLoad(long deltaCpuTime, long deltaUptime) { if (deltaCpuTime <= 0 || deltaUptime == 0) { return 0.0; } return deltaCpuTime * 100d / deltaUptime; }  static long[] sortAndFilterThreadIdsByValue(LongObjectMap map, int threadLimit); static double calcLoad(long deltaCpuTime, long deltaUptime); static double calcLoad(Long deltaCpuTime, long deltaUptime, long factor); static double calcMemoryUtilization(Long threadBytes, long totalBytes); static void sleep(long mills); static int getJavaMajorVersion(String javaSpecificationVersion); }
Utils { public static double calcLoad(long deltaCpuTime, long deltaUptime) { if (deltaCpuTime <= 0 || deltaUptime == 0) { return 0.0; } return deltaCpuTime * 100d / deltaUptime; }  static long[] sortAndFilterThreadIdsByValue(LongObjectMap map, int threadLimit); static double calcLoad(long deltaCpuTime, long deltaUptime); static double calcLoad(Long deltaCpuTime, long deltaUptime, long factor); static double calcMemoryUtilization(Long threadBytes, long totalBytes); static void sleep(long mills); static int getJavaMajorVersion(String javaSpecificationVersion); static long NANOS_TO_MILLS; }