RFR: 5560: Support new nio events in JDK 10.
Henrik Dafgård
hdafgard at openjdk.org
Fri Nov 24 15:39:21 UTC 2023
On Wed, 15 Nov 2023 21:10:27 GMT, Alex Macdonald <aptmac at openjdk.org> wrote:
>> This PR addresses the enhancement request of missing event File Force.
>> 1. A new rule File Force has been added to the "Automated Analysis Page", Under Java Application -> File I/O.
>> <img width="368" alt="image" src="https://github.com/openjdk/jmc/assets/11155712/833747bf-39b8-455f-9081-f7a23a6de3da">
>>
>> 2. "File I/O" screen is updated to accomodate values for the new event. There are two new columns added - Force Count, Update Metadata. Both these columns are hidden by default and user need to make them visible by right clicking the header of the table. Also the corresponding chart for File Force Event has been introduced.
>> <img width="960" alt="image" src="https://github.com/openjdk/jmc/assets/11155712/027400c5-ae83-499e-b4b5-531fe3b74e6a">
>>
>> 3. There is a new preference/configuration introduced for the File Force Rule.
>>
>> <img width="313" alt="image" src="https://github.com/openjdk/jmc/assets/11155712/968b341e-e0cb-4d21-9288-71d56a0b5883">
>
> core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/io/FileForceRule.java line 111:
>
>> 109:
>> 110: // Aggregate of all file forced events - if null, then we had no events
>> 111: if (longestEvent == null) {
>
> I think if you used `EventAvailability.AVAILABLE` instead of `EventAvailability.ENABLED` for the REQUIRED_EVENTS at line 81 then there'd be no need to check if there's any events here.
Yes, if the required events specify that the event type is to be available then JMC won't run this rule on that JFR file if the event is enabled but not present in the file. I'd still say that this is a nit, and not required as being extra defensive is fine here and we might want to improve the core APIs to prevent NPEs in general.
-------------
PR Review Comment: https://git.openjdk.org/jmc/pull/533#discussion_r1404474130
More information about the jmc-dev
mailing list