RFR: JMC-7855: JFR Writer incorrectly uses epoch nanoseconds as the start ticks

Christoph Langer clanger at openjdk.org
Fri Jul 15 13:17:18 UTC 2022


On Thu, 14 Jul 2022 18:44:14 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:

> Currently, the JFR recordings created by the JMC writer will have the start ticks set to the same value as the start timestamp. This will cause problems with the duration calculation which is using directly `System.nanoTime()` and as such the resulting value will be rather nonsensical.
> 
> This PR adds two new recording settings - `startTicks` and `duration` which can be used to write a JFR recording with correct values set. If the user does not set those settings `startTicks` will be set to the value of `System.nanoTime()` at the moment the recording is started (a `Recording` instance is created) and `duration` will be computed as a diff between the current value of `System.nanoTime()` and `startTicks`.

Hi, I made a few initial comments, will try to review it in the next days. One other hint: Maybe you could update your branch with current master?

core/tests/org.openjdk.jmc.flightrecorder.writer.test/src/main/java/org/openjdk/jmc/flightrecorder/testutils/parser/MetadataEvent.java line 1:

> 1: package org.openjdk.jmc.flightrecorder.testutils.parser;

The package declaration should go after the copyright header.

core/tests/org.openjdk.jmc.flightrecorder.writer.test/src/main/java/org/openjdk/jmc/flightrecorder/testutils/parser/package-info.java line 1:

> 1: /**

Copyright header is missing.

core/tests/org.openjdk.jmc.flightrecorder.writer.test/src/main/java/org/openjdk/jmc/flightrecorder/testutils/parser/test/StreamingChunkParserTest.java line 1:

> 1: package org.openjdk.jmc.flightrecorder.testutils.parser.test;

Copyright header is missing.

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

PR: https://git.openjdk.org/jmc/pull/412


More information about the jmc-dev mailing list