changeset 1194:adec482ba705

7901383: -prof gc result names contain spaces and "special" symbols; not playing well with formats
author shade
date Tue, 14 Apr 2015 23:42:50 +0300
parents dbe93cfb9e06
children 20c5dbbe3e3d
files jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java	Tue Apr 14 20:29:26 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java	Tue Apr 14 23:42:50 2015 +0300
@@ -169,14 +169,15 @@
 
         for (String space : observedSpaces) {
             double churnRate = 1.0 * churn.count(space) * TimeUnit.SECONDS.toNanos(1) / (afterTime - beforeTime);
+            String spaceName = space.replaceAll(" ", "_");
 
             results.add(new ProfilerResult(
-                    Defaults.PREFIX + "gc.churn.{" + space + "}",
+                    Defaults.PREFIX + "gc.churn." + spaceName + "",
                     churnRate / 1024 / 1024,
                     "MB/sec",
                     AggregationPolicy.AVG));
 
-            results.add(new ProfilerResult(Defaults.PREFIX + "gc.churn.{" + space + "}.norm",
+            results.add(new ProfilerResult(Defaults.PREFIX + "gc.churn." + spaceName + ".norm",
                     churnRate / iResult.getMetadata().getAllOps(),
                     "B/op",
                     AggregationPolicy.AVG));