gortiz commented on code in PR #15364: URL: https://github.com/apache/pinot/pull/15364#discussion_r2011731034
########## pinot-core/src/main/java/org/apache/pinot/core/util/trace/ContinuousJfrStarter.java: ########## @@ -0,0 +1,143 @@ +package org.apache.pinot.core.util.trace; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.text.ParseException; +import java.time.Duration; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.Locale; +import jdk.jfr.Configuration; +import jdk.jfr.Recording; +import org.apache.pinot.spi.env.PinotConfiguration; +import org.apache.pinot.spi.utils.CommonConstants; + + +public class ContinuousJfrStarter { + + /// Key that controls whether to enable continuous JFR recording. + public static final String ENABLED = "enabled"; + /// Default value for the enabled key. + public static final boolean DEFAULT_ENABLED = false; + + /// Key that controls the JFR configuration to use. Valid values are 'default' or 'profile', but more can be added + /// by adding custom configurations/settings. See the JFR documentation for more information. + /// + /// The default value is 'default', which is the default JFR configuration and the one that has a target of less + /// than 1% overhead. + public static final String CONFIGURATION = "configuration"; + /// Default value for the configuration key. + public static final String DEFAULT_CONFIGURATION = "default"; + /// Key that controls the name of the recording. + /// + /// This is used to identify the recording in the JFR UI. + /// The default value is 'pinot-continuous'. + public static final String NAME = "name"; + /// Default value for the name key. + public static final String DEFAULT_NAME = "pinot-continuous"; Review Comment: Yes, JFR supports several recordings in parallel and the name is what identifies them. You can also then use the name to dump a recording. For example, on Docker, Pinot runs with PID 1, so you could always create a JFR dump by running: > jcmd 1 JFR.dump name=pinot-continuous filename=/home/pinot/data/recording-$(date +"%Y-%m-%d_%H-%M-%S").jfr -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org