changeset 235:303e6fb2e9ab

Renames.
author shade
date Sat, 09 Nov 2013 19:29:20 +0100
parents e7be2971a45d
children 5133646009d8
files jmh-core/src/main/java/org/openjdk/jmh/annotations/Mode.java jmh-core/src/main/java/org/openjdk/jmh/logic/results/AverageTimePerOp.java jmh-core/src/main/java/org/openjdk/jmh/logic/results/AverageTimeResult.java jmh-core/src/main/java/org/openjdk/jmh/logic/results/OpsPerTimeUnit.java jmh-core/src/main/java/org/openjdk/jmh/logic/results/SampleTimePerOp.java jmh-core/src/main/java/org/openjdk/jmh/logic/results/SampleTimeResult.java jmh-core/src/main/java/org/openjdk/jmh/logic/results/SingleShotResult.java jmh-core/src/main/java/org/openjdk/jmh/logic/results/SingleShotTime.java jmh-core/src/main/java/org/openjdk/jmh/logic/results/ThroughputResult.java jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestAggregateResult.java jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestAverageTimePerOp.java jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestAverageTimeResult.java jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestOpsPerTimeUnit.java jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestSampleTimePerOp.java jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestSampleTimeResult.java jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestSingleShotResult.java jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestSingleShotTime.java jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestThroughputResult.java
diffstat 19 files changed, 934 insertions(+), 934 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/Mode.java	Sat Nov 09 10:26:22 2013 +0100
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/Mode.java	Sat Nov 09 19:29:20 2013 +0100
@@ -38,24 +38,24 @@
 
     /**
      * Operations per unit of time,
-     * {@link org.openjdk.jmh.logic.results.OpsPerTimeUnit}. */
+     * {@link org.openjdk.jmh.logic.results.ThroughputResult}. */
     Throughput("thrpt", "Throughput, ops/time"),
 
     /**
      * Average time per operation
-     * {@link org.openjdk.jmh.logic.results.AverageTimePerOp}.
+     * {@link org.openjdk.jmh.logic.results.AverageTimeResult}.
      */
     AverageTime("avgt", "Average time, time/op"),
 
     /**
      * Time distribution, percentile estimation
-     * {@link org.openjdk.jmh.logic.results.SampleTimePerOp}.
+     * {@link org.openjdk.jmh.logic.results.SampleTimeResult}.
      */
     SampleTime("sample", "Sampling time"),
 
     /**
      * Time the single execution
-     * {@link org.openjdk.jmh.logic.results.SingleShotTime}.
+     * {@link org.openjdk.jmh.logic.results.SingleShotResult}.
      */
     SingleShotTime("ss", "Single shot invocation time"),
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/logic/results/AverageTimePerOp.java	Sat Nov 09 10:26:22 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +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.logic.results;
-
-import org.openjdk.jmh.runner.parameters.TimeValue;
-import org.openjdk.jmh.util.internal.ListStatistics;
-import org.openjdk.jmh.util.internal.Statistics;
-
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Result class that stores average operation time.
- *
- * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
- */
-public class AverageTimePerOp extends Result {
-
-    /** Total number of operations during iteration */
-    private final long operations;
-    /** Duration of iteration in NanoSeconds */
-    private final long durationNs;
-    /** The TimeUnit to use when calculating the score */
-    private final TimeUnit outputTimeUnit;
-
-    /**
-     * Sets up the result
-     *
-     * @param operations     Total number of operations during iteration
-     * @param durationNs       Duration of iteration in NanoSeconds
-     * @param tu The TimeUnit to use when calculating the score
-     */
-    public AverageTimePerOp(ResultRole mode, String label, long operations, long durationNs, TimeUnit tu) {
-        this(mode, label, operations, durationNs, tu, null);
-    }
-
-    AverageTimePerOp(ResultRole mode, String label, long operations, long durationNs, TimeUnit tu, Statistics stat) {
-        super(mode, label, stat);
-        this.operations = operations;
-        this.durationNs = durationNs;
-        this.outputTimeUnit = tu;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public String getScoreUnit() {
-        return TimeValue.tuToString(outputTimeUnit) + "/op";
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public double getScore() {
-        return (durationNs / (double) outputTimeUnit.toNanos(1)) / operations;
-    }
-
-    public Aggregator<AverageTimePerOp> getIterationAggregator() {
-        return new ResultAggregator();
-    }
-
-    public Aggregator<AverageTimePerOp> getRunAggregator() {
-        return new ResultAggregator();
-    }
-
-    /**
-     * Computes the aggregate result.
-     * Regardless of aggregation, we need to compute the aggregate time as:
-     *   average time = (all time) / (all operations)
-     */
-    public static class ResultAggregator implements Aggregator<AverageTimePerOp> {
-        @Override
-        public AverageTimePerOp aggregate(Collection<AverageTimePerOp> results) {
-            ListStatistics stat = new ListStatistics();
-            ResultRole role = null;
-            String label = null;
-            long operations = 0;
-            long duration = 0;
-            TimeUnit tu = null;
-            for (AverageTimePerOp r : results) {
-                role = r.role;
-                label = r.label;
-                tu = r.outputTimeUnit;
-                operations += r.operations;
-                duration += r.durationNs;
-                stat.addValue(r.getScore());
-            }
-            return new AverageTimePerOp(role, label, operations, duration, tu, stat);
-        }
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/logic/results/AverageTimeResult.java	Sat Nov 09 19:29:20 2013 +0100
@@ -0,0 +1,112 @@
+/*
+ * 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.logic.results;
+
+import org.openjdk.jmh.runner.parameters.TimeValue;
+import org.openjdk.jmh.util.internal.ListStatistics;
+import org.openjdk.jmh.util.internal.Statistics;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Result class that stores average operation time.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class AverageTimeResult extends Result {
+
+    /** Total number of operations during iteration */
+    private final long operations;
+    /** Duration of iteration in NanoSeconds */
+    private final long durationNs;
+    /** The TimeUnit to use when calculating the score */
+    private final TimeUnit outputTimeUnit;
+
+    /**
+     * Sets up the result
+     *
+     * @param operations     Total number of operations during iteration
+     * @param durationNs       Duration of iteration in NanoSeconds
+     * @param tu The TimeUnit to use when calculating the score
+     */
+    public AverageTimeResult(ResultRole mode, String label, long operations, long durationNs, TimeUnit tu) {
+        this(mode, label, operations, durationNs, tu, null);
+    }
+
+    AverageTimeResult(ResultRole mode, String label, long operations, long durationNs, TimeUnit tu, Statistics stat) {
+        super(mode, label, stat);
+        this.operations = operations;
+        this.durationNs = durationNs;
+        this.outputTimeUnit = tu;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String getScoreUnit() {
+        return TimeValue.tuToString(outputTimeUnit) + "/op";
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public double getScore() {
+        return (durationNs / (double) outputTimeUnit.toNanos(1)) / operations;
+    }
+
+    public Aggregator<AverageTimeResult> getIterationAggregator() {
+        return new ResultAggregator();
+    }
+
+    public Aggregator<AverageTimeResult> getRunAggregator() {
+        return new ResultAggregator();
+    }
+
+    /**
+     * Computes the aggregate result.
+     * Regardless of aggregation, we need to compute the aggregate time as:
+     *   average time = (all time) / (all operations)
+     */
+    public static class ResultAggregator implements Aggregator<AverageTimeResult> {
+        @Override
+        public AverageTimeResult aggregate(Collection<AverageTimeResult> results) {
+            ListStatistics stat = new ListStatistics();
+            ResultRole role = null;
+            String label = null;
+            long operations = 0;
+            long duration = 0;
+            TimeUnit tu = null;
+            for (AverageTimeResult r : results) {
+                role = r.role;
+                label = r.label;
+                tu = r.outputTimeUnit;
+                operations += r.operations;
+                duration += r.durationNs;
+                stat.addValue(r.getScore());
+            }
+            return new AverageTimeResult(role, label, operations, duration, tu, stat);
+        }
+    }
+
+}
--- a/jmh-core/src/main/java/org/openjdk/jmh/logic/results/OpsPerTimeUnit.java	Sat Nov 09 10:26:22 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +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.logic.results;
-
-import org.openjdk.jmh.runner.parameters.TimeValue;
-import org.openjdk.jmh.util.internal.ListStatistics;
-import org.openjdk.jmh.util.internal.Statistics;
-
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Result class that counts the number of operations performed during a specified unit of time.
- *
- * @author staffan.friberg@oracle.com, anders.astrand@oracle.com
- */
-public class OpsPerTimeUnit extends Result {
-
-    /** Total number of operations during iteration */
-    private final long operations;
-    /** Duration of iteration in NanoSeconds */
-    private final long durationNs;
-    /** The TimeUnit to use when calculating the score */
-    private final TimeUnit outputTimeUnit;
-
-    /**
-     * Sets up the result with the default output unit MilliSeconds
-     *
-     * @param operations Total number of operations during iteration
-     * @param durationNs   Duration of iteration in NanoSeconds
-     */
-    public OpsPerTimeUnit(ResultRole role, String label, long operations, long durationNs) {
-        this(role, label, operations, durationNs, TimeUnit.MILLISECONDS);
-    }
-
-    /**
-     * Sets up the result
-     *
-     * @param operations     Total number of operations during iteration
-     * @param durationNs       Duration of iteration in NanoSeconds
-     * @param outputTimeUnit The TimeUnit to use when calculating the score
-     */
-    public OpsPerTimeUnit(ResultRole role, String label, long operations, long durationNs, TimeUnit outputTimeUnit) {
-        this(role, label, operations, durationNs, outputTimeUnit, null);
-    }
-
-    OpsPerTimeUnit(ResultRole role, String label, long operations, long durationNs, TimeUnit outputTimeUnit, Statistics stats) {
-        super(role, label, stats);
-        this.operations = operations;
-        this.durationNs = durationNs;
-        this.outputTimeUnit = outputTimeUnit;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public String getScoreUnit() {
-        return "ops/" + TimeValue.tuToString(outputTimeUnit);
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public double getScore() {
-        return operations / (durationNs / (double) outputTimeUnit.toNanos(1));
-    }
-
-    @Override
-    public Aggregator getIterationAggregator() {
-        // compute sum
-        return new Aggregator<OpsPerTimeUnit>() {
-            @Override
-            public Result aggregate(Collection<OpsPerTimeUnit> results) {
-                ListStatistics stat = new ListStatistics();
-                for (OpsPerTimeUnit r : results) {
-                    stat.addValue(r.getScore());
-                }
-
-                final long normalizedDuration = TimeUnit.MINUTES.toNanos(1);
-
-                ResultRole mode = null;
-                String label = null;
-                long operations = 0;
-                TimeUnit tu = null;
-                for (OpsPerTimeUnit r : results) {
-                    mode = r.role;
-                    tu = r.outputTimeUnit;
-                    label = r.label;
-
-                    // care about long overflow
-                    operations += Math.round(r.operations * (1.0 * normalizedDuration / r.durationNs));
-                }
-
-                return new OpsPerTimeUnit(mode, label, operations, normalizedDuration, tu, stat);
-            }
-        };
-    }
-
-    @Override
-    public Aggregator getRunAggregator() {
-        // compute mean
-        return new Aggregator<OpsPerTimeUnit>() {
-            @Override
-            public Result aggregate(Collection<OpsPerTimeUnit> results) {
-                ListStatistics stat = new ListStatistics();
-                for (OpsPerTimeUnit r : results) {
-                    stat.addValue(r.getScore());
-                }
-
-                final long normalizedDuration = TimeUnit.MINUTES.toNanos(1);
-
-                ResultRole role = null;
-                String label = null;
-                long operations = 0;
-                TimeUnit tu = null;
-                for (OpsPerTimeUnit r : results) {
-                    role = r.role;
-                    tu = r.outputTimeUnit;
-                    label = r.label;
-
-                    // care about long overflow
-                    operations += Math.round(r.operations * (1.0 * normalizedDuration / r.durationNs));
-                }
-                operations /= results.size();
-
-                return new OpsPerTimeUnit(role, label, operations, normalizedDuration, tu, stat);
-            }
-        };
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/logic/results/SampleTimePerOp.java	Sat Nov 09 10:26:22 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +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.logic.results;
-
-import org.openjdk.jmh.runner.parameters.TimeValue;
-import org.openjdk.jmh.util.internal.SampleBuffer;
-import org.openjdk.jmh.util.internal.Statistics;
-
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Result class that samples operation time.
- *
- * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
- */
-public class SampleTimePerOp extends Result {
-
-    /** Sample buffer */
-    private final SampleBuffer buffer;
-    /** The TimeUnit to use when calculating the score */
-    private final TimeUnit outputTimeUnit;
-
-    /** Sets up the result with the default output unit MilliSeconds */
-    public SampleTimePerOp(ResultRole mode, String label, SampleBuffer buffer) {
-        this(mode, label, buffer, TimeUnit.MILLISECONDS);
-    }
-
-    /**
-     * Sets up the result
-     *
-     * @param outputTimeUnit The TimeUnit to use when calculating the score
-     */
-    public SampleTimePerOp(ResultRole mode, String label, SampleBuffer buffer, TimeUnit outputTimeUnit) {
-        super(mode, label, null);
-        this.buffer = buffer;
-        this.outputTimeUnit = outputTimeUnit;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public String getScoreUnit() {
-        return TimeValue.tuToString(outputTimeUnit) + "/op";
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public double getScore() {
-        return convertNs(buffer.getStatistics().getMean());
-    }
-
-    @Override
-    public Statistics getStatistics() {
-        return buffer.getStatistics();
-    }
-
-    @Override
-    public Aggregator getIterationAggregator() {
-        return new JoiningAggregator();
-    }
-
-    @Override
-    public Aggregator getRunAggregator() {
-        return new JoiningAggregator();
-    }
-
-    @Override
-    public String toString() {
-        Statistics stats = buffer.getStatistics();
-
-        StringBuilder sb = new StringBuilder();
-        sb.append("n = ").append(stats.getN()).append(", ");
-        sb.append(String.format("mean = %.0f %s",
-                convertNs(stats.getMean()),
-                getScoreUnit()));
-        sb.append(String.format(", p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = %.0f, %.0f, %.0f, %.0f, %.0f, %.0f, %.0f, %.0f %s",
-                convertNs(stats.getPercentile(0)),
-                convertNs(stats.getPercentile(50)),
-                convertNs(stats.getPercentile(90)),
-                convertNs(stats.getPercentile(95)),
-                convertNs(stats.getPercentile(99)),
-                convertNs(stats.getPercentile(99.9)),
-                convertNs(stats.getPercentile(99.99)),
-                convertNs(stats.getPercentile(100)),
-                getScoreUnit()));
-        return sb.toString();
-    }
-
-    @Override
-    public String extendedInfo(String label) {
-        Statistics stats = buffer.getStatistics();
-
-        StringBuilder sb = new StringBuilder();
-        sb.append("Run result ").append((label == null) ? "" : "\"" + label + "\"").append(": \n");
-        sb.append("    samples = ").append(stats.getN()).append("\n");
-
-        if (stats.getN() > 2) {
-            double[] interval95 = stats.getConfidenceInterval(0.05);
-            double[] interval99 = stats.getConfidenceInterval(0.01);
-            sb.append(String.format("        mean = %10.3f \u00B1(95%%) %.3f \u00B1(99%%) %.3f",
-                    convertNs(stats.getMean()),
-                    convertNs((interval95[1] - interval95[0]) / 2),
-                    convertNs((interval99[1] - interval99[0]) / 2)
-            ));
-        } else {
-            sb.append(String.format("        mean = %10.3f (<= 2 iterations)",
-                    convertNs(stats.getMean())
-            ));
-        }
-        sb.append(" ").append(getScoreUnit()).append("\n");
-
-        sb.append(String.format("         min = %10.3f %s\n", convertNs(stats.getMin()), getScoreUnit()));
-
-        for (double p : new double[] {0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 0.99999, 0.999999}) {
-            sb.append(String.format("  %9s = %10.3f %s\n",
-                    "p(" + String.format("%7.4f", p*100) + ")",
-                    convertNs(stats.getPercentile(p*100)),
-                    getScoreUnit()
-            ));
-        }
-
-        sb.append(String.format("         max = %10.3f %s\n",  convertNs(stats.getMax()), getScoreUnit()));
-
-        return sb.toString();
-    }
-
-    private double convertNs(double time) {
-        return convert(time, TimeUnit.NANOSECONDS, outputTimeUnit);
-    }
-
-    public static double convert(double time, TimeUnit from, TimeUnit to) {
-        return time * to.convert(1, TimeUnit.DAYS) / from.convert(1, TimeUnit.DAYS);
-    }
-
-    /**
-     * Always add up all the samples into final result.
-     * This will allow aggregate result to achieve better accuracy.
-     */
-    public static class JoiningAggregator implements Aggregator<SampleTimePerOp> {
-
-        @Override
-        public Result aggregate(Collection<SampleTimePerOp> results) {
-            // generate new sample buffer
-            ResultRole mode = null;
-            String label = null;
-            SampleBuffer buffer = new SampleBuffer();
-            TimeUnit tu = null;
-            for (SampleTimePerOp r : results) {
-                tu = r.outputTimeUnit;
-                label = r.label;
-                buffer.addAll(r.buffer);
-            }
-
-            return new SampleTimePerOp(mode, label, buffer, tu);
-        }
-    }
-
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/logic/results/SampleTimeResult.java	Sat Nov 09 19:29:20 2013 +0100
@@ -0,0 +1,181 @@
+/*
+ * 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.logic.results;
+
+import org.openjdk.jmh.runner.parameters.TimeValue;
+import org.openjdk.jmh.util.internal.SampleBuffer;
+import org.openjdk.jmh.util.internal.Statistics;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Result class that samples operation time.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class SampleTimeResult extends Result {
+
+    /** Sample buffer */
+    private final SampleBuffer buffer;
+    /** The TimeUnit to use when calculating the score */
+    private final TimeUnit outputTimeUnit;
+
+    /** Sets up the result with the default output unit MilliSeconds */
+    public SampleTimeResult(ResultRole mode, String label, SampleBuffer buffer) {
+        this(mode, label, buffer, TimeUnit.MILLISECONDS);
+    }
+
+    /**
+     * Sets up the result
+     *
+     * @param outputTimeUnit The TimeUnit to use when calculating the score
+     */
+    public SampleTimeResult(ResultRole mode, String label, SampleBuffer buffer, TimeUnit outputTimeUnit) {
+        super(mode, label, null);
+        this.buffer = buffer;
+        this.outputTimeUnit = outputTimeUnit;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String getScoreUnit() {
+        return TimeValue.tuToString(outputTimeUnit) + "/op";
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public double getScore() {
+        return convertNs(buffer.getStatistics().getMean());
+    }
+
+    @Override
+    public Statistics getStatistics() {
+        return buffer.getStatistics();
+    }
+
+    @Override
+    public Aggregator getIterationAggregator() {
+        return new JoiningAggregator();
+    }
+
+    @Override
+    public Aggregator getRunAggregator() {
+        return new JoiningAggregator();
+    }
+
+    @Override
+    public String toString() {
+        Statistics stats = buffer.getStatistics();
+
+        StringBuilder sb = new StringBuilder();
+        sb.append("n = ").append(stats.getN()).append(", ");
+        sb.append(String.format("mean = %.0f %s",
+                convertNs(stats.getMean()),
+                getScoreUnit()));
+        sb.append(String.format(", p{0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 1.00} = %.0f, %.0f, %.0f, %.0f, %.0f, %.0f, %.0f, %.0f %s",
+                convertNs(stats.getPercentile(0)),
+                convertNs(stats.getPercentile(50)),
+                convertNs(stats.getPercentile(90)),
+                convertNs(stats.getPercentile(95)),
+                convertNs(stats.getPercentile(99)),
+                convertNs(stats.getPercentile(99.9)),
+                convertNs(stats.getPercentile(99.99)),
+                convertNs(stats.getPercentile(100)),
+                getScoreUnit()));
+        return sb.toString();
+    }
+
+    @Override
+    public String extendedInfo(String label) {
+        Statistics stats = buffer.getStatistics();
+
+        StringBuilder sb = new StringBuilder();
+        sb.append("Run result ").append((label == null) ? "" : "\"" + label + "\"").append(": \n");
+        sb.append("    samples = ").append(stats.getN()).append("\n");
+
+        if (stats.getN() > 2) {
+            double[] interval95 = stats.getConfidenceInterval(0.05);
+            double[] interval99 = stats.getConfidenceInterval(0.01);
+            sb.append(String.format("        mean = %10.3f \u00B1(95%%) %.3f \u00B1(99%%) %.3f",
+                    convertNs(stats.getMean()),
+                    convertNs((interval95[1] - interval95[0]) / 2),
+                    convertNs((interval99[1] - interval99[0]) / 2)
+            ));
+        } else {
+            sb.append(String.format("        mean = %10.3f (<= 2 iterations)",
+                    convertNs(stats.getMean())
+            ));
+        }
+        sb.append(" ").append(getScoreUnit()).append("\n");
+
+        sb.append(String.format("         min = %10.3f %s\n", convertNs(stats.getMin()), getScoreUnit()));
+
+        for (double p : new double[] {0.00, 0.50, 0.90, 0.95, 0.99, 0.999, 0.9999, 0.99999, 0.999999}) {
+            sb.append(String.format("  %9s = %10.3f %s\n",
+                    "p(" + String.format("%7.4f", p*100) + ")",
+                    convertNs(stats.getPercentile(p*100)),
+                    getScoreUnit()
+            ));
+        }
+
+        sb.append(String.format("         max = %10.3f %s\n",  convertNs(stats.getMax()), getScoreUnit()));
+
+        return sb.toString();
+    }
+
+    private double convertNs(double time) {
+        return convert(time, TimeUnit.NANOSECONDS, outputTimeUnit);
+    }
+
+    public static double convert(double time, TimeUnit from, TimeUnit to) {
+        return time * to.convert(1, TimeUnit.DAYS) / from.convert(1, TimeUnit.DAYS);
+    }
+
+    /**
+     * Always add up all the samples into final result.
+     * This will allow aggregate result to achieve better accuracy.
+     */
+    public static class JoiningAggregator implements Aggregator<SampleTimeResult> {
+
+        @Override
+        public Result aggregate(Collection<SampleTimeResult> results) {
+            // generate new sample buffer
+            ResultRole mode = null;
+            String label = null;
+            SampleBuffer buffer = new SampleBuffer();
+            TimeUnit tu = null;
+            for (SampleTimeResult r : results) {
+                tu = r.outputTimeUnit;
+                label = r.label;
+                buffer.addAll(r.buffer);
+            }
+
+            return new SampleTimeResult(mode, label, buffer, tu);
+        }
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/logic/results/SingleShotResult.java	Sat Nov 09 19:29:20 2013 +0100
@@ -0,0 +1,107 @@
+/*
+ * 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.logic.results;
+
+import org.openjdk.jmh.runner.parameters.TimeValue;
+import org.openjdk.jmh.util.internal.ListStatistics;
+import org.openjdk.jmh.util.internal.Statistics;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Result class that stores once operation execution time.
+ *
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ */
+public class SingleShotResult extends Result {
+
+    /** Duration of iteration in NanoSeconds */
+    private final long duration;
+    /** The TimeUnit to use when calculating the time */
+    private final TimeUnit outputTimeUnit;
+
+    /**
+     * Sets up the result
+     *
+     * @param duration       Duration of iteration in NanoSeconds
+     * @param outputTimeUnit The TimeUnit to use when calculating the score
+     */
+    public SingleShotResult(ResultRole mode, String label, long duration, TimeUnit outputTimeUnit) {
+        this(mode, label, duration, outputTimeUnit, null);
+    }
+
+    SingleShotResult(ResultRole mode, String label, long duration, TimeUnit outputTimeUnit, Statistics stat) {
+        super(mode, label, stat);
+        this.duration = duration;
+        this.outputTimeUnit = outputTimeUnit;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String getScoreUnit() {
+        return TimeValue.tuToString(outputTimeUnit);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public double getScore() {
+        return (duration / (double) outputTimeUnit.toNanos(1)) ;
+    }
+
+    @Override
+    public Aggregator getIterationAggregator() {
+        return new AveragingAggregator();
+    }
+
+    @Override
+    public Aggregator getRunAggregator() {
+        return new AveragingAggregator();
+    }
+
+    /**
+     * Averages the time on all levels.
+     */
+    public static class AveragingAggregator implements Aggregator<SingleShotResult> {
+        @Override
+        public Result aggregate(Collection<SingleShotResult> results) {
+            ResultRole role = null;
+            String label = null;
+            ListStatistics stat = new ListStatistics();
+            long duration = 0;
+            TimeUnit tu = null;
+            for (SingleShotResult r : results) {
+                role = r.role;
+                tu = r.outputTimeUnit;
+                label = r.label;
+                duration += r.duration;
+                stat.addValue(r.getScore());
+            }
+            return new SingleShotResult(role, label, duration / results.size(), tu, stat);
+        }
+
+    }
+
+}
--- a/jmh-core/src/main/java/org/openjdk/jmh/logic/results/SingleShotTime.java	Sat Nov 09 10:26:22 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +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.logic.results;
-
-import org.openjdk.jmh.runner.parameters.TimeValue;
-import org.openjdk.jmh.util.internal.ListStatistics;
-import org.openjdk.jmh.util.internal.Statistics;
-
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Result class that stores once operation execution time.
- *
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- */
-public class SingleShotTime extends Result {
-
-    /** Duration of iteration in NanoSeconds */
-    private final long duration;
-    /** The TimeUnit to use when calculating the time */
-    private final TimeUnit outputTimeUnit;
-
-    /**
-     * Sets up the result
-     *
-     * @param duration       Duration of iteration in NanoSeconds
-     * @param outputTimeUnit The TimeUnit to use when calculating the score
-     */
-    public SingleShotTime(ResultRole mode, String label, long duration, TimeUnit outputTimeUnit) {
-        this(mode, label, duration, outputTimeUnit, null);
-    }
-
-    SingleShotTime(ResultRole mode, String label, long duration, TimeUnit outputTimeUnit, Statistics stat) {
-        super(mode, label, stat);
-        this.duration = duration;
-        this.outputTimeUnit = outputTimeUnit;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public String getScoreUnit() {
-        return TimeValue.tuToString(outputTimeUnit);
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public double getScore() {
-        return (duration / (double) outputTimeUnit.toNanos(1)) ;
-    }
-
-    @Override
-    public Aggregator getIterationAggregator() {
-        return new AveragingAggregator();
-    }
-
-    @Override
-    public Aggregator getRunAggregator() {
-        return new AveragingAggregator();
-    }
-
-    /**
-     * Averages the time on all levels.
-     */
-    public static class AveragingAggregator implements Aggregator<SingleShotTime> {
-        @Override
-        public Result aggregate(Collection<SingleShotTime> results) {
-            ResultRole role = null;
-            String label = null;
-            ListStatistics stat = new ListStatistics();
-            long duration = 0;
-            TimeUnit tu = null;
-            for (SingleShotTime r : results) {
-                role = r.role;
-                tu = r.outputTimeUnit;
-                label = r.label;
-                duration += r.duration;
-                stat.addValue(r.getScore());
-            }
-            return new SingleShotTime(role, label, duration / results.size(), tu, stat);
-        }
-
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/logic/results/ThroughputResult.java	Sat Nov 09 19:29:20 2013 +0100
@@ -0,0 +1,151 @@
+/*
+ * 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.logic.results;
+
+import org.openjdk.jmh.runner.parameters.TimeValue;
+import org.openjdk.jmh.util.internal.ListStatistics;
+import org.openjdk.jmh.util.internal.Statistics;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Result class that counts the number of operations performed during a specified unit of time.
+ *
+ * @author staffan.friberg@oracle.com, anders.astrand@oracle.com
+ */
+public class ThroughputResult extends Result {
+
+    /** Total number of operations during iteration */
+    private final long operations;
+    /** Duration of iteration in NanoSeconds */
+    private final long durationNs;
+    /** The TimeUnit to use when calculating the score */
+    private final TimeUnit outputTimeUnit;
+
+    /**
+     * Sets up the result with the default output unit MilliSeconds
+     *
+     * @param operations Total number of operations during iteration
+     * @param durationNs   Duration of iteration in NanoSeconds
+     */
+    public ThroughputResult(ResultRole role, String label, long operations, long durationNs) {
+        this(role, label, operations, durationNs, TimeUnit.MILLISECONDS);
+    }
+
+    /**
+     * Sets up the result
+     *
+     * @param operations     Total number of operations during iteration
+     * @param durationNs       Duration of iteration in NanoSeconds
+     * @param outputTimeUnit The TimeUnit to use when calculating the score
+     */
+    public ThroughputResult(ResultRole role, String label, long operations, long durationNs, TimeUnit outputTimeUnit) {
+        this(role, label, operations, durationNs, outputTimeUnit, null);
+    }
+
+    ThroughputResult(ResultRole role, String label, long operations, long durationNs, TimeUnit outputTimeUnit, Statistics stats) {
+        super(role, label, stats);
+        this.operations = operations;
+        this.durationNs = durationNs;
+        this.outputTimeUnit = outputTimeUnit;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String getScoreUnit() {
+        return "ops/" + TimeValue.tuToString(outputTimeUnit);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public double getScore() {
+        return operations / (durationNs / (double) outputTimeUnit.toNanos(1));
+    }
+
+    @Override
+    public Aggregator getIterationAggregator() {
+        // compute sum
+        return new Aggregator<ThroughputResult>() {
+            @Override
+            public Result aggregate(Collection<ThroughputResult> results) {
+                ListStatistics stat = new ListStatistics();
+                for (ThroughputResult r : results) {
+                    stat.addValue(r.getScore());
+                }
+
+                final long normalizedDuration = TimeUnit.MINUTES.toNanos(1);
+
+                ResultRole mode = null;
+                String label = null;
+                long operations = 0;
+                TimeUnit tu = null;
+                for (ThroughputResult r : results) {
+                    mode = r.role;
+                    tu = r.outputTimeUnit;
+                    label = r.label;
+
+                    // care about long overflow
+                    operations += Math.round(r.operations * (1.0 * normalizedDuration / r.durationNs));
+                }
+
+                return new ThroughputResult(mode, label, operations, normalizedDuration, tu, stat);
+            }
+        };
+    }
+
+    @Override
+    public Aggregator getRunAggregator() {
+        // compute mean
+        return new Aggregator<ThroughputResult>() {
+            @Override
+            public Result aggregate(Collection<ThroughputResult> results) {
+                ListStatistics stat = new ListStatistics();
+                for (ThroughputResult r : results) {
+                    stat.addValue(r.getScore());
+                }
+
+                final long normalizedDuration = TimeUnit.MINUTES.toNanos(1);
+
+                ResultRole role = null;
+                String label = null;
+                long operations = 0;
+                TimeUnit tu = null;
+                for (ThroughputResult r : results) {
+                    role = r.role;
+                    tu = r.outputTimeUnit;
+                    label = r.label;
+
+                    // care about long overflow
+                    operations += Math.round(r.operations * (1.0 * normalizedDuration / r.durationNs));
+                }
+                operations /= results.size();
+
+                return new ThroughputResult(role, label, operations, normalizedDuration, tu, stat);
+            }
+        };
+    }
+
+}
--- a/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Sat Nov 09 10:26:22 2013 +0100
+++ b/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Sat Nov 09 19:29:20 2013 +0100
@@ -38,13 +38,13 @@
 import org.openjdk.jmh.annotations.Warmup;
 import org.openjdk.jmh.logic.BlackHole;
 import org.openjdk.jmh.logic.InfraControl;
-import org.openjdk.jmh.logic.results.AverageTimePerOp;
-import org.openjdk.jmh.logic.results.OpsPerTimeUnit;
+import org.openjdk.jmh.logic.results.AverageTimeResult;
 import org.openjdk.jmh.logic.results.RawResults;
 import org.openjdk.jmh.logic.results.Result;
 import org.openjdk.jmh.logic.results.ResultRole;
-import org.openjdk.jmh.logic.results.SampleTimePerOp;
-import org.openjdk.jmh.logic.results.SingleShotTime;
+import org.openjdk.jmh.logic.results.SampleTimeResult;
+import org.openjdk.jmh.logic.results.SingleShotResult;
+import org.openjdk.jmh.logic.results.ThroughputResult;
 import org.openjdk.jmh.runner.MicroBenchmarkList;
 import org.openjdk.jmh.util.AnnotationUtils;
 import org.openjdk.jmh.util.internal.CollectionUtils;
@@ -398,10 +398,10 @@
         writer.println("import " + InfraControl.class.getName() + ';');
         writer.println("import " + BlackHole.class.getName() + ';');
         writer.println("import " + Result.class.getName() + ';');
-        writer.println("import " + OpsPerTimeUnit.class.getName() + ';');
-        writer.println("import " + AverageTimePerOp.class.getName() + ';');
-        writer.println("import " + SampleTimePerOp.class.getName() + ';');
-        writer.println("import " + SingleShotTime.class.getName() + ';');
+        writer.println("import " + ThroughputResult.class.getName() + ';');
+        writer.println("import " + AverageTimeResult.class.getName() + ';');
+        writer.println("import " + SampleTimeResult.class.getName() + ';');
+        writer.println("import " + SingleShotResult.class.getName() + ';');
         writer.println("import " + SampleBuffer.class.getName() + ';');
         writer.println("import " + Mode.class.getName() + ';');
         writer.println("import " + Fork.class.getName() + ';');
@@ -484,16 +484,16 @@
         final TimeUnit timeUnit = findTimeUnit(methodGroup);
         switch (benchmarkKind) {
             case Throughput:
-                generateOpsPerTimeUnit(writer, benchmarkKind, methodGroup, getOperationsPerInvocation(methodGroup), timeUnit, states);
+                generateThroughput(writer, benchmarkKind, methodGroup, getOperationsPerInvocation(methodGroup), timeUnit, states);
                 break;
             case AverageTime:
                 generateAverageTime(writer, benchmarkKind, methodGroup, getOperationsPerInvocation(methodGroup), timeUnit, states);
                 break;
             case SampleTime:
-                generateTimeDistribution(writer, benchmarkKind, methodGroup, timeUnit, states);
+                generateSampleTime(writer, benchmarkKind, methodGroup, timeUnit, states);
                 break;
             case SingleShotTime:
-                generateSingleShot(writer, benchmarkKind, methodGroup, timeUnit, states);
+                generateSingleShotTime(writer, benchmarkKind, methodGroup, timeUnit, states);
                 break;
             default:
                 throw new AssertionError("Shouldn't be here");
@@ -655,7 +655,7 @@
         }
     }
 
-    private void generateOpsPerTimeUnit(PrintWriter writer, Mode benchmarkKind, MethodGroup methodGroup, long opsPerInv, TimeUnit timeUnit, StateObjectHandler states) {
+    private void generateThroughput(PrintWriter writer, Mode benchmarkKind, MethodGroup methodGroup, long opsPerInv, TimeUnit timeUnit, StateObjectHandler states) {
         writer.println(ident(1) + "public Result " + methodGroup.getName() + "_" + benchmarkKind + "(InfraControl control) throws Throwable { ");
         writer.println();
 
@@ -720,7 +720,7 @@
             iterationEpilog(writer, 3, method, states);
 
             ResultRole mode = isSingleMethod ? ResultRole.PRIMARY : ResultRole.BOTH;
-            writer.println(ident(3) + "return new OpsPerTimeUnit(ResultRole." + mode + ", \"" + method.getSimpleName() + "\", res.getOperations(), res.getTime(), (control.timeUnit != null) ? control.timeUnit : TimeUnit." + timeUnit + ");");
+            writer.println(ident(3) + "return new ThroughputResult(ResultRole." + mode + ", \"" + method.getSimpleName() + "\", res.getOperations(), res.getTime(), (control.timeUnit != null) ? control.timeUnit : TimeUnit." + timeUnit + ");");
             writer.println(ident(2) + "} else");
         }
         writer.println(ident(3) + "throw new IllegalStateException(\"Harness failed to distribute threads among groups properly\");");
@@ -814,7 +814,7 @@
             iterationEpilog(writer, 3, method, states);
 
             ResultRole mode = isSingleMethod ? ResultRole.PRIMARY : ResultRole.BOTH;
-            writer.println(ident(3) + "return new AverageTimePerOp(ResultRole." + mode + ", \"" + method.getSimpleName() + "\", res.getOperations(), res.getTime(), (control.timeUnit != null) ? control.timeUnit : TimeUnit." + timeUnit + ");");
+            writer.println(ident(3) + "return new AverageTimeResult(ResultRole." + mode + ", \"" + method.getSimpleName() + "\", res.getOperations(), res.getTime(), (control.timeUnit != null) ? control.timeUnit : TimeUnit." + timeUnit + ");");
             writer.println(ident(2) + "} else");
         }
         writer.println(ident(3) + "throw new IllegalStateException(\"Harness failed to distribute threads among groups properly\");");
@@ -865,7 +865,7 @@
         }
     }
 
-    private void generateTimeDistribution(PrintWriter writer, Mode benchmarkKind, MethodGroup methodGroup, TimeUnit timeUnit, StateObjectHandler states) {
+    private void generateSampleTime(PrintWriter writer, Mode benchmarkKind, MethodGroup methodGroup, TimeUnit timeUnit, StateObjectHandler states) {
         writer.println(ident(1) + "public Result " + methodGroup.getName() + "_" + benchmarkKind + "(InfraControl control) throws Throwable { ");
         writer.println();
 
@@ -928,7 +928,7 @@
             iterationEpilog(writer, 3, method, states);
 
             ResultRole mode = isSingleMethod ? ResultRole.PRIMARY : ResultRole.BOTH;
-            writer.println(ident(3) + "return new SampleTimePerOp(ResultRole." + mode + ", \"" + method.getSimpleName() + "\", buffer, (control.timeUnit != null) ? control.timeUnit : TimeUnit." + timeUnit + ");");
+            writer.println(ident(3) + "return new SampleTimeResult(ResultRole." + mode + ", \"" + method.getSimpleName() + "\", buffer, (control.timeUnit != null) ? control.timeUnit : TimeUnit." + timeUnit + ");");
             writer.println(ident(2) + "} else");
         }
         writer.println(ident(3) + "throw new IllegalStateException(\"Harness failed to distribute threads among groups properly\");");
@@ -971,7 +971,7 @@
         }
     }
 
-    private void generateSingleShot(PrintWriter writer, Mode benchmarkKind, MethodGroup methodGroup, TimeUnit timeUnit, StateObjectHandler states) {
+    private void generateSingleShotTime(PrintWriter writer, Mode benchmarkKind, MethodGroup methodGroup, TimeUnit timeUnit, StateObjectHandler states) {
         writer.println(ident(1) + "public Result " + methodGroup.getName() + "_" + benchmarkKind + "(InfraControl control) throws Throwable { ");
 
         methodProlog(writer, methodGroup);
@@ -1003,7 +1003,7 @@
             iterationEpilog(writer, 3, method, states);
 
             ResultRole mode = isSingleMethod ? ResultRole.PRIMARY : ResultRole.BOTH;
-            writer.println(ident(3) + "return new SingleShotTime(ResultRole." + mode + ",\"" + method.getSimpleName() + "\", (realTime > 0) ? realTime : (time2 - time1), (control.timeUnit != null) ? control.timeUnit : TimeUnit." + timeUnit + ");");
+            writer.println(ident(3) + "return new SingleShotResult(ResultRole." + mode + ",\"" + method.getSimpleName() + "\", (realTime > 0) ? realTime : (time2 - time1), (control.timeUnit != null) ? control.timeUnit : TimeUnit." + timeUnit + ");");
             writer.println(ident(2) + "} else");
         }
         writer.println(ident(3) + "throw new IllegalStateException(\"Harness failed to distribute threads among groups properly\");");
--- a/jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestAggregateResult.java	Sat Nov 09 10:26:22 2013 +0100
+++ b/jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestAggregateResult.java	Sat Nov 09 19:29:20 2013 +0100
@@ -48,7 +48,7 @@
     public static void setupClass() {
         result = new IterationResult(new BenchmarkRecord("blah,blah," + Mode.AverageTime), new IterationParams(1, TimeValue.days(1), 1));
         for (double d : values) {
-            result.addResult(new OpsPerTimeUnit(ResultRole.BOTH, "test1", (long) d, 10 * 1000 * 1000));
+            result.addResult(new ThroughputResult(ResultRole.BOTH, "test1", (long) d, 10 * 1000 * 1000));
         }
     }
 
@@ -59,7 +59,7 @@
 
     @Test
     public void testScoreUnit() throws Exception {
-        assertEquals((new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1, 1)).getScoreUnit(), result.getScoreUnit());
+        assertEquals((new ThroughputResult(ResultRole.BOTH, "test1", 1, 1)).getScoreUnit(), result.getScoreUnit());
     }
 
 }
--- a/jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestAverageTimePerOp.java	Sat Nov 09 10:26:22 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +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.logic.results;
-
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- *
- * @author aleksey.shipilev@oracle.com
- */
-public class TestAverageTimePerOp {
-
-    @Test
-    public void testRunAggregator1() {
-        AverageTimePerOp r1 = new AverageTimePerOp(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
-        AverageTimePerOp r2 = new AverageTimePerOp(ResultRole.BOTH, "test1", 1000L, 2000000L, TimeUnit.MICROSECONDS);
-        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(1.5, result.getScore());
-        assertEquals("us/op", result.getScoreUnit());
-    }
-
-    @Test
-    public void testRunAggregator2() {
-        AverageTimePerOp r1 = new AverageTimePerOp(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
-        AverageTimePerOp r2 = new AverageTimePerOp(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
-        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(1.0, result.getScore());
-        assertEquals("us/op", result.getScoreUnit());
-    }
-
-    @Test
-    public void testIterationAggregator1() {
-        AverageTimePerOp r1 = new AverageTimePerOp(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
-        AverageTimePerOp r2 = new AverageTimePerOp(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
-        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(1.0, result.getScore());
-        assertEquals("us/op", result.getScoreUnit());
-    }
-
-    @Test
-    public void testIterationAggregator2() {
-        AverageTimePerOp r1 = new AverageTimePerOp(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
-        AverageTimePerOp r2 = new AverageTimePerOp(ResultRole.BOTH, "test1", 1000L, 2000000L, TimeUnit.MICROSECONDS);
-        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(1.5, result.getScore());
-        assertEquals("us/op", result.getScoreUnit());
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestAverageTimeResult.java	Sat Nov 09 19:29:20 2013 +0100
@@ -0,0 +1,79 @@
+/*
+ * 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.logic.results;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.concurrent.TimeUnit;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ *
+ * @author aleksey.shipilev@oracle.com
+ */
+public class TestAverageTimeResult {
+
+    @Test
+    public void testRunAggregator1() {
+        AverageTimeResult r1 = new AverageTimeResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
+        AverageTimeResult r2 = new AverageTimeResult(ResultRole.BOTH, "test1", 1000L, 2000000L, TimeUnit.MICROSECONDS);
+        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(1.5, result.getScore());
+        assertEquals("us/op", result.getScoreUnit());
+    }
+
+    @Test
+    public void testRunAggregator2() {
+        AverageTimeResult r1 = new AverageTimeResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
+        AverageTimeResult r2 = new AverageTimeResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
+        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(1.0, result.getScore());
+        assertEquals("us/op", result.getScoreUnit());
+    }
+
+    @Test
+    public void testIterationAggregator1() {
+        AverageTimeResult r1 = new AverageTimeResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
+        AverageTimeResult r2 = new AverageTimeResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
+        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(1.0, result.getScore());
+        assertEquals("us/op", result.getScoreUnit());
+    }
+
+    @Test
+    public void testIterationAggregator2() {
+        AverageTimeResult r1 = new AverageTimeResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
+        AverageTimeResult r2 = new AverageTimeResult(ResultRole.BOTH, "test1", 1000L, 2000000L, TimeUnit.MICROSECONDS);
+        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(1.5, result.getScore());
+        assertEquals("us/op", result.getScoreUnit());
+    }
+}
--- a/jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestOpsPerTimeUnit.java	Sat Nov 09 10:26:22 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +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.logic.results;
-
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- *
- * @author staffan.friberg@oracle.com
- */
-public class TestOpsPerTimeUnit {
-
-    /**
-     * Test of getScore method, of class OpsPerTimeUnit.
-     */
-    @Test
-    public void testGetScore() {
-        OpsPerTimeUnit instance = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 1000000L);
-        assertEquals(1000, instance.getScore(), 0.0);
-        OpsPerTimeUnit instance2 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.SECONDS);
-        assertEquals(1000000, instance2.getScore(), 0.0);
-        OpsPerTimeUnit instance3 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 1000L);
-        assertEquals(1000 / (1000 / (double) 1000000), instance3.getScore(), 0.0);
-    }
-
-    @Test
-    public void testTimeUnits() {
-        OpsPerTimeUnit instanced = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.DAYS);
-        assertEquals(86400000000D, instanced.getScore(), 0.0);
-        assertEquals("ops/day", instanced.getScoreUnit());
-
-        OpsPerTimeUnit instanceh = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.HOURS);
-        assertEquals(3600000000.0000005D, instanceh.getScore(), 0.0);
-        assertEquals("ops/hr", instanceh.getScoreUnit());
-
-        OpsPerTimeUnit instancem = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MINUTES);
-        assertEquals(60000000, instancem.getScore(), 0.0);
-        assertEquals("ops/min", instancem.getScoreUnit());
-
-        OpsPerTimeUnit instance = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.SECONDS);
-        assertEquals(1000000, instance.getScore(), 0.0);
-        assertEquals("ops/s", instance.getScoreUnit());
-
-        OpsPerTimeUnit instance2 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MILLISECONDS);
-        assertEquals(1000, instance2.getScore(), 0.0);
-        assertEquals("ops/ms", instance2.getScoreUnit());
-
-        OpsPerTimeUnit instance3 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
-        assertEquals(1, instance3.getScore(), 0.0);
-        assertEquals("ops/us", instance3.getScoreUnit());
-
-        OpsPerTimeUnit instance4 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.NANOSECONDS);
-        assertEquals(0.001, instance4.getScore(), 0.0);
-        assertEquals("ops/ns", instance4.getScoreUnit());
-    }
-
-    @Test
-    public void testRunAggregator1() {
-        OpsPerTimeUnit r1 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 10000000L, TimeUnit.MILLISECONDS);
-        OpsPerTimeUnit r2 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 2000L, 10000000L, TimeUnit.MILLISECONDS);
-        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(150.0, result.getScore());
-        assertEquals("ops/ms", result.getScoreUnit());
-    }
-
-    @Test
-    public void testRunAggregator2() {
-        OpsPerTimeUnit r1 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 10000000L, TimeUnit.MILLISECONDS);
-        OpsPerTimeUnit r2 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 2000L, 20000000L, TimeUnit.MILLISECONDS);
-        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(100.0, result.getScore());
-        assertEquals("ops/ms", result.getScoreUnit());
-    }
-
-    @Test // regression test, check for overflow
-    public void testRunAggregator3() {
-        OpsPerTimeUnit r1 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000000000L, 10000000L, TimeUnit.MILLISECONDS);
-        OpsPerTimeUnit r2 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 2000000000L, 20000000L, TimeUnit.MILLISECONDS);
-        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(100000000.0, result.getScore());
-        assertEquals("ops/ms", result.getScoreUnit());
-    }
-
-    @Test
-    public void testIterationAggregator1() {
-        OpsPerTimeUnit r1 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 10000000L, TimeUnit.MILLISECONDS);
-        OpsPerTimeUnit r2 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 2000L, 10000000L, TimeUnit.MILLISECONDS);
-        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals("ops/ms", result.getScoreUnit());
-        assertEquals(300.0, result.getScore());
-    }
-
-    @Test
-    public void testIterationAggregator2() {
-        OpsPerTimeUnit r1 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000L, 10000000L, TimeUnit.MILLISECONDS);
-        OpsPerTimeUnit r2 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 2000L, 20000000L, TimeUnit.MILLISECONDS);
-        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals("ops/ms", result.getScoreUnit());
-        assertEquals(200.0, result.getScore());
-    }
-
-    @Test  // regression test, check for overflow
-    public void testIterationAggregator3() {
-        OpsPerTimeUnit r1 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 1000000000L, 10000000L, TimeUnit.MILLISECONDS);
-        OpsPerTimeUnit r2 = new OpsPerTimeUnit(ResultRole.BOTH, "test1", 2000000000L, 20000000L, TimeUnit.MILLISECONDS);
-        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals("ops/ms", result.getScoreUnit());
-        assertEquals(200000000.0, result.getScore());
-    }
-}
--- a/jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestSampleTimePerOp.java	Sat Nov 09 10:26:22 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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.logic.results;
-
-import org.junit.Test;
-import org.openjdk.jmh.util.internal.SampleBuffer;
-
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- *
- * @author aleksey.shipilev@oracle.com
- */
-public class TestSampleTimePerOp {
-
-    @Test
-    public void testRunAggregator1() {
-        SampleBuffer b1 = new SampleBuffer();
-        b1.add(1000);
-        b1.add(2000);
-
-        SampleBuffer b2 = new SampleBuffer();
-        b2.add(3000);
-        b2.add(4000);
-
-        SampleTimePerOp r1 = new SampleTimePerOp(ResultRole.BOTH, "Test1", b1, TimeUnit.MICROSECONDS);
-        SampleTimePerOp r2 = new SampleTimePerOp(ResultRole.BOTH, "Test1", b2, TimeUnit.MICROSECONDS);
-        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(2.5, result.getScore());
-        assertEquals("us/op", result.getScoreUnit());
-    }
-
-    @Test
-    public void testIterationAggregator1() {
-        SampleBuffer b1 = new SampleBuffer();
-        b1.add(1000);
-        b1.add(2000);
-
-        SampleBuffer b2 = new SampleBuffer();
-        b2.add(3000);
-        b2.add(4000);
-
-        SampleTimePerOp r1 = new SampleTimePerOp(ResultRole.BOTH, "Test1", b1, TimeUnit.MICROSECONDS);
-        SampleTimePerOp r2 = new SampleTimePerOp(ResultRole.BOTH, "Test1", b2, TimeUnit.MICROSECONDS);
-        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(2.5, result.getScore());
-        assertEquals("us/op", result.getScoreUnit());
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestSampleTimeResult.java	Sat Nov 09 19:29:20 2013 +0100
@@ -0,0 +1,77 @@
+/*
+ * 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.logic.results;
+
+import org.junit.Test;
+import org.openjdk.jmh.util.internal.SampleBuffer;
+
+import java.util.Arrays;
+import java.util.concurrent.TimeUnit;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ *
+ * @author aleksey.shipilev@oracle.com
+ */
+public class TestSampleTimeResult {
+
+    @Test
+    public void testRunAggregator1() {
+        SampleBuffer b1 = new SampleBuffer();
+        b1.add(1000);
+        b1.add(2000);
+
+        SampleBuffer b2 = new SampleBuffer();
+        b2.add(3000);
+        b2.add(4000);
+
+        SampleTimeResult r1 = new SampleTimeResult(ResultRole.BOTH, "Test1", b1, TimeUnit.MICROSECONDS);
+        SampleTimeResult r2 = new SampleTimeResult(ResultRole.BOTH, "Test1", b2, TimeUnit.MICROSECONDS);
+        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(2.5, result.getScore());
+        assertEquals("us/op", result.getScoreUnit());
+    }
+
+    @Test
+    public void testIterationAggregator1() {
+        SampleBuffer b1 = new SampleBuffer();
+        b1.add(1000);
+        b1.add(2000);
+
+        SampleBuffer b2 = new SampleBuffer();
+        b2.add(3000);
+        b2.add(4000);
+
+        SampleTimeResult r1 = new SampleTimeResult(ResultRole.BOTH, "Test1", b1, TimeUnit.MICROSECONDS);
+        SampleTimeResult r2 = new SampleTimeResult(ResultRole.BOTH, "Test1", b2, TimeUnit.MICROSECONDS);
+        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(2.5, result.getScore());
+        assertEquals("us/op", result.getScoreUnit());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestSingleShotResult.java	Sat Nov 09 19:29:20 2013 +0100
@@ -0,0 +1,60 @@
+/*
+ * 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.logic.results;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.concurrent.TimeUnit;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ *
+ * @author aleksey.shipilev@oracle.com
+ */
+public class TestSingleShotResult {
+
+    @Test
+    public void testRunAggregator1() {
+        SingleShotResult r1 = new SingleShotResult(ResultRole.BOTH, "Test1", 1000L, TimeUnit.MICROSECONDS);
+        SingleShotResult r2 = new SingleShotResult(ResultRole.BOTH, "Test1", 2000L, TimeUnit.MICROSECONDS);
+        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(1.5, result.getScore());
+        assertEquals("us", result.getScoreUnit());
+    }
+
+    @Test
+    public void testIterationAggregator1() {
+        SingleShotResult r1 = new SingleShotResult(ResultRole.BOTH, "Test1", 1000L, TimeUnit.MICROSECONDS);
+        SingleShotResult r2 = new SingleShotResult(ResultRole.BOTH, "Test1", 2000L, TimeUnit.MICROSECONDS);
+        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(1.5, result.getScore());
+        assertEquals("us", result.getScoreUnit());
+    }
+
+}
--- a/jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestSingleShotTime.java	Sat Nov 09 10:26:22 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +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.logic.results;
-
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- *
- * @author aleksey.shipilev@oracle.com
- */
-public class TestSingleShotTime {
-
-    @Test
-    public void testRunAggregator1() {
-        SingleShotTime r1 = new SingleShotTime(ResultRole.BOTH, "Test1", 1000L, TimeUnit.MICROSECONDS);
-        SingleShotTime r2 = new SingleShotTime(ResultRole.BOTH, "Test1", 2000L, TimeUnit.MICROSECONDS);
-        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(1.5, result.getScore());
-        assertEquals("us", result.getScoreUnit());
-    }
-
-    @Test
-    public void testIterationAggregator1() {
-        SingleShotTime r1 = new SingleShotTime(ResultRole.BOTH, "Test1", 1000L, TimeUnit.MICROSECONDS);
-        SingleShotTime r2 = new SingleShotTime(ResultRole.BOTH, "Test1", 2000L, TimeUnit.MICROSECONDS);
-        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
-
-        assertEquals(1.5, result.getScore());
-        assertEquals("us", result.getScoreUnit());
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/test/java/org/openjdk/jmh/logic/results/TestThroughputResult.java	Sat Nov 09 19:29:20 2013 +0100
@@ -0,0 +1,143 @@
+/*
+ * 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.logic.results;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.concurrent.TimeUnit;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ *
+ * @author staffan.friberg@oracle.com
+ */
+public class TestThroughputResult {
+
+    /**
+     * Test of getScore method, of class ThroughputResult.
+     */
+    @Test
+    public void testGetScore() {
+        ThroughputResult instance = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 1000000L);
+        assertEquals(1000, instance.getScore(), 0.0);
+        ThroughputResult instance2 = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.SECONDS);
+        assertEquals(1000000, instance2.getScore(), 0.0);
+        ThroughputResult instance3 = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 1000L);
+        assertEquals(1000 / (1000 / (double) 1000000), instance3.getScore(), 0.0);
+    }
+
+    @Test
+    public void testTimeUnits() {
+        ThroughputResult instanced = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.DAYS);
+        assertEquals(86400000000D, instanced.getScore(), 0.0);
+        assertEquals("ops/day", instanced.getScoreUnit());
+
+        ThroughputResult instanceh = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.HOURS);
+        assertEquals(3600000000.0000005D, instanceh.getScore(), 0.0);
+        assertEquals("ops/hr", instanceh.getScoreUnit());
+
+        ThroughputResult instancem = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MINUTES);
+        assertEquals(60000000, instancem.getScore(), 0.0);
+        assertEquals("ops/min", instancem.getScoreUnit());
+
+        ThroughputResult instance = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.SECONDS);
+        assertEquals(1000000, instance.getScore(), 0.0);
+        assertEquals("ops/s", instance.getScoreUnit());
+
+        ThroughputResult instance2 = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MILLISECONDS);
+        assertEquals(1000, instance2.getScore(), 0.0);
+        assertEquals("ops/ms", instance2.getScoreUnit());
+
+        ThroughputResult instance3 = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.MICROSECONDS);
+        assertEquals(1, instance3.getScore(), 0.0);
+        assertEquals("ops/us", instance3.getScoreUnit());
+
+        ThroughputResult instance4 = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 1000000L, TimeUnit.NANOSECONDS);
+        assertEquals(0.001, instance4.getScore(), 0.0);
+        assertEquals("ops/ns", instance4.getScoreUnit());
+    }
+
+    @Test
+    public void testRunAggregator1() {
+        ThroughputResult r1 = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 10000000L, TimeUnit.MILLISECONDS);
+        ThroughputResult r2 = new ThroughputResult(ResultRole.BOTH, "test1", 2000L, 10000000L, TimeUnit.MILLISECONDS);
+        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(150.0, result.getScore());
+        assertEquals("ops/ms", result.getScoreUnit());
+    }
+
+    @Test
+    public void testRunAggregator2() {
+        ThroughputResult r1 = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 10000000L, TimeUnit.MILLISECONDS);
+        ThroughputResult r2 = new ThroughputResult(ResultRole.BOTH, "test1", 2000L, 20000000L, TimeUnit.MILLISECONDS);
+        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(100.0, result.getScore());
+        assertEquals("ops/ms", result.getScoreUnit());
+    }
+
+    @Test // regression test, check for overflow
+    public void testRunAggregator3() {
+        ThroughputResult r1 = new ThroughputResult(ResultRole.BOTH, "test1", 1000000000L, 10000000L, TimeUnit.MILLISECONDS);
+        ThroughputResult r2 = new ThroughputResult(ResultRole.BOTH, "test1", 2000000000L, 20000000L, TimeUnit.MILLISECONDS);
+        Result result = r1.getRunAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals(100000000.0, result.getScore());
+        assertEquals("ops/ms", result.getScoreUnit());
+    }
+
+    @Test
+    public void testIterationAggregator1() {
+        ThroughputResult r1 = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 10000000L, TimeUnit.MILLISECONDS);
+        ThroughputResult r2 = new ThroughputResult(ResultRole.BOTH, "test1", 2000L, 10000000L, TimeUnit.MILLISECONDS);
+        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals("ops/ms", result.getScoreUnit());
+        assertEquals(300.0, result.getScore());
+    }
+
+    @Test
+    public void testIterationAggregator2() {
+        ThroughputResult r1 = new ThroughputResult(ResultRole.BOTH, "test1", 1000L, 10000000L, TimeUnit.MILLISECONDS);
+        ThroughputResult r2 = new ThroughputResult(ResultRole.BOTH, "test1", 2000L, 20000000L, TimeUnit.MILLISECONDS);
+        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals("ops/ms", result.getScoreUnit());
+        assertEquals(200.0, result.getScore());
+    }
+
+    @Test  // regression test, check for overflow
+    public void testIterationAggregator3() {
+        ThroughputResult r1 = new ThroughputResult(ResultRole.BOTH, "test1", 1000000000L, 10000000L, TimeUnit.MILLISECONDS);
+        ThroughputResult r2 = new ThroughputResult(ResultRole.BOTH, "test1", 2000000000L, 20000000L, TimeUnit.MILLISECONDS);
+        Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
+
+        assertEquals("ops/ms", result.getScoreUnit());
+        assertEquals(200000000.0, result.getScore());
+    }
+}