belliottsmith commented on code in PR #4220:
URL: https://github.com/apache/cassandra/pull/4220#discussion_r2218882618


##########
test/simulator/main/org/apache/cassandra/simulator/systems/SimulatedTime.java:
##########
@@ -274,7 +274,7 @@ public long nanoTime()
                 nextDrift = nanosDriftSupplier.get(random);
                 from = global;
                 to = global + Math.max(baseDrift, nextDrift);
-                diffPerGlobal = (nextDrift - baseDrift) / (double)(to - from);
+                diffPerGlobal = to == from ? 1 : (nextDrift - baseDrift) / 
(double)(to - from);

Review Comment:
   I think it is to ensure monotonicity when the drift is changed, since we use 
this clock for both monotonic and non-monotonic timestamps. That is, we apply 
the new drift as of some future time, and we smear the change in drift over the 
time period.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to