Rename RecordingStream::setInterval to setFlushInterval JEP-349-branch
authoregahlin
Thu, 29 Aug 2019 19:00:41 +0200
branchJEP-349-branch
changeset 57944 f1610739fe86
parent 57937 c72ed9929e02
child 57946 b77540d274f9
Rename RecordingStream::setInterval to setFlushInterval
src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java
src/jdk.jfr/share/classes/jdk/jfr/consumer/UseCasesStream.java
test/jdk/jdk/jfr/api/consumer/recordingstream/TestSetFlushInterval.java
--- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java	Thu Aug 29 15:16:13 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java	Thu Aug 29 19:00:41 2019 +0200
@@ -334,8 +334,8 @@
      *
      * @throws IllegalStateException if the stream is closed
      */
-    public void setInterval(Duration duration) {
-        recording.setFlushInterval(duration);
+    public void setFlushInterval(Duration interval) {
+        recording.setFlushInterval(interval);
     }
 
     @Override
--- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/UseCasesStream.java	Thu Aug 29 15:16:13 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/UseCasesStream.java	Thu Aug 29 19:00:41 2019 +0200
@@ -153,7 +153,7 @@
     public static void tooling() throws IOException, ParseException {
         Deque<Double> measurements = new ArrayDeque<>();
         try (RecordingStream rs = new RecordingStream(Configuration.getConfiguration("profile"))) {
-            rs.setInterval(Duration.ofSeconds(1));
+            rs.setFlushInterval(Duration.ofSeconds(1));
             rs.setMaxAge(Duration.ofMinutes(1));
             rs.setOrdered(true); // default
             rs.setReuse(false);
@@ -188,7 +188,6 @@
             rs.onEvent("jdk.JavaMonitorEnter", System.out::println);
             rs.onEvent("jdk.ExceptionThrow", System.out::println);
             rs.start();
-            ;
         }
     }
 }
--- a/test/jdk/jdk/jfr/api/consumer/recordingstream/TestSetFlushInterval.java	Thu Aug 29 15:16:13 2019 +0200
+++ b/test/jdk/jdk/jfr/api/consumer/recordingstream/TestSetFlushInterval.java	Thu Aug 29 19:00:41 2019 +0200
@@ -42,7 +42,7 @@
     public static void main(String... args) throws Exception {
         Duration expectedDuration = Duration.ofMillis(1001);
         try (RecordingStream r = new RecordingStream()) {
-            r.setInterval(expectedDuration);
+            r.setFlushInterval(expectedDuration);
             r.enable(EventNames.ActiveRecording);
             r.onEvent(e -> {
                 System.out.println(e);