Class RecordedEventBuffer


  • public class RecordedEventBuffer
    extends java.lang.Object
    This class adds RecordedEvents from a RecordingFile to a queue. It statefully keeps track of the time of the event seen from the previous file and uses this to prevent queueing duplicates.
    • Constructor Summary

      Constructors 
      Constructor Description
      RecordedEventBuffer​(java.util.concurrent.BlockingQueue<jdk.jfr.consumer.RecordedEvent> queue)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bufferEvents​(java.nio.file.Path dumpFile, jdk.jfr.consumer.RecordingFile file)
      Buffer the events of the file to the queue.
      java.util.stream.Stream<jdk.jfr.consumer.RecordedEvent> drainToStream()  
      java.time.Instant end()  
      java.time.Instant start()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RecordedEventBuffer

        public RecordedEventBuffer​(java.util.concurrent.BlockingQueue<jdk.jfr.consumer.RecordedEvent> queue)
    • Method Detail

      • bufferEvents

        public void bufferEvents​(java.nio.file.Path dumpFile,
                                 jdk.jfr.consumer.RecordingFile file)
                          throws java.io.IOException
        Buffer the events of the file to the queue. Iterate through the events of the JFR file, filtering events older than the last seen watermark, and add to the queue until there are no more events or the queue is full.
        Parameters:
        dumpFile - the path of the file
        file - the JFR file
        Throws:
        java.io.IOException - if an error occurs reading the file
      • drainToStream

        public java.util.stream.Stream<jdk.jfr.consumer.RecordedEvent> drainToStream()
      • start

        public java.time.Instant start()
      • end

        public java.time.Instant end()