This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch OAK-11622
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/OAK-11622 by this push:
new 4a9c7e33f1 OAK-11622: Clock improvements - use SystemPropertySupplier
4a9c7e33f1 is described below
commit 4a9c7e33f1f0e58bdfd45d80f86a3b2577d0a7b1
Author: Julian Reschke <[email protected]>
AuthorDate: Tue Apr 1 09:21:28 2025 +0100
OAK-11622: Clock improvements - use SystemPropertySupplier
---
.../src/main/java/org/apache/jackrabbit/oak/stats/Clock.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git
a/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/stats/Clock.java
b/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/stats/Clock.java
index 0805b9bb20..ec2d780e8f 100644
--- a/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/stats/Clock.java
+++ b/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/stats/Clock.java
@@ -16,6 +16,8 @@
*/
package org.apache.jackrabbit.oak.stats;
+import org.apache.jackrabbit.oak.commons.properties.SystemPropertySupplier;
+
import java.io.Closeable;
import java.time.Instant;
import java.time.ZoneId;
@@ -45,7 +47,7 @@ public abstract class Clock extends java.time.Clock {
* the effect of an inaccurate system clock.
*/
private static final int SIMPLE_CLOCK_NOISE =
- Integer.getInteger("simple.clock.noise", 0);
+ SystemPropertySupplier.create("simple.clock.noise", 0).get();
/**
* Millisecond granularity of the {@link #ACCURATE} clock.
@@ -54,15 +56,15 @@ public abstract class Clock extends java.time.Clock {
* code that relies on millisecond timestamps.
*/
private static final long ACCURATE_CLOCK_GRANULARITY =
- Long.getLong("accurate.clock.granularity", 1);
+ SystemPropertySupplier.create("accurate.clock.granularity",
1L).get();
/**
* Millisecond update interval of the {@link Fast} clock. Configurable
- * by the "fast.clock.interval" system property to to make it easier
+ * by the "fast.clock.interval" system property to make it easier
* to test the effect of different update frequencies.
*/
static final long FAST_CLOCK_INTERVAL =
- Long.getLong("fast.clock.interval", 10);
+ SystemPropertySupplier.create("fast.clock.interval", 10L).get();
private long monotonic = 0;