Package org.apache.commons.math.stat.descriptive

Examples of org.apache.commons.math.stat.descriptive.DescriptiveStatistics.addValue()


   * @return a DescriptiveStatistics class which is contructed from double array d
   */
  public static DescriptiveStatistics getStats(double[] d){
    DescriptiveStatistics stats = DescriptiveStatistics.newInstance();
    for(int i =0; i < d.length; i++){
      stats.addValue(d[i]);
    }
    return stats;
  }
 
  /**
 
View Full Code Here


      super.testTakedown();
      if (opts.reportLatency) {
        Arrays.sort(times);
        DescriptiveStatistics ds = new DescriptiveStatistics();
        for (double t : times) {
          ds.addValue(t);
        }
        LOG.info("randomRead latency log (ms), on " + times.length + " measures");
        LOG.info("99.9999% = " + ds.getPercentile(99.9999d));
        LOG.info(" 99.999% = " + ds.getPercentile(99.999d));
        LOG.info("  99.99% = " + ds.getPercentile(99.99d));
View Full Code Here

                break;
            }

            double millis = 1E-6 * (System.nanoTime() - start);
            timeStats.addValue(millis);
            trysStats.addValue(trys);

            if (!good)
                throw new RuntimeException();
        }
        System.out.println(timeStats);
View Full Code Here

//                for (int[] b : bijections)
//                    System.out.println(Arrays.toString(b));
//            }
            double millis = 1E-6 * (System.nanoTime() - start);
            timeStats.addValue(millis);
            trysStats.addValue(trys);

            if (!good)
                throw new RuntimeException();
        }
        System.out.println(timeStats);
View Full Code Here

//                for (int[] b : bijections)
//                    System.out.println(Arrays.toString(b));
//            }
            double millis = 1E-6 * (System.nanoTime() - start);
            timeStats.addValue(millis);
            trysStats.addValue(trys);

            if (!good)
                throw new RuntimeException();
        }
        System.out.println(timeStats);
View Full Code Here

            }

            // Run test iterations, and capture the execution times
            long runtimeEnd = System.currentTimeMillis() + runtime * 1000;
            while (System.currentTimeMillis() < runtimeEnd) {
                statistics.addValue(test.execute());
            }
        } finally {
            test.tearDown();
        }

View Full Code Here

            }

            // Run test iterations, and capture the execution times
            long runtimeEnd = System.currentTimeMillis() + runtime * 1000;
            while (System.currentTimeMillis() < runtimeEnd) {
                statistics.addValue(test.execute());
            }
        } finally {
            test.tearDown();
        }

View Full Code Here

       
        line = in.readLine();
       
        while (line != null) {
            if (d != null) {
                d.addValue(Double.parseDouble(line.trim()));
            else {
                s.addValue(Double.parseDouble(line.trim()));
            }
            line = in.readLine();
        }
View Full Code Here

  @Test
  public void testCostFromStats() {
    DescriptiveStatistics statOne = new DescriptiveStatistics();
    for (int i =0; i < 100; i++) {
      statOne.addValue(10);
    }
    assertEquals(0, loadBalancer.costFromStats(statOne), 0.01);

    DescriptiveStatistics statTwo = new DescriptiveStatistics();
    for (int i =0; i < 100; i++) {
View Full Code Here

    }
    assertEquals(0, loadBalancer.costFromStats(statOne), 0.01);

    DescriptiveStatistics statTwo = new DescriptiveStatistics();
    for (int i =0; i < 100; i++) {
      statTwo.addValue(0);
    }
    statTwo.addValue(100);
    assertEquals(1, loadBalancer.costFromStats(statTwo), 0.01);

    DescriptiveStatistics statThree = new DescriptiveStatistics();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.