Top Description Fields Constructors Methods
jdk.management.jfr

public final Class RecordingInfo

extends Object
Class Inheritance
Imports
java.time.Duration, .Instant, java.util.LinkedHashMap, .List, .Map, javax.management.openmbean.CompositeData, .TabularData, jdk.jfr.Recording, .RecordingState, jdk.jfr.internal.management.ManagementSupport

Management representation of a Recording.
Since
9
See Also
Recording

Field Summary

Modifier and TypeField and Description
private final String
private final boolean
private final long
private final long
private final long
private final long
private final String
private final Map<String, String>
private final long
private final long
private final String
private final long
private final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
private

Method Summary

Modifier and TypeMethod and Description
public static RecordingInfo

Returns:

the RecordingInfo represented by cd, or null if cd is null
from
(CompositeData
CompositeData representing the RecordingInfo to return
cd
)

Returns a RecordingInfo represented by the specified CompositeData object.

public String

Returns:

the destination, or null if not set
getDestination
()

Returns destination path where data, for the recording associated with this RecordingInfo, should be written when the recording stops, or null if the recording should not be written.

public boolean

Returns:

true if recording should be dumped on exit, false otherwise
getDumpOnExit
()

Returns if the recording associated with this RecordingInfo should be dumped to file when the JVM exits.

public long

Returns:

the desired duration, or 0 if no duration has been set
getDuration
()

Returns the desired duration, measured in seconds, of the recording associated with this RecordingInfo, or 0 if no duration has been set.

public long

Returns:

the recording ID
getId
()

Returns the unique ID for the recording associated with this RecordingInfo.

public long

Returns:

how long data should be kept on disk, measured in seconds
getMaxAge
()

Returns how many seconds data should be kept on disk, or 0 if data is to be kept forever.

public long

Returns:

the amount of data should be kept on disk, in bytes
getMaxSize
()

Returns the amount of data, measured in bytes, the recording associated with this RecordingInfo, should be kept on disk, before it's rotated away, or 0 if data is to be kept indefinitely.

public String

Returns:

the recording name, not null
getName
()

Returns the name of the recording associated with this RecordingInfo.

public Map<String, String>

Returns:

the recording settings, not null
getSettings
()

Returns the settings for the recording associated with this RecordingInfo.

public long

Returns:

the amount of recorded data, measured in bytes
getSize
()

Returns the amount data recorded by recording.

public long

Returns:

the start time of the recording, or null if the recording hasn't started
getStartTime
()

Returns start time of the recording associated with this RecordingInfo, measured as ms since epoch, or null if the recording hasn't started.

public String

Returns:

the recording state, not null
getState
()

Returns a String representation of state of the recording associated with this RecordingInfo.

public long

Returns:

the stop time of recording, or null if recording hasn't been stopped.
getStopTime
()

Returns the actual or expected stop time of the recording associated with this RecordingInfo, measured as ms since epoch, or null if the expected or actual stop time is not known, which can only happen if the recording has not yet been stopped.

public boolean

Returns:

true if recording is to disk, false otherwise
isToDisk
()

Returns true if the recording associated with this RecordingInfo should be flushed to disk, when memory buffers are full, false otherwise.

public String

Returns:

description, not null
toString
()

Overrides java.lang.Object.toString.

Returns a string description of the recording associated with this RecordingInfo

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

destinationback to summary
private final String destination
dumpOnExitback to summary
private final boolean dumpOnExit
durationInSecondsback to summary
private final long durationInSeconds
idback to summary
private final long id
maxAgeback to summary
private final long maxAge
maxSizeback to summary
private final long maxSize
nameback to summary
private final String name
settingsback to summary
private final Map<String, String> settings
sizeback to summary
private final long size
startTimeback to summary
private final long startTime
stateback to summary
private final String state
stopTimeback to summary
private final long stopTime
toDiskback to summary
private final boolean toDisk

Constructor Detail

RecordingInfoback to summary
pack-priv RecordingInfo(Recording recording)
RecordingInfoback to summary
private RecordingInfo(CompositeData cd)

Method Detail

fromback to summary
public static RecordingInfo from(CompositeData cd)

Returns a RecordingInfo represented by the specified CompositeData object.

The specified CompositeData must have the following item names and item types to be valid.

Supported names and types in a specified CompositeData object
Name Type
id Long
name String
state String
dumpOnExit Boolean
size Long
toDisk Boolean
maxAge Long
maxSize Long
startTime Long
stopTime Long
destination String
duration Long
settings javax.management.openmbean.CompositeData[] whose element type is the mapped type for SettingDescriptorInfo as specified in the SettingDescriptorInfo#from method.
Parameters
cd:CompositeData

CompositeData representing the RecordingInfo to return

Returns:RecordingInfo

the RecordingInfo represented by cd, or null if cd is null

Exceptions
IllegalArgumentException:
if cd does not represent a valid RecordingInfo
getDestinationback to summary
public String getDestination()

Returns destination path where data, for the recording associated with this RecordingInfo, should be written when the recording stops, or null if the recording should not be written.

Returns:String

the destination, or null if not set

See Also
Recording#getDestination()
getDumpOnExitback to summary
public boolean getDumpOnExit()

Returns if the recording associated with this RecordingInfo should be dumped to file when the JVM exits.

Returns:boolean

true if recording should be dumped on exit, false otherwise

See Also
Recording#getDumpOnExit()
getDurationback to summary
public long getDuration()

Returns the desired duration, measured in seconds, of the recording associated with this RecordingInfo, or 0 if no duration has been set.

Returns:long

the desired duration, or 0 if no duration has been set

See Also
Recording#getDuration()
getIdback to summary
public long getId()

Returns the unique ID for the recording associated with this RecordingInfo.

Returns:long

the recording ID

See Also
Recording#getId()
getMaxAgeback to summary
public long getMaxAge()

Returns how many seconds data should be kept on disk, or 0 if data is to be kept forever.

In-memory recordings are not affected by maximum age.

Returns:long

how long data should be kept on disk, measured in seconds

See Also
Recording#getMaxAge(), Recording#setToDisk(boolean)
getMaxSizeback to summary
public long getMaxSize()

Returns the amount of data, measured in bytes, the recording associated with this RecordingInfo, should be kept on disk, before it's rotated away, or 0 if data is to be kept indefinitely.

In-memory recordings are not affected by maximum size.

Returns:long

the amount of data should be kept on disk, in bytes

See Also
Recording#setToDisk(boolean), Recording#getMaxSize()
getNameback to summary
public String getName()

Returns the name of the recording associated with this RecordingInfo.

Returns:String

the recording name, not null

See Also
Recording#getName()
getSettingsback to summary
public Map<String, String> getSettings()

Returns the settings for the recording associated with this RecordingInfo.

Returns:Map<String, String>

the recording settings, not null

See Also
Recording#getSettings()
getSizeback to summary
public long getSize()

Returns the amount data recorded by recording. associated with this RecordingInfo.

Returns:long

the amount of recorded data, measured in bytes

getStartTimeback to summary
public long getStartTime()

Returns start time of the recording associated with this RecordingInfo, measured as ms since epoch, or null if the recording hasn't started.

Returns:long

the start time of the recording, or null if the recording hasn't started

See Also
Recording#getStartTime()
getStateback to summary
public String getState()

Returns a String representation of state of the recording associated with this RecordingInfo.

Valid return values are "NEW", "DELAYED", "STARTING", "RUNNING", "STOPPING", "STOPPED" and "CLOSED".

Returns:String

the recording state, not null

See Also
RecordingState#toString(), Recording#getState()
getStopTimeback to summary
public long getStopTime()

Returns the actual or expected stop time of the recording associated with this RecordingInfo, measured as ms since epoch, or null if the expected or actual stop time is not known, which can only happen if the recording has not yet been stopped.

Returns:long

the stop time of recording, or null if recording hasn't been stopped.

See Also
Recording#getStopTime()
isToDiskback to summary
public boolean isToDisk()

Returns true if the recording associated with this RecordingInfo should be flushed to disk, when memory buffers are full, false otherwise.

Returns:boolean

true if recording is to disk, false otherwise

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string description of the recording associated with this RecordingInfo

Returns:String

description, not null

Annotations
@Override