changeset 1240:c247d464d17f

Profiler javadoc to explain the new interface.
author shade
date Thu, 11 Jun 2015 18:07:15 +0300
parents ec073422d692
children 665a832d5061
files jmh-core/src/main/java/org/openjdk/jmh/profile/Profiler.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_35_Profilers.java
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/Profiler.java	Thu Jun 11 17:57:59 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/Profiler.java	Thu Jun 11 18:07:15 2015 +0300
@@ -27,6 +27,15 @@
 /**
  * Root profiler interface.
  *
+ * <p>Profiler classes are expected to provide either a non-arg constructor,
+ * or a constructor accepting single String argument, as the option line.
+ * The treatment of option line is unspecified, and can be handled in
+ * profiler-specific way. Profiler constructors can throw
+ * {@link org.openjdk.jmh.profile.ProfilerException} if profiler cannot
+ * operate, either because of misconfiguration, or help message requested.
+ * The message in {@link org.openjdk.jmh.profile.ProfilerException} should
+ * clearly articulate the reason.
+ *
  * <p>Profilers normally implement one of the subinterfaces.</p>
  * @see org.openjdk.jmh.profile.ExternalProfiler
  * @see org.openjdk.jmh.profile.InternalProfiler
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_35_Profilers.java	Thu Jun 11 17:57:59 2015 +0300
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_35_Profilers.java	Thu Jun 11 18:07:15 2015 +0300
@@ -60,7 +60,8 @@
      * a quick turnaround for the results.
      *
      * Use -lprof to list the profilers. There are quite a few profilers, and this sample
-     * would expand on a handful of most useful ones.
+     * would expand on a handful of most useful ones. Many profilers have their own options,
+     * usually accessible via -prof <profiler-name>:help.
      *
      * Since profilers are reporting on different things, it is hard to construct a single
      * benchmark sample that will show all profilers in action. Therefore, we have a couple