Interface FlightRecorderMXBean

All Superinterfaces:
PlatformManagedObject

public interface FlightRecorderMXBean extends PlatformManagedObject
Management interface for controlling Flight Recorder.

The object name for identifying the MXBean in the platform MBean server is:

jdk.management.jfr:type=FlightRecorder

Flight Recorder can be configured in the following ways:

  • Recording options
    Specify how long a recording should last, and where and when data should be dumped.
  • Settings
    Specify which events should be enabled and what kind information each event should capture.
  • Configurations
    Predefined sets of settings, typically derived from a settings file, that specify the configuration of multiple events simultaneously.

See the package jdk.jfr documentation for descriptions of the settings syntax and the ConfigurationInfo class documentation for configuration information.

Recording options

The following table shows the options names to use with setRecordingOptions(long, Map) and getRecordingOptions(long).

Recording options
Name Descripion Default value Format Example values
name Sets a human-readable recording name String representation of the recording id String "My Recording",
"profiling"
maxAge Specify the length of time that the data is kept in the disk repository until the oldest data may be deleted. Only works if disk=true, otherwise this parameter is ignored. "0" (no limit) "0" if no limit is imposed, otherwise a string representation of a positive Long value followed by an empty space and one of the following units,

"ns" (nanoseconds)
"us" (microseconds)
"ms" (milliseconds)
"s" (seconds)
"m" (minutes)
"h" (hours)
"d" (days)
"2 h",
"24 h",
"2 d",
"0"
maxSize Specifies the size, measured in bytes, at which data is kept in disk repository. Only works if disk=true, otherwise this parameter is ignored. "0" (no limit) String representation of a Long value, must be positive "0",
"1000000000"
dumpOnExit Dumps recording data to disk on Java Virtual Machine (JVM) exit "false" String representation of a Boolean value, "true" or "false" "true",
"false"
destination Specifies the path where recording data is written when the recording stops. "false" See Paths#getPath for format.
If this method is invoked from another process, the data is written on the machine where the target JVM is running. If destination is a relative path, it is relative to the working directory where the target JVM was started.}
"c:\recording\recotding.jfr",
"/recordings/recording.jfr", "recording.jfr"
disk Stores recorded data as it is recorded "false" String representation of a Boolean value, "true" or "false" "true",
"false"
duration Sets how long the recording should be running "0" (no limit, continuous) "0" if no limit should be imposed, otherwise a string representation of a positive Long followed by an empty space and one of the following units:

"ns" (nanoseconds)
"us" (microseconds)
"ms" (milliseconds)
"s" (seconds)
"m" (minutes)
"h" (hours)
"d" (days)
"60 s",
"10 m",
"4 h",
"0"

Since:
9