RFR: 8257424: Add setName() to RecordingStream
Erik Gahlin
egahlin at openjdk.java.net
Tue Dec 1 02:11:00 UTC 2020
On Tue, 1 Dec 2020 01:55:16 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
>> `RemoteRecordingStream` would set the specified recording name.
>> https://github.com/openjdk/jdk/blob/master/src/jdk.management.jfr/share/classes/jdk/management/jfr/RemoteRecordingStream.java#L278
>>
>>> The underlying recording is an implementation detail, not sure it should show up in jcmd at all.
>>
>> If so, why `RemoteRecordingStream` will set the name?
>>
>>> Also, RemoteRecordingStream and RecordingStream should be interchangeable and setting the name on RemoteRecordingStream will not work with the current implementation.
>>
>> I think we can add `setName()` to both `RecordingStream` and `RemoteRecordingStream`, and also it is nature because `RemoteRecordingStream` will set specified name in current behavior.
>
>> `RemoteRecordingStream` would set the specified recording name.
>> https://github.com/openjdk/jdk/blob/master/src/jdk.management.jfr/share/classes/jdk/management/jfr/RemoteRecordingStream.java#L278
>>
>> > The underlying recording is an implementation detail, not sure it should show up in jcmd at all.
>>
>> If so, why `RemoteRecordingStream` will set the name?
>>
>> > Also, RemoteRecordingStream and RecordingStream should be interchangeable and setting the name on RemoteRecordingStream will not work with the current implementation.
>>
>> I think we can add `setName()` to both `RecordingStream` and `RemoteRecordingStream`, and also it is nature because `RemoteRecordingStream` will set specified name in current behavior.
>
> The name is used to identify if it is a streaming recording, so it is closed properly. See OngoingStream. This is not an ideal solution, but it works for now.
If you want to make the name of a RecordingStream "Recording Stream" + creationTime.toString(), for consistency and debuggability, I'm fine with that, but I rather not add an API method, at least not now.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1520
More information about the hotspot-jfr-dev
mailing list