changeset 277:0697362f0c50

Do not rely on HashMap traverse order in ResultFormatTest.
author shade
date Wed, 27 Nov 2013 23:19:54 +0400
parents 6a39cdbfd790
children 24310741f19b
files jmh-core/src/test/java/org/openjdk/jmh/output/results/ResultFormatTest.java jmh-core/src/test/resources/org/openjdk/jmh/output/results/output-golden.csv jmh-core/src/test/resources/org/openjdk/jmh/output/results/output-golden.json
diffstat 3 files changed, 171 insertions(+), 170 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/test/java/org/openjdk/jmh/output/results/ResultFormatTest.java	Tue Nov 26 21:16:42 2013 +0400
+++ b/jmh-core/src/test/java/org/openjdk/jmh/output/results/ResultFormatTest.java	Wed Nov 27 23:19:54 2013 +0400
@@ -46,6 +46,7 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Random;
+import java.util.TreeMap;
 
 /**
  * These tests seal the machine-readable format.
@@ -54,7 +55,7 @@
 public class ResultFormatTest {
 
     private Map<BenchmarkRecord, RunResult> getStub() {
-        Map<BenchmarkRecord, RunResult> results = new HashMap<BenchmarkRecord, RunResult>();
+        Map<BenchmarkRecord, RunResult> results = new TreeMap<BenchmarkRecord, RunResult>();
 
         Random r = new Random(12345);
         for (int b = 0; b < r.nextInt(10); b++) {
--- a/jmh-core/src/test/resources/org/openjdk/jmh/output/results/output-golden.csv	Tue Nov 26 21:16:42 2013 +0400
+++ b/jmh-core/src/test/resources/org/openjdk/jmh/output/results/output-golden.csv	Wed Nov 27 23:19:54 2013 +0400
@@ -1,6 +1,6 @@
 "Benchmark", "Mode", "Threads", "Iterations", "Iteration time", "Mean", "Mean Error (95%)", "Mean Error (99%)", "Unit"
-"benchmark_3", "avgt", 968, 857, "438 s", 417.57142857142856, 331.1099544524174, "ops/ms"
-"benchmark_4", "avgt", 739, 16, "763 s", 956.0, NaN, "ops/ms"
 "benchmark_0", "avgt", 80, 802, "501 s", 528.8571428571429, 253.83689091986184, "ops/ms"
 "benchmark_1", "avgt", 900, 55, "398 s", 439.0, NaN, "ops/ms"
 "benchmark_2", "avgt", 466, 461, "96 s", 545.0, 493.81293072112726, "ops/ms"
+"benchmark_3", "avgt", 968, 857, "438 s", 417.57142857142856, 331.1099544524174, "ops/ms"
+"benchmark_4", "avgt", 739, 16, "763 s", 956.0, NaN, "ops/ms"
--- a/jmh-core/src/test/resources/org/openjdk/jmh/output/results/output-golden.json	Tue Nov 26 21:16:42 2013 +0400
+++ b/jmh-core/src/test/resources/org/openjdk/jmh/output/results/output-golden.json	Wed Nov 27 23:19:54 2013 +0400
@@ -1,172 +1,5 @@
 [
     {
-        "benchmark" : "benchmark_3",
-        "mode" : "avgt",
-        "threads" : 968,
-        "forks" : 581,
-        "warmupIterations" : 628,
-        "warmupTime" : "207 s",
-        "measurementIterations" : 857,
-        "measurementTime" : "438 s",
-        "primaryMetric" : {
-            "score" : 417.57141666666666,
-            "scoreError" : 331.1099544524174,
-            "scoreConfidence" : [
-                86.46147411901114,
-                748.6813830238459
-            ],
-            "scoreUnit" : "ops/ms",
-            "rawData" : [
-                [
-                    145.0,
-                    502.0,
-                    686.0,
-                    291.0,
-                    665.0,
-                    120.0,
-                    63.0,
-                    570.0
-                ],
-                [
-                    801.0
-                ],
-                [
-                    731.0,
-                    21.0
-                ],
-                [
-                    147.0,
-                    125.0,
-                    979.0
-                ]
-            ]
-        },
-        "secondaryMetrics" : {
-            "secondary1" : {
-                "score" : 672.2142833333334,
-                "scoreError" : 331.1099544524174,
-                "scoreConfidence" : [
-                    409.39701450647914,
-                    935.0315569220922
-                ],
-                "scoreUnit" : "ops/ms",
-                "rawData" :[
-                    [
-                        454.0,
-                        626.0,
-                        584.0,
-                        858.0,
-                        967.0,
-                        814.0,
-                        587.0,
-                        423.0
-                    ],
-                    [
-                        746.0
-                    ],
-                    [
-                        888.0,
-                        284.0
-                    ],
-                    [
-                        965.0,
-                        983.0,
-                        232.0
-                    ]
-                ]
-            },
-            "secondary2" : {
-                "score" : 560.14285,
-                "scoreError" : 331.1099544524174,
-                "scoreConfidence" : [
-                    295.6666772033807,
-                    824.6190370823335
-                ],
-                "scoreUnit" : "ops/ms",
-                "rawData" :[
-                    [
-                        114.0,
-                        166.0,
-                        559.0,
-                        560.0,
-                        341.0,
-                        765.0,
-                        353.0,
-                        522.0
-                    ],
-                    [
-                        779.0
-                    ],
-                    [
-                        870.0,
-                        848.0
-                    ],
-                    [
-                        863.0,
-                        392.0,
-                        710.0
-                    ]
-                ]
-            }
-        }
-    }
-    ,
-    {
-        "benchmark" : "benchmark_4",
-        "mode" : "avgt",
-        "threads" : 739,
-        "forks" : 670,
-        "warmupIterations" : 997,
-        "warmupTime" : "651 s",
-        "measurementIterations" : 16,
-        "measurementTime" : "763 s",
-        "primaryMetric" : {
-            "score" : 956.0,
-            "scoreError" : "NaN",
-            "scoreConfidence" : [
-                "NaN",
-                "NaN"
-            ],
-            "scoreUnit" : "ops/ms",
-            "rawData" : [
-                [
-                    956.0
-                ]
-            ]
-        },
-        "secondaryMetrics" : {
-            "secondary1" : {
-                "score" : 688.0,
-                "scoreError" : "NaN",
-                "scoreConfidence" : [
-                    "NaN",
-                    "NaN"
-                ],
-                "scoreUnit" : "ops/ms",
-                "rawData" :[
-                    [
-                        688.0
-                    ]
-                ]
-            },
-            "secondary2" : {
-                "score" : 237.0,
-                "scoreError" : "NaN",
-                "scoreConfidence" : [
-                    "NaN",
-                    "NaN"
-                ],
-                "scoreUnit" : "ops/ms",
-                "rawData" :[
-                    [
-                        237.0
-                    ]
-                ]
-            }
-        }
-    }
-    ,
-    {
         "benchmark" : "benchmark_0",
         "mode" : "avgt",
         "threads" : 80,
@@ -435,6 +268,173 @@
             }
         }
     }
+    ,
+    {
+        "benchmark" : "benchmark_3",
+        "mode" : "avgt",
+        "threads" : 968,
+        "forks" : 581,
+        "warmupIterations" : 628,
+        "warmupTime" : "207 s",
+        "measurementIterations" : 857,
+        "measurementTime" : "438 s",
+        "primaryMetric" : {
+            "score" : 417.57141666666666,
+            "scoreError" : 331.1099544524174,
+            "scoreConfidence" : [
+                86.46147411901114,
+                748.6813830238459
+            ],
+            "scoreUnit" : "ops/ms",
+            "rawData" : [
+                [
+                    145.0,
+                    502.0,
+                    686.0,
+                    291.0,
+                    665.0,
+                    120.0,
+                    63.0,
+                    570.0
+                ],
+                [
+                    801.0
+                ],
+                [
+                    731.0,
+                    21.0
+                ],
+                [
+                    147.0,
+                    125.0,
+                    979.0
+                ]
+            ]
+        },
+        "secondaryMetrics" : {
+            "secondary1" : {
+                "score" : 672.2142833333334,
+                "scoreError" : 331.1099544524174,
+                "scoreConfidence" : [
+                    409.39701450647914,
+                    935.0315569220922
+                ],
+                "scoreUnit" : "ops/ms",
+                "rawData" :[
+                    [
+                        454.0,
+                        626.0,
+                        584.0,
+                        858.0,
+                        967.0,
+                        814.0,
+                        587.0,
+                        423.0
+                    ],
+                    [
+                        746.0
+                    ],
+                    [
+                        888.0,
+                        284.0
+                    ],
+                    [
+                        965.0,
+                        983.0,
+                        232.0
+                    ]
+                ]
+            },
+            "secondary2" : {
+                "score" : 560.14285,
+                "scoreError" : 331.1099544524174,
+                "scoreConfidence" : [
+                    295.6666772033807,
+                    824.6190370823335
+                ],
+                "scoreUnit" : "ops/ms",
+                "rawData" :[
+                    [
+                        114.0,
+                        166.0,
+                        559.0,
+                        560.0,
+                        341.0,
+                        765.0,
+                        353.0,
+                        522.0
+                    ],
+                    [
+                        779.0
+                    ],
+                    [
+                        870.0,
+                        848.0
+                    ],
+                    [
+                        863.0,
+                        392.0,
+                        710.0
+                    ]
+                ]
+            }
+        }
+    }
+    ,
+    {
+        "benchmark" : "benchmark_4",
+        "mode" : "avgt",
+        "threads" : 739,
+        "forks" : 670,
+        "warmupIterations" : 997,
+        "warmupTime" : "651 s",
+        "measurementIterations" : 16,
+        "measurementTime" : "763 s",
+        "primaryMetric" : {
+            "score" : 956.0,
+            "scoreError" : "NaN",
+            "scoreConfidence" : [
+                "NaN",
+                "NaN"
+            ],
+            "scoreUnit" : "ops/ms",
+            "rawData" : [
+                [
+                    956.0
+                ]
+            ]
+        },
+        "secondaryMetrics" : {
+            "secondary1" : {
+                "score" : 688.0,
+                "scoreError" : "NaN",
+                "scoreConfidence" : [
+                    "NaN",
+                    "NaN"
+                ],
+                "scoreUnit" : "ops/ms",
+                "rawData" :[
+                    [
+                        688.0
+                    ]
+                ]
+            },
+            "secondary2" : {
+                "score" : 237.0,
+                "scoreError" : "NaN",
+                "scoreConfidence" : [
+                    "NaN",
+                    "NaN"
+                ],
+                "scoreUnit" : "ops/ms",
+                "rawData" :[
+                    [
+                        237.0
+                    ]
+                ]
+            }
+        }
+    }
 ]