Class FlightRecorder
- java.lang.Object
-
- de.mirkosertic.flightrecorderstarter.core.FlightRecorder
-
public class FlightRecorder extends Object
-
-
Constructor Summary
Constructors Constructor Description FlightRecorder(FlightRecorderDynamicConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanupOldRecordings()voiddeleteRecording(long recordingId)FlightRecorderPublicSessiongetById(Long recordingId)protected Set<Long>getDeletableRecordingsByCount()If the total number of recordings is above the threshold defined inflightrecorder.old-recordings-max, returns the oldest recordings that are above the threshold and finished.protected Set<Long>getDeletableRecordingsByTTL()Return finished recordings with startTime older than (Instant.now() - TTL)booleanisRecordingStopped(long recordingId)longnewRecording(StartRecordingCommand command)List<FlightRecorderPublicSession>sessions()voidsetRecordingOptions(long recordingId, StartRecordingCommand command, File filename)voidstartRecording(long recordingId, Duration delayDuration)longstartRecordingFor(StartRecordingCommand command)FilestopRecording(long recordingId)
-
-
-
Constructor Detail
-
FlightRecorder
public FlightRecorder(FlightRecorderDynamicConfiguration configuration)
-
-
Method Detail
-
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 inflightrecorder.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)
-
-