Integrated: 7855: JFR Writer incorrectly uses epoch nanoseconds as the start ticks

Jaroslav Bachorik jbachorik at openjdk.org
Tue Oct 11 08:17:34 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`.

This pull request has now been integrated.

Changeset: b1494d2c
Author:    Jaroslav Bachorik <jbachorik at openjdk.org>
Committer: Christoph Langer <clanger at openjdk.org>
URL:       https://git.openjdk.org/jmc/commit/b1494d2cd81a5225e8bd79a55c507ef577476c38
Stats:     1202 lines in 15 files changed: 1187 ins; 0 del; 15 mod

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

Reviewed-by: clanger

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

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


More information about the jmc-dev mailing list