[hibernate-issues] [JIRA] (HHH-13879) Slow query log should use System#nanoTime not System#currentTimeMillis

Vlad Mihalcea (JIRA) jira at hibernate.atlassian.net
Tue Feb 25 09:26:18 EST 2020


Vlad Mihalcea ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Af5e8c0d3-3aae-4bb4-a4e1-25463d60d232 ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMjJmYzYyZjY0YzMwNDcwZmFiMTBlMzZkNzNhZmEzZjAiLCJwIjoiaiJ9 ) / Improvement ( https://hibernate.atlassian.net/browse/HHH-13879?atlOrigin=eyJpIjoiMjJmYzYyZjY0YzMwNDcwZmFiMTBlMzZkNzNhZmEzZjAiLCJwIjoiaiJ9 ) HHH-13879 ( https://hibernate.atlassian.net/browse/HHH-13879?atlOrigin=eyJpIjoiMjJmYzYyZjY0YzMwNDcwZmFiMTBlMzZkNzNhZmEzZjAiLCJwIjoiaiJ9 ) Slow query log should use System#nanoTime not System#currentTimeMillis ( https://hibernate.atlassian.net/browse/HHH-13879?atlOrigin=eyJpIjoiMjJmYzYyZjY0YzMwNDcwZmFiMTBlMzZkNzNhZmEzZjAiLCJwIjoiaiJ9 )

Issue Type: Improvement Affects Versions: 5.4.12 Assignee: Vlad Mihalcea ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Af5e8c0d3-3aae-4bb4-a4e1-25463d60d232 ) Components: hibernate-core Created: 25/Feb/2020 06:26 AM Priority: Major Reporter: Vlad Mihalcea ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Af5e8c0d3-3aae-4bb4-a4e1-25463d60d232 )

Currently, the slow query log using `System#currentTimeMillis`, that is not suitable for calculating time durations, as stated by the Java Doc:

> 
> 
> 
> Note that while the unit of time of the return value is a millisecond, the
> granularity of the value depends on the underlying operating system and
> may be larger. For example, many operating systems measure time in units
> of tens of milliseconds.
> 
> 

We should use `nanoTime` instead.

( https://hibernate.atlassian.net/browse/HHH-13879#add-comment?atlOrigin=eyJpIjoiMjJmYzYyZjY0YzMwNDcwZmFiMTBlMzZkNzNhZmEzZjAiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-13879#add-comment?atlOrigin=eyJpIjoiMjJmYzYyZjY0YzMwNDcwZmFiMTBlMzZkNzNhZmEzZjAiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100121- sha1:a269fed )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200225/f8c594f5/attachment.html 


More information about the hibernate-issues mailing list