RFR: 8330053: JFR: Use LocalDateTime instead ZonedDateTime [v3]
Andrey Turbanov
aturbanov at openjdk.org
Wed Apr 17 19:52:03 UTC 2024
On Wed, 17 Apr 2024 09:48:29 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
>> Could I have a review of PR that changes so LocalDateTime instead of ZonedDateTime is used when naming chunk files. Problem is that a java.time.DateTimeException occurs when ZonedDateTime.now() is used and the time zone is invalid. This happens in a JCK test.
>>
>> Testing: jdk/jdk/jfr + applicable test in JCK.
>>
>> Thanks
>> Erik
>
> Erik Gahlin has updated the pull request incrementally with one additional commit since the last revision:
>
> Fallback for invalid timezone
src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java line 112:
> 110: } catch (DateTimeException d) {
> 111: Logger.log(LogTag.JFR, LogLevel.INFO, "Could not create LocalDateTime with the default time zone. Using UTC time zone for chunk filename.");
> 112: return LocalDateTime.ofEpochSecond(System.currentTimeMillis(), 0, ZoneOffset.UTC);
@egahlin
`System.currentTimeMillis()` - returns count of **milliseconds**, but `LocalDateTime.ofEpochSecond` expects epoch **seconds** instead of millis.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18729#discussion_r1569420215
More information about the hotspot-jfr-dev
mailing list