On Fri, 17 Nov 2023 16:22:55 GMT, Tim Prinzing <tprinz...@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/java.base/share/classes/jdk/internal/event/SelectionEvent.java line 35: > 33: * {@link #commit(long, long, int)} method > 34: * must be the same as the order of the fields. > 35: */ You should probably define what a "selection operation" is and put a link to `Selector::select`. src/java.base/share/classes/jdk/internal/event/SelectionEvent.java line 38: > 36: public class SelectionEvent extends Event { > 37: > 38: public int count; It could also be interesting to provide the `timeout` that was given to the selection operation. src/java.base/share/classes/sun/nio/ch/SelectorImpl.java line 150: > 148: long duration = SelectionEvent.timestamp() - start; > 149: if (SelectionEvent.shouldCommit(duration)) { > 150: SelectionEvent.commit(start, duration, n); Maybe the value of `timeout` should be provided here? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16710#discussion_r1401948063 PR Review Comment: https://git.openjdk.org/jdk/pull/16710#discussion_r1401950078 PR Review Comment: https://git.openjdk.org/jdk/pull/16710#discussion_r1401951825