RFR: 8310996: Add JFR event for connect operations [v5]

Alan Bateman alanb at openjdk.org
Wed Dec 4 12:28:39 UTC 2024


On Tue, 3 Dec 2024 23:42:34 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

>> @egahlin The updated PR proposes two duration events: jdk.SocketConnect for when a connection is established, and jdk.SocketConnectFailed for when a connection cannot be established. Naming aside, it seems that would allow the jfr views that you listed above.
>
> We could have two views with only one event. The query for the view could filter for exceptionMessage != null or a failure property. The advantage of having two events is that the failure event could have a threshold of 0 ms.
> 
> We are planning to add a throttling mechanism for exception events, perhaps per call site. The same mechanism could be used for a failed event. If you receive 500 events per second for a call site, there is little value in having additional events.

We need to help Tim on the question of whether there is one or two events. 

An application that makes outbound network connections may run slowly for several reasons. A duration event may help to diagnose this, irrespective of whether the connection is established successfully or it fails, so one event is okay. Separately, another big source of latency is the name service / DNS lookup which happens before getting to the Socket connect. Maybe further work could add events to InetAddress for this.

When hunting misbehaving behavior then focusing on the cases where a connection cannot be established may be more interesting. So it's possible someone might want to run with threshold=0 to see all failed events. If there is throttling support, and since we control call site for both the successful and failed cases, could we live with one event?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21528#discussion_r1869400913


More information about the hotspot-jfr-dev mailing list