public interface EventRecorder
Event recorder that can delegate events from the
EventBus into a recording facility such as
JFR. Transforming an Event into a recordable event is subject to the actual EventRecorder implementation.
You can record data by launching the application with recording enabled:
java -XX:StartFlightRecording:filename=recording.jfr,duration=10s -jar app.jar.
- Since:
- 6.1
- Author:
- Mark Paluch
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceEventRecorder.RecordableEventInterface defining a recordable event that is recorded on callingEventRecorder.RecordableEvent.record(). -
Method Summary
Modifier and Type Method Description static EventRecordergetInstance()Obtain an instance of theEventRecorder.voidrecord(Event event)Record an event.EventRecorder.RecordableEventstart(Event event)Start recording an event.
-
Method Details
-
getInstance
Obtain an instance of theEventRecorder.- Returns:
- an instance of the
EventRecorder.
-
record
Record an event.- Parameters:
event- the event to record, must not benull.
-
start
Start recording an event. This method returns aEventRecorder.RecordableEventthat can be recorded by callingEventRecorder.RecordableEvent.record(). These events can be used to measure time between start and record.- Parameters:
event- the event to record, must not benull.
-