changeset 1182:f028eef1340d

7901371: InternalProfilers should have access to operation counts
author shade
date Sun, 05 Apr 2015 13:26:25 +0300
parents b5ae6d3daf87
children 9d111323b1fa
files jmh-core-it/src/test/java/org/openjdk/jmh/it/profilers/ItInternalProfiler.java jmh-core-it/src/test/java/org/openjdk/jmh/it/profilers/order/AbstractInternalProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractHotspotProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/ClassloaderProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/CompilerProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotCompilationProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotRuntimeProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotThreadProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/InternalProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/StackProfiler.java jmh-core/src/main/java/org/openjdk/jmh/results/IterationResult.java jmh-core/src/main/java/org/openjdk/jmh/results/IterationResultMetaData.java jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java jmh-core/src/main/java/org/openjdk/jmh/runner/BenchmarkHandler.java jmh-core/src/test/java/org/openjdk/jmh/results/ResultAggregationTest.java jmh-core/src/test/java/org/openjdk/jmh/results/TestAggregateResult.java jmh-core/src/test/java/org/openjdk/jmh/results/format/ResultFormatTest.java
diffstat 18 files changed, 112 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/profilers/ItInternalProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/profilers/ItInternalProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -27,6 +27,7 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.profile.InternalProfiler;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 
 import java.util.Collection;
@@ -41,7 +42,7 @@
     }
 
     @Override
-    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
+    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result) {
         return Collections.emptyList();
     }
 
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/profilers/order/AbstractInternalProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/profilers/order/AbstractInternalProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -27,6 +27,7 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.profile.InternalProfiler;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 
 import java.util.Arrays;
@@ -54,7 +55,7 @@
     }
 
     @Override
-    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
+    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result) {
         stop = System.nanoTime();
         try {
             TimeUnit.MILLISECONDS.sleep(100);
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractHotspotProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractHotspotProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -27,6 +27,7 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.AggregationPolicy;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 import sun.management.counter.Counter;
 
@@ -64,7 +65,7 @@
     }
 
     @Override
-    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
+    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result) {
         HotspotInternalResult res = counters();
         Collection<ProfilerResult> results = new ArrayList<ProfilerResult>();
         for (Map.Entry<String, Long> e : res.getDiff().entrySet()) {
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/ClassloaderProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/ClassloaderProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -27,6 +27,7 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.AggregationPolicy;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 
 import java.lang.management.ClassLoadingMXBean;
@@ -71,7 +72,7 @@
     }
 
     @Override
-    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
+    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result) {
         long loaded;
         long unloaded;
         ClassLoadingMXBean cl = ManagementFactory.getClassLoadingMXBean();
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/CompilerProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/CompilerProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -27,6 +27,7 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.AggregationPolicy;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 
 import java.lang.management.CompilationMXBean;
@@ -71,7 +72,7 @@
     }
 
     @Override
-    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
+    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result) {
         long compTime = -startCompTime;
         CompilationMXBean comp = ManagementFactory.getCompilationMXBean();
         try {
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -27,6 +27,7 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.AggregationPolicy;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 
 import java.lang.management.GarbageCollectorMXBean;
@@ -67,7 +68,7 @@
     }
 
     @Override
-    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
+    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result) {
         long gcTime = 0;
         long gcCount = 0;
         for (GarbageCollectorMXBean bean : ManagementFactory.getGarbageCollectorMXBeans()) {
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotCompilationProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotCompilationProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -27,6 +27,7 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.AggregationPolicy;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 import sun.management.HotspotCompilationMBean;
 import sun.management.counter.Counter;
@@ -55,7 +56,7 @@
     }
 
     @Override
-    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
+    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result) {
         Map<String, Long> current = counters().getCurrent();
         return Arrays.asList(
                 new ProfilerResult(Defaults.PREFIX + "compiler.totalTime",
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotRuntimeProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotRuntimeProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -27,6 +27,7 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.AggregationPolicy;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 import sun.management.HotspotRuntimeMBean;
 import sun.management.counter.Counter;
@@ -55,7 +56,7 @@
     }
 
     @Override
-    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
+    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result) {
         Map<String, Long> current = counters().getCurrent();
         return Arrays.asList(
                 new ProfilerResult(Defaults.PREFIX + "rt.sync.fatMonitors",
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotThreadProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotThreadProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -27,6 +27,7 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.AggregationPolicy;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 import sun.management.HotspotThreadMBean;
 import sun.management.counter.Counter;
@@ -54,7 +55,7 @@
     }
 
     @Override
-    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
+    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result) {
         Map<String, Long> current = counters().getCurrent();
         return Arrays.asList(
                 new ProfilerResult(Defaults.PREFIX + "threads.alive",
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/InternalProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/InternalProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -26,6 +26,7 @@
 
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 
 import java.util.Collection;
@@ -51,8 +52,9 @@
      *
      * @param benchmarkParams benchmark parameters used for current launch
      * @param iterationParams iteration parameters used for current launch
-     * @return profiler result
+     * @param result iteration result
+     * @return profiler results
      */
-    Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams);
+    Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result);
 
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/StackProfiler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/StackProfiler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -28,6 +28,7 @@
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.AggregationPolicy;
 import org.openjdk.jmh.results.Aggregator;
+import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.results.Result;
 import org.openjdk.jmh.results.ResultRole;
 import org.openjdk.jmh.util.HashMultiset;
@@ -107,7 +108,7 @@
     }
 
     @Override
-    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
+    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result) {
         samplingTask.stop();
         return Collections.singleton(new StackResult(samplingTask.stacks));
     }
--- a/jmh-core/src/main/java/org/openjdk/jmh/results/IterationResult.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/results/IterationResult.java	Sun Apr 05 13:26:25 2015 +0300
@@ -48,16 +48,22 @@
 
     private final BenchmarkParams benchmarkParams;
     private final IterationParams params;
+    private final IterationResultMetaData metadata;
     private Collection<Result> primaryResults;
     private Multimap<String, Result> secondaryResults;
 
-    public IterationResult(BenchmarkParams benchmarkParams, IterationParams params) {
+    public IterationResult(BenchmarkParams benchmarkParams, IterationParams params, IterationResultMetaData md) {
         this.benchmarkParams = benchmarkParams;
         this.params = params;
+        this.metadata = md;
         this.primaryResults = EMPTY_LIST;
         this.secondaryResults = EMPTY_MAP;
     }
 
+    public IterationResultMetaData getMetadata() {
+        return metadata;
+    }
+
     public void addResults(Collection<? extends Result> rs) {
         for (Result r : rs) {
             addResult(r);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/results/IterationResultMetaData.java	Sun Apr 05 13:26:25 2015 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, 2015, 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.results;
+
+import java.io.Serializable;
+
+public class IterationResultMetaData implements Serializable {
+
+    private final long allOps;
+    private final long measuredOps;
+
+    public IterationResultMetaData(long allOps, long measuredOps) {
+        this.allOps = allOps;
+        this.measuredOps = measuredOps;
+    }
+
+    public long getMeasuredOps() {
+        return measuredOps;
+    }
+
+    public long getAllOps() {
+        return allOps;
+    }
+}
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java	Sun Apr 05 13:26:25 2015 +0300
@@ -29,7 +29,6 @@
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.results.BenchmarkResult;
 import org.openjdk.jmh.results.BenchmarkResultMetaData;
-import org.openjdk.jmh.results.HandlerResult;
 import org.openjdk.jmh.results.IterationResult;
 import org.openjdk.jmh.runner.format.OutputFormat;
 import org.openjdk.jmh.runner.options.Options;
@@ -263,10 +262,10 @@
 
             out.iteration(benchParams, wp, i);
             boolean isLastIteration = (benchParams.getMeasurement().getCount() == 0);
-            HandlerResult hr = handler.runIteration(benchParams, wp, isLastIteration);
-            out.iterationResult(benchParams, wp, i, hr.getResult());
+            IterationResult ir = handler.runIteration(benchParams, wp, isLastIteration);
+            out.iterationResult(benchParams, wp, i, ir);
 
-            allWarmup += hr.getAllOps();
+            allWarmup += ir.getMetadata().getAllOps();
         }
 
         long measurementTime = System.currentTimeMillis();
@@ -283,13 +282,13 @@
             out.iteration(benchParams, mp, i);
 
             boolean isLastIteration = (i == mp.getCount());
-            HandlerResult hr = handler.runIteration(benchParams, mp, isLastIteration);
-            out.iterationResult(benchParams, mp, i, hr.getResult());
+            IterationResult ir = handler.runIteration(benchParams, mp, isLastIteration);
+            out.iterationResult(benchParams, mp, i, ir);
 
-            allMeasurement += hr.getAllOps();
+            allMeasurement += ir.getMetadata().getAllOps();
 
             if (acceptor != null) {
-                acceptor.accept(hr.getResult());
+                acceptor.accept(ir);
             }
         }
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/BenchmarkHandler.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/BenchmarkHandler.java	Sun Apr 05 13:26:25 2015 +0300
@@ -31,7 +31,9 @@
 import org.openjdk.jmh.profile.Profiler;
 import org.openjdk.jmh.profile.ProfilerFactory;
 import org.openjdk.jmh.results.BenchmarkTaskResult;
-import org.openjdk.jmh.results.HandlerResult;
+import org.openjdk.jmh.results.IterationResult;
+import org.openjdk.jmh.results.IterationResultMetaData;
+import org.openjdk.jmh.results.Result;
 import org.openjdk.jmh.runner.format.OutputFormat;
 import org.openjdk.jmh.runner.options.Options;
 import org.openjdk.jmh.runner.options.TimeValue;
@@ -282,11 +284,11 @@
         }
     }
 
-    protected void stopProfilers(BenchmarkParams benchmarkParams, IterationParams iterationParams, HandlerResult iterationResults) {
+    protected void stopProfilers(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult iterationResults) {
         // stop profilers
         for (InternalProfiler prof : profilersRev) {
             try {
-                iterationResults.addResults(prof.afterIteration(benchmarkParams, iterationParams));
+                iterationResults.addResults(prof.afterIteration(benchmarkParams, iterationParams, iterationResults));
             } catch (Throwable ex) {
                 throw new BenchmarkException(ex);
             }
@@ -324,7 +326,7 @@
      * @param last    Should this iteration considered to be the last
      * @return IterationResult
      */
-    public HandlerResult runIteration(BenchmarkParams benchmarkParams, IterationParams params, boolean last) {
+    public IterationResult runIteration(BenchmarkParams benchmarkParams, IterationParams params, boolean last) {
         int numThreads = benchmarkParams.getThreads();
         TimeValue runtime = params.getTime();
 
@@ -332,7 +334,7 @@
         CountDownLatch preTearDownBarrier = new CountDownLatch(numThreads);
 
         // result object to accumulate the results in
-        HandlerResult iterationResults = new HandlerResult(benchmarkParams, params);
+        List<Result> iterationResults = new ArrayList<Result>();
 
         InfraControl control = new InfraControl(benchmarkParams, params, preSetupBarrier, preTearDownBarrier, last);
 
@@ -380,6 +382,10 @@
 
         // Wait for the result, continuously polling the worker threads.
         // The abrupt exception in any worker will float up here.
+        long allOps = 0;
+        long measuredOps = 0;
+        IterationResult result;
+
         try {
             int expected = numThreads;
             while (expected > 0) {
@@ -388,7 +394,11 @@
                     Future<BenchmarkTaskResult> fr = re.getValue();
                     try {
                         long waitFor = Math.max(TimeUnit.MILLISECONDS.toNanos(100), waitDeadline - System.nanoTime());
-                        fr.get(waitFor, TimeUnit.NANOSECONDS);
+
+                        BenchmarkTaskResult btr = fr.get(waitFor, TimeUnit.NANOSECONDS);
+                        iterationResults.addAll(btr.getResults());
+                        allOps += btr.getAllOps();
+                        measuredOps += btr.getMeasuredOps();
                         expected--;
                     } catch (InterruptedException ex) {
                         throw new BenchmarkException(ex);
@@ -407,28 +417,15 @@
                 }
             }
         } finally {
+            result = new IterationResult(benchmarkParams, params, new IterationResultMetaData(allOps, measuredOps));
+            result.addResults(iterationResults);
+
             // profilers stop when after all threads are confirmed to be
             // finished to capture the edge behaviors; or, on a failure path
-            stopProfilers(benchmarkParams, params, iterationResults);
+            stopProfilers(benchmarkParams, params, result);
         }
 
-        // Get the results.
-        // Should previous loop allow us to get to this point, we can fully expect
-        // all the results ready without the exceptions.
-        for (Future<BenchmarkTaskResult> fr : results.values()) {
-            try {
-                BenchmarkTaskResult btr = fr.get();
-                iterationResults.addAllOps(btr.getAllOps());
-                iterationResults.addMeasuredOps(btr.getMeasuredOps());
-                iterationResults.addResults(btr.getResults());
-            } catch (InterruptedException ex) {
-                throw new IllegalStateException("Impossible to be here");
-            } catch (ExecutionException ex) {
-                throw new IllegalStateException("Impossible to be here");
-            }
-        }
-
-        return iterationResults;
+        return result;
     }
 
     /**
--- a/jmh-core/src/test/java/org/openjdk/jmh/results/ResultAggregationTest.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/test/java/org/openjdk/jmh/results/ResultAggregationTest.java	Sun Apr 05 13:26:25 2015 +0300
@@ -35,7 +35,7 @@
 
     @Test
     public void testThroughput() {
-        IterationResult ir = new IterationResult(null, null);
+        IterationResult ir = new IterationResult(null, null, null);
         ir.addResult(new ThroughputResult(ResultRole.PRIMARY, "", 10000, 1, TimeUnit.NANOSECONDS));
         ir.addResult(new ThroughputResult(ResultRole.PRIMARY, "", 10000, 1, TimeUnit.NANOSECONDS));
         ir.addResult(new ThroughputResult(ResultRole.SECONDARY, "sec", 5000, 1, TimeUnit.NANOSECONDS));
@@ -69,7 +69,7 @@
 
     @Test
     public void testAverageTime() {
-        IterationResult ir = new IterationResult(null, null);
+        IterationResult ir = new IterationResult(null, null, null);
         ir.addResult(new AverageTimeResult(ResultRole.PRIMARY, "", 1, 10000, TimeUnit.NANOSECONDS));
         ir.addResult(new AverageTimeResult(ResultRole.PRIMARY, "", 1, 10000, TimeUnit.NANOSECONDS));
         ir.addResult(new AverageTimeResult(ResultRole.SECONDARY, "sec", 1, 5000, TimeUnit.NANOSECONDS));
@@ -112,7 +112,7 @@
         SampleBuffer sb3000 = new SampleBuffer();
         sb3000.add(3000);
 
-        IterationResult ir = new IterationResult(null, null);
+        IterationResult ir = new IterationResult(null, null, null);
         ir.addResult(new SampleTimeResult(ResultRole.PRIMARY, "", sb10000, TimeUnit.NANOSECONDS));
         ir.addResult(new SampleTimeResult(ResultRole.PRIMARY, "", sb10000, TimeUnit.NANOSECONDS));
         ir.addResult(new SampleTimeResult(ResultRole.SECONDARY, "sec", sb5000, TimeUnit.NANOSECONDS));
@@ -146,7 +146,7 @@
 
     @Test
     public void testSingleShot() {
-        IterationResult ir = new IterationResult(null, null);
+        IterationResult ir = new IterationResult(null, null, null);
         ir.addResult(new SingleShotResult(ResultRole.PRIMARY, "", 10000, TimeUnit.NANOSECONDS));
         ir.addResult(new SingleShotResult(ResultRole.PRIMARY, "", 10000, TimeUnit.NANOSECONDS));
         ir.addResult(new SingleShotResult(ResultRole.SECONDARY, "sec", 5000, TimeUnit.NANOSECONDS));
--- a/jmh-core/src/test/java/org/openjdk/jmh/results/TestAggregateResult.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/test/java/org/openjdk/jmh/results/TestAggregateResult.java	Sun Apr 05 13:26:25 2015 +0300
@@ -55,7 +55,8 @@
                         Mode.Throughput, null, TimeUnit.SECONDS, 1,
                         Utils.getCurrentJvm(), Collections.<String>emptyList(),
                         TimeValue.days(1)),
-                new IterationParams(IterationType.MEASUREMENT, 1, TimeValue.days(1), 1)
+                new IterationParams(IterationType.MEASUREMENT, 1, TimeValue.days(1), 1),
+                null
         );
         for (double d : values) {
             result.addResult(new ThroughputResult(ResultRole.PRIMARY, "test1", (long) d, 10 * 1000 * 1000, TimeUnit.MILLISECONDS));
--- a/jmh-core/src/test/java/org/openjdk/jmh/results/format/ResultFormatTest.java	Fri Apr 03 15:13:42 2015 +0300
+++ b/jmh-core/src/test/java/org/openjdk/jmh/results/format/ResultFormatTest.java	Sun Apr 05 13:26:25 2015 +0300
@@ -89,7 +89,7 @@
             for (int f = 0; f < r.nextInt(10); f++) {
                 Collection<IterationResult> iterResults = new ArrayList<IterationResult>();
                 for (int c = 0; c < r.nextInt(10); c++) {
-                    IterationResult res = new IterationResult(params, params.getMeasurement());
+                    IterationResult res = new IterationResult(params, params.getMeasurement(), null);
                     res.addResult(new ThroughputResult(ResultRole.PRIMARY, "test", r.nextInt(1000), 1000 * 1000, TimeUnit.MILLISECONDS));
                     res.addResult(new ThroughputResult(ResultRole.SECONDARY, "secondary1", r.nextInt(1000), 1000 * 1000, TimeUnit.MILLISECONDS));
                     res.addResult(new ThroughputResult(ResultRole.SECONDARY, "secondary2", r.nextInt(1000), 1000 * 1000, TimeUnit.MILLISECONDS));