Chetan Mehrotra created OAK-3877:
------------------------------------
Summary: PerfLogger should use System.nanoTime instead of
System.currentTimeMillis
Key: OAK-3877
URL: https://issues.apache.org/jira/browse/OAK-3877
Project: Jackrabbit Oak
Issue Type: Improvement
Components: core
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
Fix For: 1.4
PerfLogger currently make use of System.currentTimeMillis for timing the
performance. It would be better to make use of System.nanoTime.
Per [~ianeboston]
[comment|https://issues.apache.org/jira/browse/OAK-3654?focusedCommentId=15022031&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15022031]
and [1]
bq. You should always try to use nanoTime to do timing measurement or
calculation
This would provide following benefits
* Simpler integration with Metric stats support which makes use of nanoTime
* No possibility of drift i.e. currentTimeMillis going back in time
[1] https://blogs.oracle.com/dholmes/entry/inside_the_hotspot_vm_clocks
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)