RFR: 8310994: Add JFR event for selection operations

Alan Bateman alanb at openjdk.org
Wed Nov 22 12:30:06 UTC 2023


On Fri, 17 Nov 2023 16:22:55 GMT, Tim Prinzing <tprinzing at openjdk.org> wrote:

> Added mirror event with static methods: jdk.internal.event.SelectionEvent that provides the duration of select calls and the count of how many keys are available.
> 
> Emit the event from SelectorImpl::lockAndDoSelect
> 
> Test at jdk.jfr.event.io.TestSelectionEvents

src/jdk.jfr/share/classes/jdk/jfr/events/SelectionEvent.java line 43:

> 41: 
> 42:     @Label("Selection Count")
> 43:     @Description("Number of channels selected")

I suspect you'll need to rename this event to something like "SelectorSelect" as "Selection" could be anything.

We'll to find a better name for the field and its label too. There are two form of selection operations. One form operates on a selected-key set where the select/selectNow methods returns the number of keys aded to the Selector's ready set. The other form performs an action on each selected key. I'll try to come up a suggestions for the names, I suspect a label "number of channels ready for I/O or added to ready set" would be the most accurate.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16710#discussion_r1401970073


More information about the hotspot-jfr-dev mailing list