You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/03/01 10:52:24 UTC

[GitHub] [ignite] Sega76 opened a new pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Sega76 opened a new pull request #8840:
URL: https://github.com/apache/ignite/pull/8840


   …uffers to the current file and start recording to the next file.
   
   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r597787907



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -278,6 +325,35 @@ private void stopWriter() {
         log.info("Performance statistics writer stopped.");
     }
 
+    /** Rotate performance statistics writer. */
+    private void rotateWriter() throws IgniteCheckedException, IOException {
+        try {
+            FilePerformanceStatisticsWriter oldWriter = null;
+
+            synchronized (mux) {
+                if (writer != null) {
+                    FilePerformanceStatisticsWriter newWriter = new FilePerformanceStatisticsWriter(ctx);
+
+                    newWriter.start();
+
+                    oldWriter = writer;
+
+                    writer = newWriter;
+
+                    oldWriter.stop();
+                }
+            }
+
+            if (oldWriter != null)
+                log.info("Performance statistics writer rotated[writtenFile=" + oldWriter.getFile() + "].");
+        }
+        catch (IgniteCheckedException | IOException e) {
+            log.error("Failed to rotate performance statistics writer.", e);

Review comment:
       we will get an error when getting the result.
   I find this information useful here




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

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



[GitHub] [ignite] NSAmelchev commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
NSAmelchev commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r585784263



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -214,6 +216,23 @@ public void stopCollectStatistics() throws IgniteCheckedException {
         metastorage.write(PERF_STAT_KEY, false);
     }
 
+    /**
+     * Rotate file collecting performance statistics.
+     *
+     * @throws IgniteCheckedException If stopping failed.
+     */
+    public void rotateCollectStatistics() throws IgniteCheckedException {
+        A.notNull(metastorage, "Metastorage not ready. Node not started?");
+
+        if (ctx.isStopping())
+            throw new NodeStoppingException("Operation has been cancelled (node is stopping)");
+
+        if (!enabled())
+            throw new IgniteCheckedException("Performance statistics collection not started.");
+
+        ctx.task().execute(PerformanceStatisticsRotateTask.class.getName(),new VisorTaskArgument());

Review comment:
       I suggest do not use the Visor's task in the core module. Lets do something like `CreateSnapshotCallable`

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -278,6 +297,30 @@ private void stopWriter() {
         log.info("Performance statistics writer stopped.");
     }
 
+    /** Rotate performance statistics writer. */
+    public void rotateWriter() {
+        try {
+            synchronized (mux) {
+                if (writer == null)
+                    return;
+
+                FilePerformanceStatisticsWriter newWriter = new FilePerformanceStatisticsWriter(ctx);
+
+                newWriter.start();
+
+                FilePerformanceStatisticsWriter oldWriter = writer;
+
+                writer = newWriter;
+
+                oldWriter.stop();
+            }

Review comment:
       Add line break, please

##########
File path: modules/control-utility/src/test/java/org/apache/ignite/util/PerformanceStatisticsCommandTest.java
##########
@@ -73,6 +80,16 @@ public void testCommands() throws Exception {
         assertEquals(EXIT_CODE_OK, res);
         assertEquals(STATUS_ENABLED, lastOperationResult);
 
+        res = execute(PERFORMANCE_STATISTICS.text(), ROTATE.toString());
+
+        assertEquals(EXIT_CODE_OK, res);

Review comment:
       File rotation must be checked.




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

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



[GitHub] [ignite] NSAmelchev commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
NSAmelchev commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r586457169



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -214,6 +220,29 @@ public void stopCollectStatistics() throws IgniteCheckedException {
         metastorage.write(PERF_STAT_KEY, false);
     }
 
+    /**
+     * Rotate collecting performance statistics.
+     *
+     * @throws IgniteCheckedException If stopping failed.
+     */
+    public IgniteInternalFuture<Void> rotateCollectStatistics() throws IgniteCheckedException {
+        A.notNull(metastorage, "Metastorage not ready. Node not started?");

Review comment:
       This is unnecessary




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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r586022448



##########
File path: modules/control-utility/src/test/java/org/apache/ignite/util/PerformanceStatisticsCommandTest.java
##########
@@ -73,6 +80,16 @@ public void testCommands() throws Exception {
         assertEquals(EXIT_CODE_OK, res);
         assertEquals(STATUS_ENABLED, lastOperationResult);
 
+        res = execute(PERFORMANCE_STATISTICS.text(), ROTATE.toString());
+
+        assertEquals(EXIT_CODE_OK, res);

Review comment:
       fixed

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -278,6 +297,30 @@ private void stopWriter() {
         log.info("Performance statistics writer stopped.");
     }
 
+    /** Rotate performance statistics writer. */
+    public void rotateWriter() {
+        try {
+            synchronized (mux) {
+                if (writer == null)
+                    return;
+
+                FilePerformanceStatisticsWriter newWriter = new FilePerformanceStatisticsWriter(ctx);
+
+                newWriter.start();
+
+                FilePerformanceStatisticsWriter oldWriter = writer;
+
+                writer = newWriter;
+
+                oldWriter.stop();
+            }

Review comment:
       done




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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r597086164



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -214,6 +234,33 @@ public void stopCollectStatistics() throws IgniteCheckedException {
         metastorage.write(PERF_STAT_KEY, false);
     }
 
+    /**
+     * Rotate collecting performance statistics.
+     *
+     * @throws IgniteCheckedException If rotating failed.
+     */
+    public IgniteInternalFuture<?> rotateCollectStatistics() throws IgniteCheckedException {
+        if (ctx.isStopping())
+            throw new NodeStoppingException("Operation has been cancelled (node is stopping)");
+
+        if (!enabled())
+            throw new IgniteCheckedException("Performance statistics collection not started.");
+
+        return rotateProc.start(UUID.randomUUID(), null).chain(

Review comment:
       happens twice




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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r586505310



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -214,6 +220,29 @@ public void stopCollectStatistics() throws IgniteCheckedException {
         metastorage.write(PERF_STAT_KEY, false);
     }
 
+    /**
+     * Rotate collecting performance statistics.
+     *
+     * @throws IgniteCheckedException If stopping failed.
+     */
+    public IgniteInternalFuture<Void> rotateCollectStatistics() throws IgniteCheckedException {
+        A.notNull(metastorage, "Metastorage not ready. Node not started?");

Review comment:
       fixed

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -278,6 +307,31 @@ private void stopWriter() {
         log.info("Performance statistics writer stopped.");
     }
 
+    /** Rotate performance statistics writer. */
+    public void rotateWriter() {

Review comment:
       fixed




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

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



[GitHub] [ignite] NSAmelchev commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
NSAmelchev commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r601379146



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -278,6 +307,29 @@ private void stopWriter() {
         log.info("Performance statistics writer stopped.");
     }
 
+    /** Rotate performance statistics writer. */
+    private void rotateWriter() throws Exception {
+        FilePerformanceStatisticsWriter oldWriter = null;
+
+        synchronized (mux) {
+            if (writer == null)
+                return;
+
+            FilePerformanceStatisticsWriter newWriter = new FilePerformanceStatisticsWriter(ctx);
+
+            newWriter.start();
+
+            oldWriter = writer;
+
+            writer = newWriter;
+
+            oldWriter.stop();
+        }
+
+        if (oldWriter != null)

Review comment:
       Add `log.isInfoEnabled()`, please




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r587367872



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -214,6 +220,27 @@ public void stopCollectStatistics() throws IgniteCheckedException {
         metastorage.write(PERF_STAT_KEY, false);
     }
 
+    /**
+     * Rotate collecting performance statistics.
+     *
+     * @throws IgniteCheckedException If rotating failed.
+     */
+    public IgniteInternalFuture<Void> rotateCollectStatistics() throws IgniteCheckedException {
+        if (!allNodesSupports(ctx.discovery().allNodes(), IgniteFeatures.PERFORMANCE_STATISTICS_ROTATE))

Review comment:
       This check is redundant. Let's remove it.




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

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



[GitHub] [ignite] NSAmelchev commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
NSAmelchev commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r586444029



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -278,6 +307,31 @@ private void stopWriter() {
         log.info("Performance statistics writer stopped.");
     }
 
+    /** Rotate performance statistics writer. */
+    public void rotateWriter() {

Review comment:
       Can be private




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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r586618055



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsRotateFileTest.java
##########
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.performancestatistics;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.testframework.ListeningTestLogger;
+import org.apache.ignite.testframework.LogListener;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.internal.processors.performancestatistics.AbstractPerformanceStatisticsTest.ClientType.CLIENT;
+import static org.apache.ignite.internal.processors.performancestatistics.AbstractPerformanceStatisticsTest.ClientType.SERVER;
+import static org.apache.ignite.testframework.GridTestUtils.assertThrows;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/**
+ * Performance statistics file rotation tests.
+ */
+@RunWith(Parameterized.class)
+public class PerformanceStatisticsRotateFileTest extends AbstractPerformanceStatisticsTest {
+    /** Nodes count. */
+    private static final int NODES_CNT = 2;
+
+    /** Client type to run operations from. */
+    @Parameterized.Parameter
+    public ClientType clientType;
+
+    /** @return Test parameters. */
+    @Parameterized.Parameters(name = "clientType={0}")
+    public static Collection<?> parameters() {
+        return Arrays.asList(new Object[][] {{SERVER}, {CLIENT}});
+    }
+
+    /** Ignite. */
+    private static IgniteEx srv;
+
+    /** Listener test logger. */
+    private static final ListeningTestLogger listeningTestLog = new ListeningTestLogger();
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+        cfg.setCacheConfiguration(defaultCacheConfiguration());
+        cfg.setGridLogger(listeningTestLog);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        srv = startGrid(NODES_CNT - 1);
+
+        startClientGrid(NODES_CNT);
+    }
+
+    /** @throws Exception If failed. */
+    @Test
+    public void testRotateFile() throws Exception {
+        int cnt = 5;
+
+        assertThrows(null, AbstractPerformanceStatisticsTest::rotateCollectStatistics, IgniteException.class,

Review comment:
       fixed




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r597521424



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/FilePerformanceStatisticsWriter.java
##########
@@ -188,6 +191,11 @@ public synchronized void stop() {
         started = false;
     }
 
+    /** @return Performance statistics file. */
+    public File getFile() {

Review comment:
       This method can be package private.




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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r597093861



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/util/distributed/DistributedProcess.java
##########
@@ -180,7 +182,9 @@ public DistributedProcess(
                 return;
             }
 
-            finish.apply(p.id,msg.result(), msg.error());
+            finish.apply(p.id, msg.result(), msg.error());

Review comment:
       fixed

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -214,6 +234,33 @@ public void stopCollectStatistics() throws IgniteCheckedException {
         metastorage.write(PERF_STAT_KEY, false);
     }
 
+    /**
+     * Rotate collecting performance statistics.
+     *
+     * @throws IgniteCheckedException If rotating failed.

Review comment:
       done

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/FilePerformanceStatisticsReader.java
##########
@@ -77,7 +77,7 @@
         "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}";
 
     /** File name pattern. */
-    private static final Pattern FILE_PATTERN = Pattern.compile("^node-(" + UUID_STR_PATTERN + ")(-\\d+)?.prf$");
+    static final Pattern FILE_PATTERN = Pattern.compile("^node-(" + UUID_STR_PATTERN + ")(-(\\d+))?.prf$");

Review comment:
       fixed

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -278,6 +325,32 @@ private void stopWriter() {
         log.info("Performance statistics writer stopped.");
     }
 
+    /** Rotate performance statistics writer. */
+    private void rotateWriter() throws IgniteCheckedException, IOException {
+        try {
+            synchronized (mux) {
+                if (writer != null) {
+                    FilePerformanceStatisticsWriter newWriter = new FilePerformanceStatisticsWriter(ctx);
+
+                    newWriter.start();
+
+                    FilePerformanceStatisticsWriter oldWriter = writer;
+
+                    writer = newWriter;
+
+                    oldWriter.stop();
+                }
+            }
+
+            log.info("Performance statistics writer rotated.");

Review comment:
       done




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r596920843



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -214,6 +234,33 @@ public void stopCollectStatistics() throws IgniteCheckedException {
         metastorage.write(PERF_STAT_KEY, false);
     }
 
+    /**
+     * Rotate collecting performance statistics.
+     *
+     * @throws IgniteCheckedException If rotating failed.
+     */
+    public IgniteInternalFuture<?> rotateCollectStatistics() throws IgniteCheckedException {
+        if (ctx.isStopping())
+            throw new NodeStoppingException("Operation has been cancelled (node is stopping)");
+
+        if (!enabled())
+            throw new IgniteCheckedException("Performance statistics collection not started.");
+
+        return rotateProc.start(UUID.randomUUID(), null).chain(

Review comment:
       What will happens if rotation process already running?




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

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



[GitHub] [ignite] NSAmelchev merged pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
NSAmelchev merged pull request #8840:
URL: https://github.com/apache/ignite/pull/8840


   


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

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



[GitHub] [ignite] NSAmelchev commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
NSAmelchev commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r586444252



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsRotateFileTest.java
##########
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.performancestatistics;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.testframework.ListeningTestLogger;
+import org.apache.ignite.testframework.LogListener;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.internal.processors.performancestatistics.AbstractPerformanceStatisticsTest.ClientType.CLIENT;
+import static org.apache.ignite.internal.processors.performancestatistics.AbstractPerformanceStatisticsTest.ClientType.SERVER;
+import static org.apache.ignite.testframework.GridTestUtils.assertThrows;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/**
+ * Performance statistics file rotation tests.
+ */
+@RunWith(Parameterized.class)
+public class PerformanceStatisticsRotateFileTest extends AbstractPerformanceStatisticsTest {
+    /** Nodes count. */
+    private static final int NODES_CNT = 2;
+
+    /** Client type to run operations from. */
+    @Parameterized.Parameter
+    public ClientType clientType;
+
+    /** @return Test parameters. */
+    @Parameterized.Parameters(name = "clientType={0}")
+    public static Collection<?> parameters() {
+        return Arrays.asList(new Object[][] {{SERVER}, {CLIENT}});
+    }
+
+    /** Ignite. */
+    private static IgniteEx srv;
+
+    /** Listener test logger. */
+    private static final ListeningTestLogger listeningTestLog = new ListeningTestLogger();
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+        cfg.setCacheConfiguration(defaultCacheConfiguration());
+        cfg.setGridLogger(listeningTestLog);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        srv = startGrid(NODES_CNT - 1);
+
+        startClientGrid(NODES_CNT);
+    }
+
+    /** @throws Exception If failed. */
+    @Test
+    public void testRotateFile() throws Exception {
+        int cnt = 5;
+
+        assertThrows(null, AbstractPerformanceStatisticsTest::rotateCollectStatistics, IgniteException.class,

Review comment:
       `log` can be passed




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r597800054



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -291,4 +365,25 @@ private void write(Consumer<FilePerformanceStatisticsWriter> c) {
         /** This method is called whenever the performance statistics collecting is started. */
         public void onStarted();
     }
+
+    /** Rotate performance statistics future. */
+    protected static class RotateFuture extends GridFutureAdapter<Serializable> {

Review comment:
       Why do we need this new class?




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r596926753



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -278,6 +325,32 @@ private void stopWriter() {
         log.info("Performance statistics writer stopped.");
     }
 
+    /** Rotate performance statistics writer. */
+    private void rotateWriter() throws IgniteCheckedException, IOException {
+        try {
+            synchronized (mux) {
+                if (writer != null) {
+                    FilePerformanceStatisticsWriter newWriter = new FilePerformanceStatisticsWriter(ctx);
+
+                    newWriter.start();
+
+                    FilePerformanceStatisticsWriter oldWriter = writer;
+
+                    writer = newWriter;
+
+                    oldWriter.stop();
+                }
+            }
+
+            log.info("Performance statistics writer rotated.");

Review comment:
       Let's log a file that can be used for analysis here.
   
   `Performance statistics writer rotated[writtenFile=001.prf]`




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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r596871375



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/util/distributed/EmptySerializable.java
##########
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.distributed;
+
+import java.io.Serializable;
+
+/**
+ * Empty serializable.
+ */
+public class EmptySerializable implements Serializable {

Review comment:
       fixed




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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r586026159



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -214,6 +216,23 @@ public void stopCollectStatistics() throws IgniteCheckedException {
         metastorage.write(PERF_STAT_KEY, false);
     }
 
+    /**
+     * Rotate file collecting performance statistics.
+     *
+     * @throws IgniteCheckedException If stopping failed.
+     */
+    public void rotateCollectStatistics() throws IgniteCheckedException {
+        A.notNull(metastorage, "Metastorage not ready. Node not started?");
+
+        if (ctx.isStopping())
+            throw new NodeStoppingException("Operation has been cancelled (node is stopping)");
+
+        if (!enabled())
+            throw new IgniteCheckedException("Performance statistics collection not started.");
+
+        ctx.task().execute(PerformanceStatisticsRotateTask.class.getName(),new VisorTaskArgument());

Review comment:
       done




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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r597788778



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/FilePerformanceStatisticsWriter.java
##########
@@ -188,6 +191,11 @@ public synchronized void stop() {
         started = false;
     }
 
+    /** @return Performance statistics file. */
+    public File getFile() {

Review comment:
       done




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r597516046



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -278,6 +325,35 @@ private void stopWriter() {
         log.info("Performance statistics writer stopped.");
     }
 
+    /** Rotate performance statistics writer. */
+    private void rotateWriter() throws IgniteCheckedException, IOException {
+        try {
+            FilePerformanceStatisticsWriter oldWriter = null;
+
+            synchronized (mux) {
+                if (writer != null) {
+                    FilePerformanceStatisticsWriter newWriter = new FilePerformanceStatisticsWriter(ctx);
+
+                    newWriter.start();
+
+                    oldWriter = writer;
+
+                    writer = newWriter;
+
+                    oldWriter.stop();
+                }
+            }
+
+            if (oldWriter != null)
+                log.info("Performance statistics writer rotated[writtenFile=" + oldWriter.getFile() + "].");
+        }
+        catch (IgniteCheckedException | IOException e) {
+            log.error("Failed to rotate performance statistics writer.", e);

Review comment:
       Why do we need to log exception here? 
   Is it not logged elsewhere?




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r597541616



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/performancestatistics/AbstractPerformanceStatisticsTest.java
##########
@@ -42,6 +47,10 @@
     /** */
     public static final long TIMEOUT = 30_000;
 
+    /** File performance statistics pattern {@link FilePerformanceStatisticsReader}. */
+    static final Pattern FILE_PATTERN = Pattern.compile(

Review comment:
       Why do we need to copy-paste regexp here?




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r596215770



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/util/distributed/EmptySerializable.java
##########
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.distributed;
+
+import java.io.Serializable;
+
+/**
+ * Empty serializable.
+ */
+public class EmptySerializable implements Serializable {

Review comment:
       Why do we need this file?




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r596919324



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/util/distributed/DistributedProcess.java
##########
@@ -180,7 +182,9 @@ public DistributedProcess(
                 return;
             }
 
-            finish.apply(p.id,msg.result(), msg.error());
+            finish.apply(p.id, msg.result(), msg.error());

Review comment:
       Why this change?




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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r597788884



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/performancestatistics/AbstractPerformanceStatisticsTest.java
##########
@@ -42,6 +47,10 @@
     /** */
     public static final long TIMEOUT = 30_000;
 
+    /** File performance statistics pattern {@link FilePerformanceStatisticsReader}. */
+    static final Pattern FILE_PATTERN = Pattern.compile(

Review comment:
       fixed

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/util/distributed/DistributedProcess.java
##########
@@ -242,13 +246,20 @@ else if (F.eq(ctx.localNodeId(), p.crdId)) {
      *
      * @param id Process id.
      * @param req Initial request.
+     * @return Future on the result of the finished process.
      */
-    public void start(UUID id, I req) {
+    public IgniteInternalFuture<T2<Map<UUID, R>, Map<UUID, Exception>>> start(UUID id, @Nullable I req) {

Review comment:
       fixed




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r587356749



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/FilePerformanceStatisticsReader.java
##########
@@ -69,15 +69,15 @@
  * @see FilePerformanceStatisticsWriter
  */
 public class FilePerformanceStatisticsReader {
-    /** Default file read buffer size. */
-    private static final int DFLT_READ_BUFFER_SIZE = (int)(8 * U.MB);
-
     /** Uuid as string pattern. */
-    private static final String UUID_STR_PATTERN =
+    static final String UUID_STR_PATTERN =
         "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}";
 
     /** File name pattern. */
-    private static final Pattern FILE_PATTERN = Pattern.compile("^node-(" + UUID_STR_PATTERN + ")(-\\d+)?.prf$");
+    static final Pattern FILE_PATTERN = Pattern.compile("^node-(" + UUID_STR_PATTERN + ")(-(\\d+))?.prf$");
+
+    /** Default file read buffer size. */
+    private static final int DFLT_READ_BUFFER_SIZE = (int)(8 * U.MB);

Review comment:
       Why this change? Please, revert moving this constant from 72 to 80 line.




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r596917766



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/FilePerformanceStatisticsReader.java
##########
@@ -77,7 +77,7 @@
         "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}";
 
     /** File name pattern. */
-    private static final Pattern FILE_PATTERN = Pattern.compile("^node-(" + UUID_STR_PATTERN + ")(-\\d+)?.prf$");
+    static final Pattern FILE_PATTERN = Pattern.compile("^node-(" + UUID_STR_PATTERN + ")(-(\\d+))?.prf$");

Review comment:
       Why this change?




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r597516397



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/util/distributed/DistributedProcess.java
##########
@@ -242,13 +246,20 @@ else if (F.eq(ctx.localNodeId(), p.crdId)) {
      *
      * @param id Process id.
      * @param req Initial request.
+     * @return Future on the result of the finished process.
      */
-    public void start(UUID id, I req) {
+    public IgniteInternalFuture<T2<Map<UUID, R>, Map<UUID, Exception>>> start(UUID id, @Nullable I req) {

Review comment:
       Why this change?




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

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



[GitHub] [ignite] Sega76 commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r587869103



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -214,6 +220,27 @@ public void stopCollectStatistics() throws IgniteCheckedException {
         metastorage.write(PERF_STAT_KEY, false);
     }
 
+    /**
+     * Rotate collecting performance statistics.
+     *
+     * @throws IgniteCheckedException If rotating failed.
+     */
+    public IgniteInternalFuture<Void> rotateCollectStatistics() throws IgniteCheckedException {
+        if (!allNodesSupports(ctx.discovery().allNodes(), IgniteFeatures.PERFORMANCE_STATISTICS_ROTATE))

Review comment:
       done

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/FilePerformanceStatisticsReader.java
##########
@@ -69,15 +69,15 @@
  * @see FilePerformanceStatisticsWriter
  */
 public class FilePerformanceStatisticsReader {
-    /** Default file read buffer size. */
-    private static final int DFLT_READ_BUFFER_SIZE = (int)(8 * U.MB);
-
     /** Uuid as string pattern. */
-    private static final String UUID_STR_PATTERN =
+    static final String UUID_STR_PATTERN =
         "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}";
 
     /** File name pattern. */
-    private static final Pattern FILE_PATTERN = Pattern.compile("^node-(" + UUID_STR_PATTERN + ")(-\\d+)?.prf$");
+    static final Pattern FILE_PATTERN = Pattern.compile("^node-(" + UUID_STR_PATTERN + ")(-(\\d+))?.prf$");
+
+    /** Default file read buffer size. */
+    private static final int DFLT_READ_BUFFER_SIZE = (int)(8 * U.MB);

Review comment:
       done




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

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



[GitHub] [ignite] nizhikov commented on a change in pull request #8840: IGNITE-14255: Added the ability to flush all performance statistics buffers to the current file and start recording to the next file.

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8840:
URL: https://github.com/apache/ignite/pull/8840#discussion_r596918821



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -214,6 +234,33 @@ public void stopCollectStatistics() throws IgniteCheckedException {
         metastorage.write(PERF_STAT_KEY, false);
     }
 
+    /**
+     * Rotate collecting performance statistics.
+     *
+     * @throws IgniteCheckedException If rotating failed.

Review comment:
       typo: rotating -> rotation.




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

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