ivanzlenko commented on code in PR #5500:
URL: https://github.com/apache/ignite-3/pull/5500#discussion_r2013967158


##########
modules/page-memory/src/test/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointMetricsTrackerTest.java:
##########
@@ -171,6 +171,19 @@ void testWriteLockWait() {
         assertThat(tracker.writeLockWaitDuration(NANOSECONDS), 
greaterThanOrEqualTo(1L));
     }
 
+    @Test
+    void testWaitPageReplacement() {
+        assertThat(tracker.waitPageReplacementDuration(NANOSECONDS), 
equalTo(0L));
+
+        tracker.onWaitPageReplacementStart();
+
+        waitForTimeChange();
+
+        tracker.onWaitPageReplacementEnd();
+
+        assertThat(tracker.waitPageReplacementDuration(NANOSECONDS), 
greaterThanOrEqualTo(1L));

Review Comment:
   Test gives false positive result



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointMetricsTracker.java:
##########
@@ -337,4 +339,31 @@ public long writeLockHoldDuration(TimeUnit timeUnit) {
     public long beforeWriteLockDuration(TimeUnit timeUnit) {
         return timeUnit.convert(writeLockWaitDuration.startNanos() - 
checkpointDuration.startNanos(), NANOSECONDS);
     }
+
+    /**
+     * Callback to start waiting for page replacement to complete for all 
pages.
+     *
+     * <p>Not thread safe.</p>
+     */
+    public void onWaitPageReplacementStart() {
+        waitPageReplacement.onStart();
+    }
+
+    /**
+     * Callback on end waiting for page replacement to complete for all pages.
+     *
+     * <p>Not thread safe.</p>
+     */
+    public void onWaitPageReplacementEnd() {
+        fsyncDuration.onEnd();
+    }
+
+    /**
+     * Returns checkpoint waiting page replacement to complete duration in the 
given time unit.
+     *
+     * <p>Not thread safe.</p>
+     */
+    public long waitPageReplacementDuration(TimeUnit timeUnit) {
+        return fsyncDuration.duration(timeUnit);

Review Comment:
   Shouldn't it be waitPageReplacement?



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointMetricsTracker.java:
##########
@@ -337,4 +339,31 @@ public long writeLockHoldDuration(TimeUnit timeUnit) {
     public long beforeWriteLockDuration(TimeUnit timeUnit) {
         return timeUnit.convert(writeLockWaitDuration.startNanos() - 
checkpointDuration.startNanos(), NANOSECONDS);
     }
+
+    /**
+     * Callback to start waiting for page replacement to complete for all 
pages.
+     *
+     * <p>Not thread safe.</p>
+     */
+    public void onWaitPageReplacementStart() {
+        waitPageReplacement.onStart();
+    }
+
+    /**
+     * Callback on end waiting for page replacement to complete for all pages.
+     *
+     * <p>Not thread safe.</p>
+     */
+    public void onWaitPageReplacementEnd() {
+        fsyncDuration.onEnd();

Review Comment:
   Shouldn't it be waitPageReplacement? 



-- 
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: notifications-unsubscr...@ignite.apache.org

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

Reply via email to