rpuch commented on code in PR #7250:
URL: https://github.com/apache/ignite-3/pull/7250#discussion_r2652419567
##########
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 actually suggested to keep exactly the same logic you had (like 'all
buckets contain zeros' or 'one bucket contains a 1'), it wasn't about looking
at just a specific bucket.
The approach with computing a sum is also fine, but it's less direct. It's
up to you, though
--
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]