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

Jaroslav Bachorík jaroslav.bachorik at datadoghq.com
Mon Jun 15 15:53:24 UTC 2020


Hi Erik,

On Mon, Jun 15, 2020 at 10:20 AM Erik Gahlin <erik.gahlin at oracle.com> wrote:
>
> Hi Jaroslav,
>
> I wonder if we should remove CPU from the field names and labels in metadata.xml
>
> <Field type="long" contentType="nanos" name="jvmUserCpuTime" label="Elapsed JVM UserTime”/>
>
> becomes
>
> <Field type="long" contentType="nanos" name="jvmUserTime" label="Elapsed JVM User Time”/>
>
> CPU is implicit from the event name and we don’t have it for the other fields.

Yes, this is a good idea.

>
> When does machineTotalCpuTime start?
>
> From when the machine booted or when the JVM process started?

It is pegged to JVM start. Also, the elapsed diff is reported and not
the cumulative value - but that is true for all the newly added CPU
time attributes. Do you think this will need extra clarification or it
could be enough to rely on using the same semantics as the CPU load
values?

-JB-

>
> Maybe we want to make that clear in a description.
>
> Erik
>
> > On 12 Jun 2020, at 12:08, Jaroslav Bachorík <jaroslav.bachorik at datadoghq.com> wrote:
> >
> > Hi all,
> >
> > Here is my attempt at adding the elapsed CPU time to
> > ThreadCPULoadEvent and CPULoadEvent JFR events.
> >
> > I have tested the implementation on Linux, MacOS and Windows and it is
> > working as expected.
> > However, I am not an expert on all of those platforms so if there is
> > an easier way to get the elapsed CPU time than what I am doing now I
> > am open to suggestions.
> >
> > JIRA: https://bugs.openjdk.java.net/browse/JDK-8247471
> > Webrev: http://cr.openjdk.java.net/~jbachorik/8247471
> >
> > Thanks!
> >
> > -JB-
>


More information about the hotspot-jfr-dev mailing list