You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Mikhail Mazursky (JIRA)" <ji...@apache.org> on 2013/05/19 15:31:16 UTC
[jira] [Commented] (CASSANDRA-5581) Use System.nanoTime() to
measure intervals
[ https://issues.apache.org/jira/browse/CASSANDRA-5581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661565#comment-13661565 ]
Mikhail Mazursky commented on CASSANDRA-5581:
---------------------------------------------
Some notes:
* ReadCallback.get() computes timeout before calling await() which computes it too. This looks like a bug. I fixed it, but if I'm wrong I can revert this change;
* BulkLoader.ProgressIndicator.printProgress() was not printing correct delta progress in the first iteration because delta time calculation was incorrect. Fixed that by initializing lastTime to the nanoTime() of the operation start;
* SimpleCondition.await() instead of converting "time" into MILLISECONDS from "unit" TimeUnit was convering "time" from MILLISECONDS to "unit" TimeUnit:{noformat}
long end = System.currentTimeMillis() + unit.convert(time, TimeUnit.MILLISECONDS);
{noformat}
Should be
{noformat}
long end = System.currentTimeMillis() + unit.toMillis(time);
{noformat}
> Use System.nanoTime() to measure intervals
> ------------------------------------------
>
> Key: CASSANDRA-5581
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5581
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Mikhail Mazursky
> Priority: Critical
> Attachments: trunk-5581.txt
>
>
> System.nanoTime() should always be prefered to System.currentTimeMillis() to measure time intervals. It's not affected by system clock adjustments & drift.
> While testing C* we found that it's very unstable if system clock drifts. Problems happen even under low load with tiny dataset. In our case other VMs on the same hardware box produced high CPU load and system clock drifted a lot in C* VMs. We fixed that but there is definitelly room for improvement in C* itself.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira