changeset 852:7b1c1bacd8b9

profilers: show the waiting message for long profilers.
author shade
date Fri, 27 Jun 2014 00:42:57 +0400
parents b5ddb0e98c8b
children 1427b5899632
files jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Fri Jun 27 00:11:43 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Fri Jun 27 00:42:57 2014 +0400
@@ -542,18 +542,28 @@
                 File stdErr = FileUtils.tempFile("stderr");
                 File stdOut = FileUtils.tempFile("stdout");
 
-                for (ExternalProfiler profiler : profilers) {
-                    profiler.beforeTrial(params);
+                if (!profilers.isEmpty()) {
+                    out.print("# Preparing profilers: ");
+                    for (ExternalProfiler profiler : profilers) {
+                        out.print(profiler.label() + " ");
+                        profiler.beforeTrial(params);
+                    }
+                    out.println("");
                 }
 
                 Multimap<BenchmarkParams, BenchmarkResult> result = doFork(server, commandString, stdOut, stdErr);
 
-                for (ExternalProfiler profiler : profilers) {
-                    for (Result profR : profiler.afterTrial(params, stdOut, stdErr)) {
-                        for (BenchmarkResult r : result.values()) {
-                            r.addBenchmarkResult(profR);
+                if (!profilers.isEmpty()) {
+                    out.print("# Processing profiler results: ");
+                    for (ExternalProfiler profiler : profilers) {
+                        out.print(profiler.label() + " ");
+                        for (Result profR : profiler.afterTrial(params, stdOut, stdErr)) {
+                            for (BenchmarkResult r : result.values()) {
+                                r.addBenchmarkResult(profR);
+                            }
                         }
                     }
+                    out.println("");
                 }
 
                 results.merge(result);