dant3 commented on code in PR #7250:
URL: https://github.com/apache/ignite-3/pull/7250#discussion_r2651391279
##########
modules/page-memory/src/test/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointTimeoutLockTest.java:
##########
@@ -407,4 +417,46 @@ private Checkpointer newCheckpointer(Thread runner,
CompletableFuture<?> future)
return checkpointer;
}
+
+ @Test
+ void testCheckpointReadLockMetrics() throws Exception {
+ CheckpointMetricSource metricSource = new
CheckpointMetricSource("test");
+ CheckpointReadWriteLockMetrics metrics = new
CheckpointReadWriteLockMetrics(metricSource);
+ CheckpointReadWriteLock readWriteLock = newReadWriteLock(metrics);
+
+ timeoutLock = new CheckpointTimeoutLock(
+ readWriteLock,
+ 10_000,
+ () -> NOT_REQUIRED,
+ mock(Checkpointer.class),
+ mock(FailureManager.class)
+ );
+
+ timeoutLock.start();
+
+ try {
+ // Verify metrics start at zero
+
assertTrue(Arrays.stream(metrics.readLockAcquisitionTime().value()).allMatch(it
-> it == 0L));
Review Comment:
I changed this assertion to be an explicit check of sum of all the buckets
hits, this way it will be more fair and will hopefully clarify better the
intent of the check (in the javadoc)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]