- java.lang.Object
-
- jdk.management.jfr.RecordingInfo
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RecordingInfo
from(CompositeData cd)
Returns aRecordingInfo
represented by the specifiedCompositeData
String
getDestination()
Returns destination path where data, for the recording associated with thisRecordingInfo
, should be written when the recording stops, ornull
if the recording should not be written.boolean
getDumpOnExit()
Returns if the recording associated with thisRecordingInfo
should be dumped to file when the JVM exits.long
getDuration()
Returns the desired duration, measured in seconds, of the recording associated with thisRecordingInfo
, or {code 0} if no duration has been set.long
getId()
Returns the unique id for the recording associated with thisRecordingInfo
.long
getMaxAge()
Returns how many seconds data should be kept on disk, or0
if data is to be kept forever.long
getMaxSize()
Returns the amount of data, measured in bytes, the recording associated with thisRecordingInfo
, should be kept on disk, before it's rotated away, or {code 0} if data is to be kept indefinitely.String
getName()
Returns the name of the recording associated with thisRecordingInfo
.Map<String,String>
getSettings()
Returns the settings for the recording associated with thisRecordingInfo
.long
getSize()
Returns the amount data recorded by recording. associated with thisRecordingInfo
.long
getStartTime()
Returns start time of the recording associated with thisRecordingInfo
, measured as ms since epoch, ornull
if the recording hasn't started.String
getState()
Returns aString
representation of state of the recording associated with thisRecordingInfo
.long
getStopTime()
Returns the actual or expected stop time of the recording associated with thisRecordingInfo
, measured as ms since epoch, ornull
if the expected or actual stop time is not known, which can only happen if the recording has not yet been stopped.boolean
isToDisk()
Returnstrue
if recording associated with thisRecordingInfo
should be flushed to disk, when memory buffers are full,false
otherwise.String
toString()
Returns a string description of the recording associated with thisRecordingInfo
-
-
-
Method Detail
-
getName
public String getName()
Returns the name of the recording associated with thisRecordingInfo
.- Returns:
- the recording name, not
null
- See Also:
Recording.getName()
-
getId
public long getId()
Returns the unique id for the recording associated with thisRecordingInfo
.- Returns:
- the recording id
- See Also:
Recording.getId()
-
getDumpOnExit
public boolean getDumpOnExit()
Returns if the recording associated with thisRecordingInfo
should be dumped to file when the JVM exits.- Returns:
true
if recording should be dumped on exit,false
otherwise- See Also:
Recording.getDumpOnExit()
-
getMaxAge
public long getMaxAge()
Returns how many seconds data should be kept on disk, or0
if data is to be kept forever.In-memory recordings are not affected by max age.
- Returns:
- how long data should be kept on disk, measured in seconds
- See Also:
Recording.getMaxAge()
,Recording.setToDisk(boolean)
-
getMaxSize
public long getMaxSize()
Returns the amount of data, measured in bytes, the recording associated with thisRecordingInfo
, should be kept on disk, before it's rotated away, or {code 0} if data is to be kept indefinitely.In-memory recordings are not affected by max size.
- Returns:
- the amount of data should be kept on disk, in bytes
- See Also:
Recording.setToDisk(boolean)
,Recording.getMaxSize()
-
getState
public String getState()
Returns aString
representation of state of the recording associated with thisRecordingInfo
.Valid return values are
NEW
,DELAYED
,STARTING
,RUNNING
,STOPPING
,STOPEED
andCLOSED
.- Returns:
- the recording state, not
null
- See Also:
Enum.toString()
,Recording.getState()
-
getStartTime
public long getStartTime()
Returns start time of the recording associated with thisRecordingInfo
, measured as ms since epoch, ornull
if the recording hasn't started.- Returns:
- the start time of the recording, or
null
if the recording hasn't started - See Also:
Recording.getStartTime()
-
getStopTime
public long getStopTime()
Returns the actual or expected stop time of the recording associated with thisRecordingInfo
, measured as ms since epoch, ornull
if the expected or actual stop time is not known, which can only happen if the recording has not yet been stopped.- Returns:
- the stop time of recording, or
null
if recording hasn't been stopped. - See Also:
Recording.getStopTime()
-
getSettings
public Map<String,String> getSettings()
Returns the settings for the recording associated with thisRecordingInfo
.- Returns:
- the recording settings, not
null
- See Also:
Recording.getSettings()
-
getDestination
public String getDestination()
Returns destination path where data, for the recording associated with thisRecordingInfo
, should be written when the recording stops, ornull
if the recording should not be written.- Returns:
- the destination, or
null
if not set - See Also:
Recording.getDestination()
-
toString
public String toString()
Returns a string description of the recording associated with thisRecordingInfo
-
getSize
public long getSize()
Returns the amount data recorded by recording. associated with thisRecordingInfo
.- Returns:
- the amount of recorded data, measured in bytes
-
isToDisk
public boolean isToDisk()
Returnstrue
if recording associated with thisRecordingInfo
should be flushed to disk, when memory buffers are full,false
otherwise.- Returns:
true
if recording is to disk,false
otherwise
-
getDuration
public long getDuration()
Returns the desired duration, measured in seconds, of the recording associated with thisRecordingInfo
, or {code 0} if no duration has been set.- Returns:
- the desired duration, or {code 0} if no duration has been set
- See Also:
Recording.getDuration()
-
from
public static RecordingInfo from(CompositeData cd)
Returns aRecordingInfo
represented by the specifiedCompositeData
The supplied
CompositeData
must have the following item names and item types to be valid.The name and type the specified CompositeData must contain Name Type id Long
name String
state String
dumpOnExit Boolean
size Long
disk 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 forSettingDescriptorInfo
as specified in theSettingDescriptorInfo.from(javax.management.openmbean.CompositeData)
method.- Parameters:
cd
-CompositeData
representing theRecordingInfo
to return- Returns:
- the
RecordingInfo
represented bycd
, ornull
ifcd
isnull
- Throws:
IllegalArgumentException
- ifcd
does not represent a validRecordingInfo
-
-