diff -r 7d9d4f629f6e -r acdd0dbe37ee src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java Fri May 31 20:44:28 2019 +0200 +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java Mon Jun 03 16:21:47 2019 +0200 @@ -29,6 +29,7 @@ import java.security.AccessControlContext; import java.security.AccessController; import java.time.Duration; +import java.util.Map; import java.util.function.Consumer; import jdk.jfr.Configuration; @@ -138,6 +139,37 @@ } /** + * Replaces all settings for this recording stream + *

+ * The following example shows how to set event settings for a recording. + * + *

+     * 
+     *     Map{@literal <}String, String{@literal >} settings = new HashMap{@literal <}{@literal >}();
+     *     settings.putAll(EventSettings.enabled("jdk.CPUSample").withPeriod(Duration.ofSeconds(2)).toMap());
+     *     settings.putAll(EventSettings.enabled(MyEvent.class).withThreshold(Duration.ofSeconds(2)).withoutStackTrace().toMap());
+     *     settings.put("jdk.ExecutionSample#period", "10 ms");
+     *     recordingStream.setSettings(settings);
+     * 
+     * 
+ * + * The following example shows how to merge settings. + * + *
+     *     {@code
+     *     Map settings = recording.getSettings();
+     *     settings.putAll(additionalSettings);
+     *     recordingStream.setSettings(settings);
+     * }
+     * 
+ * + * @param settings the settings to set, not {@code null} + */ + public void setSettings(Map settings) { + recording.setSettings(settings); + }; + + /** * Enables event. * * @param eventClass the event to enable, not {@code null}