RFR: 8247471: Enhance CPU load events with the actual elapsed CPU time

Erik Gahlin egahlin at openjdk.java.net
Wed May 19 16:44:43 UTC 2021


On Thu, 21 Jan 2021 17:34:58 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:

> A continuation of an RFR thread started last year - https://mail.openjdk.java.net/pipermail/hotspot-jfr-dev/2020-June/001533.html
> 
> This change adds the raw CPU time value to CPU load events (per-thread and per-process as well). 
> The CPU time value is already known and used to calculate the load so adding it to the events does not incur any extra overhead while making it much easier for the end users to eg. aggregate and compare the active execution time per time period without the detailed knowledge how JFR computes and normalizes the CPU load.

It would be nice to have this for JDK 17, but I guess we are stuck on how the elapsed difference should be reported.

I would like to avoid using the duration field, because it's not used for any other event that samples data periodically. We could be opening a can of worms.

If we are going to measure execution time since the last sample, I think we should make it clear in the description, i.e "Elapsed JVM User CPU Time since last sample". While not optimal, a separate field or duration, could be added in a later release, even though it could lead to bugs, if using JFR on an old release where duration is 0 s.

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

PR: https://git.openjdk.java.net/jdk/pull/2186


More information about the hotspot-jfr-dev mailing list