System.out.println("   allocation rate = " + allocRate + " Mb/s"); if (count < 1) { System.out.println("  <--- Skipping in cumulative numbers");
System.out.print("   allocation rate = " + allocRate + " Mb/s"); if (sampleCount < 1) { System.out.println("  <--- Skipping");
  public static boolean addSample(double traceElapsed, double traceRate, double allocRate) {    count++;    System.out.print("GC occurred (" + traceElapsed + " s) : tracing rate = " + traceRate + " Mb/s");    System.out.println("   allocation rate = " + allocRate + " Mb/s");    if (count < 1) {      System.out.println("  <--- Skipping in cumulative numbers");    }    else {      System.out.println();      sumTraceRate += traceRate;      sumAllocRate += allocRate;      squaredSumTraceRate += traceRate * traceRate;      squaredSumAllocRate += allocRate * allocRate;    }    if (count == 5) {      double avgTraceRate = sumTraceRate / count;      double avgAllocRate = sumAllocRate / count;      double diffSquaredSumTraceRate = squaredSumTraceRate + count * (avgTraceRate * avgTraceRate)                                                            - 2 * avgTraceRate * sumTraceRate;      double rmsTraceRate = Math.sqrt(diffSquaredSumTraceRate / count);      double diffSquaredSumAllocRate = squaredSumAllocRate + count * (avgAllocRate * avgAllocRate)                                                            - 2 * avgAllocRate * sumAllocRate;      double rmsAllocRate = Math.sqrt(diffSquaredSumAllocRate / count);      avgTraceRate = ((int) (10000 * avgTraceRate) + 0.5) / 10000;      avgAllocRate = ((int) (10000 * avgAllocRate) + 0.5) / 10000;      rmsTraceRate = ((int) (10000 * rmsTraceRate) + 0.5) / 10000;      rmsAllocRate = ((int) (10000 * rmsAllocRate) + 0.5) / 10000;      System.out.print("Overall Rate:           tracing  rate = " + avgTraceRate + " Mb/s");      System.out.println("   allocation rate = " + avgAllocRate + " Mb/s");      System.out.print("Standard Deviation:     tracing sigma = " + rmsTraceRate + " Mb/s");      System.out.println("   allocation sigma = " + rmsAllocRate + " Mb/s");      return true;    }    return false;  }