SammyVimes commented on code in PR #9924:
URL: https://github.com/apache/ignite/pull/9924#discussion_r889169954


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSandboxTest.java:
##########
@@ -142,25 +151,38 @@ public void testThrottle() throws Exception {
                             if (m.getName().equals("dfltDataRegion"))
                                 dirtyPages = m.getDirtyPages();
 
-                        long cpBufPages = 0;
+                        long cpBufPages;
 
                         long cpWrittenPages;
 
-                        AtomicInteger cntr = 
((GridCacheDatabaseSharedManager)((ignite(0))
-                            
.context().cache().context().database())).getCheckpointer().currentProgress().writtenPagesCounter();
+                        Checkpointer checkpointer = 
((GridCacheDatabaseSharedManager)((ignite(0))
+                            
.context().cache().context().database())).getCheckpointer();
+                        AtomicInteger cntr = 
checkpointer.currentProgress().writtenPagesCounter();
 
                         cpWrittenPages = cntr == null ? 0 : cntr.get();
 
                         try {
-                            cpBufPages = 
((ignite(0)).context().cache().context().database()
-                                
.dataRegion("dfltDataRegion").pageMemory()).checkpointBufferPagesCount();
+                            PageMemoryEx pageMemory = 
(PageMemoryEx)(ignite(0)).context().cache().context().database()
+                                .dataRegion("dfltDataRegion").pageMemory();
+                            cpBufPages = 
pageMemory.checkpointBufferPagesCount();
+
+                            if (System.nanoTime() - startNanos > 
TimeUnit.SECONDS.toNanos(10)) {
+                                double currentDirtyRatio = (double)dirtyPages 
/ pageMemory.totalPages();
+                                double newMaxDirtyRatio = 
Math.max(maxDirtyRatio.get(), currentDirtyRatio);
+                                maxDirtyRatio.set(newMaxDirtyRatio);
+                            }
                         }
                         catch (IgniteCheckedException e) {
                             e.printStackTrace();
+                            throw new RuntimeException("Something went wrong", 
e);
                         }
 
-                        System.out.println("@@@ putsPerSec=," + 
(putRate.value()) + ", getsPerSec=," + (getRate.value()) + ", dirtyPages=,"
-                            + dirtyPages + ", cpWrittenPages=," + 
cpWrittenPages + ", cpBufPages=," + cpBufPages);
+                        System.out.println("@@@ globalPutsPerSec="

Review Comment:
   ok



-- 
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]

Reply via email to