changeset 1180:d0c8350206db

7901367: Switch profiler result prefix from "@" to something else
author shade
date Thu, 02 Apr 2015 14:29:12 +0300
parents 797091d94427
children b5ae6d3daf87
files jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractHotspotProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractPerfAsmProfiler.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/Defaults.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/LinuxPerfNormProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/StackProfiler.java
diffstat 12 files changed, 71 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractHotspotProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractHotspotProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -68,7 +68,7 @@
         HotspotInternalResult res = counters();
         Collection<ProfilerResult> results = new ArrayList<ProfilerResult>();
         for (Map.Entry<String, Long> e : res.getDiff().entrySet()) {
-            results.add(new ProfilerResult("@unknown." + e.getKey(), e.getValue(), "unit?", AggregationPolicy.AVG));
+            results.add(new ProfilerResult(Defaults.PREFIX + "unknown." + e.getKey(), e.getValue(), "unit?", AggregationPolicy.AVG));
         }
         return results;
     }
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractPerfAsmProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractPerfAsmProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -770,7 +770,7 @@
         private final String output;
 
         public PerfResult(String output) {
-            super(ResultRole.SECONDARY, "@asm", of(Double.NaN), "---", AggregationPolicy.AVG);
+            super(ResultRole.SECONDARY, Defaults.PREFIX + "asm", of(Double.NaN), "---", AggregationPolicy.AVG);
             this.output = output;
         }
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/ClassloaderProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/ClassloaderProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -95,10 +95,10 @@
         }
 
         return Arrays.asList(
-                new ProfilerResult("@classload.loaded.profiled", loaded, "classes", AggregationPolicy.SUM),
-                new ProfilerResult("@classload.unloaded.profiled", unloaded, "classes", AggregationPolicy.SUM),
-                new ProfilerResult("@classload.loaded.total", loadedClassCount, "classes", AggregationPolicy.MAX),
-                new ProfilerResult("@classload.unloaded.total", unloadedClassCount, "classes", AggregationPolicy.MAX)
+                new ProfilerResult(Defaults.PREFIX + "classload.loaded.profiled", loaded, "classes", AggregationPolicy.SUM),
+                new ProfilerResult(Defaults.PREFIX + "classload.unloaded.profiled", unloaded, "classes", AggregationPolicy.SUM),
+                new ProfilerResult(Defaults.PREFIX + "classload.loaded.total", loadedClassCount, "classes", AggregationPolicy.MAX),
+                new ProfilerResult(Defaults.PREFIX + "classload.unloaded.total", unloadedClassCount, "classes", AggregationPolicy.MAX)
         );
     }
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/CompilerProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/CompilerProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -81,8 +81,8 @@
         }
 
         return Arrays.asList(
-                new ProfilerResult("@compiler.time.profiled", compTime, "ms", AggregationPolicy.SUM),
-                new ProfilerResult("@compiler.time.total", comp.getTotalCompilationTime(), "ms", AggregationPolicy.MAX)
+                new ProfilerResult(Defaults.PREFIX + "compiler.time.profiled", compTime, "ms", AggregationPolicy.SUM),
+                new ProfilerResult(Defaults.PREFIX + "compiler.time.total", comp.getTotalCompilationTime(), "ms", AggregationPolicy.MAX)
         );
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/Defaults.java	Thu Apr 02 14:29:12 2015 +0300
@@ -0,0 +1,31 @@
+/*
+ * 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.profile;
+
+class Defaults {
+
+    public static final String PREFIX = "\u00b7";
+
+}
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -34,7 +34,6 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 
 public class GCProfiler implements InternalProfiler {
     private long beforeGCCount;
@@ -77,10 +76,10 @@
         }
 
         return Arrays.asList(
-                new ProfilerResult("@gc.count.profiled", gcCount - beforeGCCount, "counts", AggregationPolicy.SUM),
-                new ProfilerResult("@gc.count.total", gcCount, "counts", AggregationPolicy.MAX),
-                new ProfilerResult("@gc.time.profiled", gcTime - beforeGCTime, "ms", AggregationPolicy.SUM),
-                new ProfilerResult("@gc.time.total", gcTime, "ms", AggregationPolicy.MAX)
+                new ProfilerResult(Defaults.PREFIX + "gc.count.profiled", gcCount - beforeGCCount, "counts", AggregationPolicy.SUM),
+                new ProfilerResult(Defaults.PREFIX + "gc.count.total", gcCount, "counts", AggregationPolicy.MAX),
+                new ProfilerResult(Defaults.PREFIX + "gc.time.profiled", gcTime - beforeGCTime, "ms", AggregationPolicy.SUM),
+                new ProfilerResult(Defaults.PREFIX + "gc.time.total", gcTime, "ms", AggregationPolicy.MAX)
         );
     }
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotCompilationProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotCompilationProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -58,51 +58,51 @@
     public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
         Map<String, Long> current = counters().getCurrent();
         return Arrays.asList(
-                new ProfilerResult("@compiler.totalTime",
+                new ProfilerResult(Defaults.PREFIX + "compiler.totalTime",
                         current.get("java.ci.totalTime") * 1D / TimeUnit.MILLISECONDS.toNanos(1),
                         "ms", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.totalCompiles",
+                new ProfilerResult(Defaults.PREFIX + "compiler.totalCompiles",
                         current.get("sun.ci.totalCompiles"),
                         "methods", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.totalBailouts",
+                new ProfilerResult(Defaults.PREFIX + "compiler.totalBailouts",
                         current.get("sun.ci.totalBailouts"),
                         "methods", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.totalInvalidates",
+                new ProfilerResult(Defaults.PREFIX + "compiler.totalInvalidates",
                         current.get("sun.ci.totalInvalidates"),
                         "methods", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.nmethodCodeSize",
+                new ProfilerResult(Defaults.PREFIX + "compiler.nmethodCodeSize",
                         current.get("sun.ci.nmethodCodeSize") / 1024d,
                         "Kb", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.nmethodSize",
+                new ProfilerResult(Defaults.PREFIX + "compiler.nmethodSize",
                         current.get("sun.ci.nmethodSize") / 1024d,
                         "Kb", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.osrCompiles",
+                new ProfilerResult(Defaults.PREFIX + "compiler.osrCompiles",
                         current.get("sun.ci.osrCompiles"),
                         "methods", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.osrBytes",
+                new ProfilerResult(Defaults.PREFIX + "compiler.osrBytes",
                         current.get("sun.ci.osrBytes") / 1024d,
                         "Kb", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.osrTime",
+                new ProfilerResult(Defaults.PREFIX + "compiler.osrTime",
                         current.get("sun.ci.osrTime") * 1d / TimeUnit.MILLISECONDS.toNanos(1),
                         "ms", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.standardCompiles",
+                new ProfilerResult(Defaults.PREFIX + "compiler.standardCompiles",
                         current.get("sun.ci.standardCompiles"),
                         "methods", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.standardBytes",
+                new ProfilerResult(Defaults.PREFIX + "compiler.standardBytes",
                         current.get("sun.ci.standardBytes") / 1024d,
                         "Kb", AggregationPolicy.MAX),
 
-                new ProfilerResult("@compiler.standardTime",
+                new ProfilerResult(Defaults.PREFIX + "compiler.standardTime",
                         current.get("sun.ci.standardTime") * 1d / TimeUnit.MILLISECONDS.toNanos(1),
                         "ms", AggregationPolicy.MAX)
         );
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotRuntimeProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotRuntimeProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -58,43 +58,43 @@
     public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
         Map<String, Long> current = counters().getCurrent();
         return Arrays.asList(
-                new ProfilerResult("@rt.sync.fatMonitors",
+                new ProfilerResult(Defaults.PREFIX + "rt.sync.fatMonitors",
                         current.get("sun.rt._sync_MonExtant"),
                         "monitors", AggregationPolicy.MAX),
 
-                new ProfilerResult("@rt.sync.monitorInflations",
+                new ProfilerResult(Defaults.PREFIX + "rt.sync.monitorInflations",
                         current.get("sun.rt._sync_Inflations"),
                         "monitors", AggregationPolicy.MAX),
 
-                new ProfilerResult("@rt.sync.monitorDeflations",
+                new ProfilerResult(Defaults.PREFIX + "rt.sync.monitorDeflations",
                         current.get("sun.rt._sync_Deflations"),
                         "monitors", AggregationPolicy.MAX),
 
-                new ProfilerResult("@rt.sync.contendedLockAttempts",
+                new ProfilerResult(Defaults.PREFIX + "rt.sync.contendedLockAttempts",
                         current.get("sun.rt._sync_ContendedLockAttempts"),
                         "locks", AggregationPolicy.MAX),
 
-                new ProfilerResult("@rt.sync.parks",
+                new ProfilerResult(Defaults.PREFIX + "rt.sync.parks",
                         current.get("sun.rt._sync_Parks"),
                         "counts", AggregationPolicy.MAX),
 
-                new ProfilerResult("@rt.sync.notifications",
+                new ProfilerResult(Defaults.PREFIX + "rt.sync.notifications",
                         current.get("sun.rt._sync_Notifications"),
                         "counts", AggregationPolicy.MAX),
 
-                new ProfilerResult("@rt.sync.futileWakeups",
+                new ProfilerResult(Defaults.PREFIX + "rt.sync.futileWakeups",
                         current.get("sun.rt._sync_FutileWakeups"),
                         "counts", AggregationPolicy.MAX),
 
-                new ProfilerResult("@rt.safepoints",
+                new ProfilerResult(Defaults.PREFIX + "rt.safepoints",
                         current.get("sun.rt.safepoints"),
                         "counts", AggregationPolicy.MAX),
 
-                new ProfilerResult("@rt.safepointSyncTime",
+                new ProfilerResult(Defaults.PREFIX + "rt.safepointSyncTime",
                         current.get("sun.rt.safepointSyncTime") * 1d / TimeUnit.MILLISECONDS.toNanos(1),
                         "ms", AggregationPolicy.MAX),
 
-                new ProfilerResult("@rt.safepointTime",
+                new ProfilerResult(Defaults.PREFIX + "rt.safepointTime",
                         current.get("sun.rt.safepointTime") * 1d / TimeUnit.MILLISECONDS.toNanos(1),
                         "ms", AggregationPolicy.MAX)
         );
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotThreadProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/HotspotThreadProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -57,15 +57,15 @@
     public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
         Map<String, Long> current = counters().getCurrent();
         return Arrays.asList(
-                new ProfilerResult("@threads.alive",
+                new ProfilerResult(Defaults.PREFIX + "threads.alive",
                         current.get("java.threads.live"),
                         "threads", AggregationPolicy.AVG),
 
-                new ProfilerResult("@threads.daemon",
+                new ProfilerResult(Defaults.PREFIX + "threads.daemon",
                         current.get("java.threads.daemon"),
                         "threads", AggregationPolicy.AVG),
 
-                new ProfilerResult("@threads.started",
+                new ProfilerResult(Defaults.PREFIX + "threads.started",
                         current.get("java.threads.started"),
                         "threads", AggregationPolicy.MAX)
         );
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfNormProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfNormProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -307,7 +307,7 @@
         }
 
         public PerfResult(String key, Statistics stat) {
-            super(ResultRole.SECONDARY, "@" + key, stat, "#/op", AggregationPolicy.AVG);
+            super(ResultRole.SECONDARY, Defaults.PREFIX + key, stat, "#/op", AggregationPolicy.AVG);
             this.key = key;
         }
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -202,7 +202,7 @@
         private final long instructions;
 
         public PerfResult(String output, long cycles, long instructions) {
-            super(ResultRole.SECONDARY, "@cpi", of(1.0 * cycles / instructions), "CPI", AggregationPolicy.AVG);
+            super(ResultRole.SECONDARY, Defaults.PREFIX + "cpi", of(1.0 * cycles / instructions), "CPI", AggregationPolicy.AVG);
             this.output = output;
             this.cycles = cycles;
             this.instructions = instructions;
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/StackProfiler.java	Wed Apr 01 21:57:30 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/StackProfiler.java	Thu Apr 02 14:29:12 2015 +0300
@@ -245,7 +245,7 @@
         private final Map<Thread.State, Multiset<StackRecord>> stacks;
 
         public StackResult(Map<Thread.State, Multiset<StackRecord>> stacks) {
-            super(ResultRole.SECONDARY, "@stack", of(Double.NaN), "---", AggregationPolicy.AVG);
+            super(ResultRole.SECONDARY, Defaults.PREFIX + "stack", of(Double.NaN), "---", AggregationPolicy.AVG);
             this.stacks = stacks;
         }