flight-recorder-starter icon indicating copy to clipboard operation
flight-recorder-starter copied to clipboard

Generate continuous recording without time fixed

Open sanorcdel opened this issue 3 years ago • 0 comments

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:

  1. Time fixed recording -> Input request contains the duration but not the maxAgeDuration or maxSize fields
  2. Continuous + Time fixed recording -> Input request contains the duration and the maxAgeDuration and/or maxSize fields
  3. [new] Continuous recording -> Input request does not contain the duration but the maxAgeDuration and/or maxSize 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.

sanorcdel avatar Apr 15 '21 12:04 sanorcdel