changeset 222:31ede9a19bbd

Remove the BootstrappedStatistics.
author shade
date Mon, 04 Nov 2013 11:33:56 +0100
parents 78a68cce08d1
children 0d9c6a911ed1
files jmh-core/src/main/java/org/openjdk/jmh/util/internal/BootstrappedStatistics.java
diffstat 1 files changed, 0 insertions(+), 82 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/util/internal/BootstrappedStatistics.java	Mon Nov 04 11:33:24 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.util.internal;
-
-import java.util.Random;
-
-public class BootstrappedStatistics extends Statistics {
-
-    private static final long serialVersionUID = 2166351427129447724L;
-
-    private static final int BOOTSTRAP_ITERS = Integer.getInteger("bootstrap.cycles", 100);
-
-    private final int bootstrapIters;
-
-    public BootstrappedStatistics(Statistics s) {
-        this(s, BOOTSTRAP_ITERS);
-    }
-
-    public BootstrappedStatistics(Statistics s, int bootstrapIters) {
-        super(s.getValues());
-        this.bootstrapIters = bootstrapIters;
-    }
-
-    public BootstrappedStatistics(int bootstrapIters) {
-        super();
-        this.bootstrapIters = bootstrapIters;
-    }
-
-    /**
-     * Gets the bootstrapped estimate of percentile.
-     * @param p percentile to estimate
-     * @return result
-     */
-    public Statistics getBootPercentile(double p) {
-        if (bootstrapIters <= 1) {
-            return this;
-        }
-
-        Statistics r = new Statistics();
-
-        double[] values = getValues();
-
-        Random rnd = new Random();
-        for (int c = 0; c < bootstrapIters; c++) {
-            double[] newValues = new double[values.length];
-            for (int i = 0; i < values.length; i++) {
-                newValues[i] = values[rnd.nextInt(values.length)];
-            }
-            r.addValue(Statistics.getPercentile(newValues, p));
-        }
-
-        return r;
-    }
-
-    @Override
-    public double getPercentile(double p) {
-        return getBootPercentile(p).getMean();
-    }
-
-}