Class FlightRecorder

java.lang.Object
de.mirkosertic.flightrecorderstarter.core.FlightRecorder

public class FlightRecorder extends Object
  • Constructor Details

  • Method Details

    • newRecording

      public long newRecording(StartRecordingCommand command)
    • startRecording

      public void startRecording(long recordingId, Duration delayDuration)
    • stopRecording

      public File stopRecording(long recordingId)
    • setRecordingOptions

      public void setRecordingOptions(long recordingId, StartRecordingCommand command, File filename) throws IOException
      Throws:
      IOException
    • startRecordingFor

      public long startRecordingFor(StartRecordingCommand command) throws IOException
      Throws:
      IOException
    • cleanupOldRecordings

      @Scheduled(fixedDelayString="${flightrecorder.recording-cleanup-interval}") public void cleanupOldRecordings()
    • getDeletableRecordingsByTTL

      protected Set<Long> getDeletableRecordingsByTTL()
      Return finished recordings with startTime older than (Instant.now() - TTL)
      Returns:
      Set of recording IDs to be deleted
    • getDeletableRecordingsByCount

      protected Set<Long> getDeletableRecordingsByCount()
      If the total number of recordings is above the threshold defined in flightrecorder.old-recordings-max, returns the oldest recordings that are above the threshold and finished.
      Returns:
      Set of recording IDs to be deleted
    • deleteRecording

      public void deleteRecording(long recordingId)
    • isRecordingStopped

      public boolean isRecordingStopped(long recordingId)
    • sessions

      public List<FlightRecorderPublicSession> sessions()
    • getById

      public FlightRecorderPublicSession getById(Long recordingId)