Re: Monitoring Java Safepoint Time in JDK16+

2021-06-18 Thread Carter Kozak
On Fri, Jun 18, 2021, at 02:47, David Holmes wrote: > On 18/06/2021 4:35 pm, Alan Bateman wrote: > > On 17/06/2021 22:44, David Holmes wrote: > >> > >> I must admit I'm a bit confused about these implementation-specific > >> MBeans. They are implementation-specific, so no part of the primary > >>

Re: Monitoring Java Safepoint Time in JDK16+

2021-06-17 Thread David Holmes
On 18/06/2021 4:35 pm, Alan Bateman wrote: On 17/06/2021 22:44, David Holmes wrote: I must admit I'm a bit confused about these implementation-specific MBeans. They are implementation-specific, so no part of the primary java.management namespace, but they are provided so that they can be use

Re: Monitoring Java Safepoint Time in JDK16+

2021-06-17 Thread Alan Bateman
On 17/06/2021 22:44, David Holmes wrote: I must admit I'm a bit confused about these implementation-specific MBeans. They are implementation-specific, so no part of the primary java.management namespace, but they are provided so that they can be used - so shutting them behind the modular door

Re: Monitoring Java Safepoint Time in JDK16+

2021-06-17 Thread David Holmes
On 17/06/2021 11:44 pm, Carter Kozak wrote: On 17/06/2021 3:15 pm, Alan Bateman wrote: > On 17/06/2021 02:39, David Holmes wrote: >> In what way does this no longer work? We have a test in >> jdk/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java that >> uses this API and doesn't s

Re: Monitoring Java Safepoint Time in JDK16+

2021-06-17 Thread Carter Kozak
On 17/06/2021 3:15 pm, Alan Bateman wrote: > On 17/06/2021 02:39, David Holmes wrote: >> In what way does this no longer work? We have a test in >> jdk/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java that >> uses this API and doesn't seem to need to do anything to allow access. ?? > T

Re: Monitoring Java Safepoint Time in JDK16+

2021-06-16 Thread David Holmes
On 17/06/2021 3:15 pm, Alan Bateman wrote: On 17/06/2021 02:39, David Holmes wrote: In what way does this no longer work? We have a test in jdk/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java that uses this API and doesn't seem to need to do anything to allow access. ?? That tes

Re: Monitoring Java Safepoint Time in JDK16+

2021-06-16 Thread Alan Bateman
On 17/06/2021 02:39, David Holmes wrote: In what way does this no longer work? We have a test in jdk/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java that uses this API and doesn't seem to need to do anything to allow access. ?? That test is compiled/run with `--add-exports java.

Re: Monitoring Java Safepoint Time in JDK16+

2021-06-16 Thread David Holmes
Hi Carter, On 17/06/2021 5:12 am, Carter Kozak wrote: As java 16 and beyond lock down access to internal components by default, it can be difficult to produce Prometheus-style metrics describing application safepoints. I’ve been monitoring these metrics so that I can be alerted when an applic

Re: Monitoring Java Safepoint Time in JDK16+

2021-06-16 Thread Carter Kozak
Thanks, Erik. Is there any chance you could point me toward the documentation for the jdk.Safepoint* events? It's difficult to tell at a glance if the sum of the differences between the safepoint begin and end times is equivalent to hotspotRuntimeManagementBean.getTotalSafepointTime(). Does tha

Re: Monitoring Java Safepoint Time in JDK16+

2021-06-16 Thread Erik Gahlin
It's possible to access safepoint information using JFR, for example: try (RecordingStream r = new RecordingStream()) { r.enable("jdk.SafepointBegin"); r.enable("jdk.SafepointEnd"); r.onEvent("jdk.SafepointBegin", e -> System.out.println("begin: " + e.getEndTime())); r.onEvent("jdk.Safepo

Monitoring Java Safepoint Time in JDK16+

2021-06-16 Thread Carter Kozak
As java 16 and beyond lock down access to internal components by default, it can be difficult to produce Prometheus-style metrics describing application safepoints. I’ve been monitoring these metrics so that I can be alerted when an application spends more than ~10% of time in safepoints for som