flight-recorder-starter
flight-recorder-starter copied to clipboard
Generate continuous recording without time fixed
Currently, the startRecording
handler method of the FlightRecorderEndpoint
rest controller is validating if the input request contains the duration
and timeUnit
fields in the body.
I understand this is mandatory when the request represents the start of a time fixed recording. However, in case we want to start a continuous recording, these fields may not be needed. In fact, when the jfr file is imported in JMC, the Duration
field value is 0 s in Event Browser view if the original request contains maxSize
or maxAgeDuration
fields.
I think it could be nice if the startRecording
handler method will validate the request but in another way. Checking if the request contains the duration
and timeUnit
fields in case maxSize
or maxAgeDuration
(and maxAgeUnit
) do not appear.
On this way, three possible scenarios will be available:
-
Time fixed recording -> Input request contains the
duration
but not themaxAgeDuration
ormaxSize
fields -
Continuous + Time fixed recording -> Input request contains the
duration
and themaxAgeDuration
and/ormaxSize
fields -
[new] Continuous recording -> Input request does not contain the
duration
but themaxAgeDuration
and/ormaxSize
fields must appear. These recordings must be stopped manually using the API.
What do you think? I can submit a Pull Request so you can have a look to my implementation. The idea of this change is have a similar behavior of Java Mission Control.