ibessonov commented on code in PR #7387:
URL: https://github.com/apache/ignite-3/pull/7387#discussion_r2811886751


##########
modules/page-memory/src/test/java/org/apache/ignite/internal/pagememory/persistence/store/FilePageStoreIoTest.java:
##########
@@ -113,6 +124,40 @@ void testCheckHeader() throws Exception {
         }
     }
 
+    @Test
+    void testIoMetricsRecordedDuringActualFileOperations() throws Exception {
+        Path testFilePath = workDir.resolve("test");
+
+        CollectionMetricSource ioMetricSource = new 
CollectionMetricSource("testPageStoreIo", "storage", "Page memory I/O metrics");
+        PageMemoryIoMetrics ioMetrics = new 
PageMemoryIoMetrics(ioMetricSource);
+        MetricSet metricSet = ioMetricSource.enable();
+
+        long pageId = pageId(0, FLAG_DATA, 0);
+
+        try (FilePageStoreIo filePageStoreIo = 
createFilePageStoreIo(testFilePath, ioMetrics)) {
+            // Verify metrics start at zero
+            assertMetricValue(metricSet, PageMemoryIoMetrics.TOTAL_BYTES_READ, 
 0L);
+            assertMetricValue(metricSet, 
PageMemoryIoMetrics.TOTAL_BYTES_WRITTEN,  0L);
+
+            // Perform write operation
+            ByteBuffer writeBuffer = createPageByteBuffer(pageId, PAGE_SIZE);
+            filePageStoreIo.write(pageId, writeBuffer);

Review Comment:
   I see, my mistake



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