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

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


        for (Long time : env.getExecutionLatenciesNanos()) {
          ds.addValue(time);
        }
        // Ensures that web ui circumvents the display of NaN values when there are zero samples.
        if (ds.getN() == 0) {
          ds.addValue(0);
        }
        results.put(env.getInstance().getClass().getSimpleName(), ds);
      }
    }
    return results;
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

    Map<String, DescriptiveStatistics> results = new HashMap<String, DescriptiveStatistics>();
    for (RegionEnvironment env : coprocessors) {
      DescriptiveStatistics ds = new DescriptiveStatistics();
      if (env.getInstance() instanceof RegionObserver) {
        for (Long time : env.getExecutionLatenciesNanos()) {
          ds.addValue(time);
        }
        // Ensures that web ui circumvents the display of NaN values when there are zero samples.
        if (ds.getN() == 0) {
          ds.addValue(0);
        }
View Full Code Here

        for (Long time : env.getExecutionLatenciesNanos()) {
          ds.addValue(time);
        }
        // Ensures that web ui circumvents the display of NaN values when there are zero samples.
        if (ds.getN() == 0) {
          ds.addValue(0);
        }
        results.put(env.getInstance().getClass().getSimpleName(), ds);
      }
    }
    return results;
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

            List<Object> values = createRandomSample(uniques, (int) (uniques * 1.5));

            long actual = estimateCount(values, 0);
            double error = (actual - uniques) * 1.0 / uniques;

            stats.addValue(error);
        }

        assertLessThan(stats.getMean(), 1e-2);
        assertLessThan(Math.abs(stats.getStandardDeviation() - getAggregationFunction().getStandardError()), 1e-2);
    }
View Full Code Here

        for (int i = 0; i < 100; i++) {
            List<MaterializedTuple> values = computeActual("SELECT orderkey FROM ORDERS TABLESAMPLE BERNOULLI (50)").getMaterializedTuples();

            assertEquals(values.size(), ImmutableSet.copyOf(values).size(), "TABLESAMPLE produced duplicate rows");
            stats.addValue(values.size() * 1.0 / total);
        }

        double mean = stats.getGeometricMean();
        assertTrue(mean > 0.45 && mean < 0.55, String.format("Expected mean sampling rate to be ~0.5, but was %s", mean));
    }
View Full Code Here

        for (int i = 0; i < 100; i++) {
            List<MaterializedTuple> values = computeActual("SELECT orderkey FROM ORDERS TABLESAMPLE BERNOULLI (50)").getMaterializedTuples();

            assertEquals(values.size(), ImmutableSet.copyOf(values).size(), "TABLESAMPLE produced duplicate rows");
            stats.addValue(values.size() * 1.0 / total);
        }

        double mean = stats.getGeometricMean();
        assertTrue(mean > 0.45 && mean < 0.55, String.format("Expected mean sampling rate to be ~0.5, but was %s", mean));
    }
View Full Code Here

            List<Object> values = createRandomSample(uniques, (int) (uniques * 1.5));

            long actual = estimateGroupByCount(values);
            double error = (actual - uniques) * 1.0 / uniques;

            stats.addValue(error);
        }

        assertLessThan(stats.getMean(), 1.0e-2);
        assertLessThan(Math.abs(stats.getStandardDeviation() - ApproximateCountDistinctAggregation.getStandardError()), 1.0e-2);
    }
View Full Code Here

        for (int i = 0; i < 100; i++) {
            List<MaterializedTuple> values = computeActual("SELECT orderkey FROM ORDERS TABLESAMPLE BERNOULLI (50)").getMaterializedTuples();

            assertEquals(values.size(), ImmutableSet.copyOf(values).size(), "TABLESAMPLE produced duplicate rows");
            stats.addValue(values.size() * 1.0 / total);
        }

        double mean = stats.getGeometricMean();
        assertTrue(mean > 0.45 && mean < 0.55, String.format("Expected mean sampling rate to be ~0.5, but was %s", mean));
    }
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.