You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Vladsz83 (via GitHub)" <gi...@apache.org> on 2026/08/07 17:03:28 UTC

[PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Vladsz83 opened a new pull request, #13450:
URL: https://github.com/apache/ignite/pull/13450

   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 tab `PR Check` at [TC.Bot - Instance 1](https://tcbot2.sbt-ignite-dev.ru/prs.html) or [TC.Bot - Instance 2](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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13450:
URL: https://github.com/apache/ignite/pull/13450#issuecomment-5226213313

   <!-- ignite-rolling-upgrade-check -->
   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeFullMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientMetricsUpdateMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientNodesMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryMetricsUpdateMessage.java`
   


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #13450:
URL: https://github.com/apache/ignite/pull/13450#discussion_r3759661783


##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java:
##########
@@ -108,16 +107,12 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements Ignite
 
     /** Node metrics. */
     @GridToStringExclude
-    volatile ClusterMetrics metrics;
-
-    /** Node metrics message. */
-    @GridToStringExclude
     @Order(6)
-    volatile NodeMetricsMessage metricsMsg;
+    volatile ClusterMetricsSnapshot clusterMetricsSnapshot;
 
     /** Node cache metrics. */
     @GridToStringExclude
-    private volatile Map<Integer, CacheMetrics> cacheMetrics;
+    private volatile Map<Integer, CacheMetrics> cacheMetricsSnapshot;

Review Comment:
   Is like the cluster metrics. Wierd behavior. There is a metric provider. But we cache metrics sometimes. Unclear. That's why iI raised  IGNITE-28965



##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java:
##########
@@ -315,40 +295,31 @@ public Map<String, Object> getAttributes() {
 
     /** {@inheritDoc} */
     @Override public ClusterMetrics metrics() {
-        if (metricsProvider != null) {
-            ClusterMetrics metrics0 = metricsProvider.metrics();
+        assert clusterMetricsSnapshot != null || metricsProvider != null;

Review Comment:
   Passed test guarantee. Asserts are not for prod. They are for developers, tests. Old metrics are about to get deprecated. I think assert is enough



-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "anton-vinogradov (via GitHub)" <gi...@apache.org>.
anton-vinogradov merged PR #13450:
URL: https://github.com/apache/ignite/pull/13450


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13450:
URL: https://github.com/apache/ignite/pull/13450#issuecomment-5226181520

   <!-- ignite-rolling-upgrade-check -->
   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeFullMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientMetricsUpdateMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientNodesMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryMetricsUpdateMessage.java`
   


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13450:
URL: https://github.com/apache/ignite/pull/13450#issuecomment-5219939542

   <!-- ignite-rolling-upgrade-check -->
   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeFullMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientMetricsUpdateMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientNodesMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryMetricsUpdateMessage.java`
   


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13450:
URL: https://github.com/apache/ignite/pull/13450#issuecomment-5222194057

   <!-- ignite-rolling-upgrade-check -->
   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeFullMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientMetricsUpdateMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientNodesMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryMetricsUpdateMessage.java`
   


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13450:
URL: https://github.com/apache/ignite/pull/13450#issuecomment-5258073270

   <!-- ignite-rolling-upgrade-check -->
   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeFullMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientMetricsUpdateMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientNodesMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryMetricsUpdateMessage.java`
   


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13450:
URL: https://github.com/apache/ignite/pull/13450#issuecomment-5226094546

   <!-- ignite-rolling-upgrade-check -->
   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeFullMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientMetricsUpdateMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientNodesMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryMetricsUpdateMessage.java`
   


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13450:
URL: https://github.com/apache/ignite/pull/13450#issuecomment-5256338486

   <!-- ignite-rolling-upgrade-check -->
   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeFullMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientMetricsUpdateMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientNodesMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryMetricsUpdateMessage.java`
   


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13450:
URL: https://github.com/apache/ignite/pull/13450#issuecomment-5241078792

   <!-- ignite-rolling-upgrade-check -->
   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeFullMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientMetricsUpdateMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientNodesMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryMetricsUpdateMessage.java`
   


-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "anton-vinogradov (via GitHub)" <gi...@apache.org>.
anton-vinogradov commented on code in PR #13450:
URL: https://github.com/apache/ignite/pull/13450#discussion_r3758738625


##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java:
##########
@@ -315,40 +295,31 @@ public Map<String, Object> getAttributes() {
 
     /** {@inheritDoc} */
     @Override public ClusterMetrics metrics() {
-        if (metricsProvider != null) {
-            ClusterMetrics metrics0 = metricsProvider.metrics();
+        assert clusterMetricsSnapshot != null || metricsProvider != null;

Review Comment:
   Assert does nothing at prod, let's guarantee this.



##########
modules/core/src/main/java/org/apache/ignite/internal/ClusterMetricsSnapshot.java:
##########
@@ -96,324 +96,1275 @@ public class ClusterMetricsSnapshot implements ClusterMetrics {
         8/*current PME time*/;
 
     /** */
-    private NodeMetricsMessage m;
+    @Order(0)
+    public int maxActiveJobs = -1;
 
-    /**
-     * Creates empty snapshot.
-     */
+    /** */
+    @Order(1)
+    public int curActiveJobs = -1;
+
+    /** */
+    @Order(2)
+    public float avgActiveJobs = -1;
+
+    /** */
+    @Order(3)
+    public int maxWaitingJobs = -1;
+
+    /** */
+    @Order(4)
+    public int curWaitingJobs = -1;
+
+    /** */
+    @Order(5)
+    public float avgWaitingJobs = -1;
+
+    /** */
+    @Order(6)
+    public int maxRejectedJobs = -1;
+
+    /** */
+    @Order(7)
+    public int curRejectedJobs = -1;
+
+    /** */
+    @Order(8)
+    public float avgRejectedJobs = -1;
+
+    /** */
+    @Order(9)
+    public int maxCancelledJobs = -1;
+
+    /** */
+    @Order(10)
+    public int curCancelledJobs = -1;
+
+    /** */
+    @Order(11)
+    public float avgCancelledJobs = -1;
+
+    /** */
+    @Order(12)
+    public int totalRejectedJobs = -1;
+
+    /** */
+    @Order(13)
+    public int totalCancelledJobs = -1;
+
+    /** */
+    @Order(14)
+    public int totalExecutedJobs = -1;
+
+    /** */
+    @Order(15)
+    public long maxJobWaitTime = -1;
+
+    /** */
+    @Order(16)
+    public long curJobWaitTime = Long.MAX_VALUE;
+
+    /** */
+    @Order(17)
+    public double avgJobWaitTime = -1;
+
+    /** */
+    @Order(18)
+    public long maxJobExecTime = -1;
+
+    /** */
+    @Order(19)
+    public long curJobExecTime = -1;
+
+    /** */
+    @Order(20)
+    public double avgJobExecTime = -1;
+
+    /** */
+    @Order(21)
+    public int totalExecTasks = -1;
+
+    /** */
+    @Order(22)
+    public long totalIdleTime = -1;
+
+    /** */
+    @Order(23)
+    public long curIdleTime = -1;
+
+    /** */
+    @Order(24)
+    public int totalCpus = -1;
+
+    /** */
+    @Order(25)
+    public double curCpuLoad = -1;
+
+    /** */
+    @Order(26)
+    public double avgCpuLoad = -1;
+
+    /** */
+    @Order(27)
+    public double curGcCpuLoad = -1;
+
+    /** */
+    @Order(28)
+    public long heapInit = -1;
+
+    /** */
+    @Order(29)
+    public long heapUsed = -1;
+
+    /** */
+    @Order(30)
+    public long heapCommitted = -1;
+
+    /** */
+    @Order(31)
+    public long heapMax = -1;
+
+    /** */
+    @Order(32)
+    public long heapTotal = -1;
+
+    /** */
+    @Order(33)
+    public long nonHeapInit = -1;
+
+    /** */
+    @Order(34)
+    public long nonHeapUsed = -1;
+
+    /** */
+    @Order(35)
+    public long nonHeapCommitted = -1;
+
+    /** */
+    @Order(36)
+    public long nonHeapMax = -1;
+
+    /** */
+    @Order(37)
+    public long nonHeapTotal = -1;
+
+    /** */
+    @Order(38)
+    public long upTime = -1;
+
+    /** */
+    @Order(39)
+    public long startTime = -1;
+
+    /** */
+    @Order(40)
+    public long nodeStartTime = -1;
+
+    /** */
+    @Order(41)
+    public int threadCnt = -1;
+
+    /** */
+    @Order(42)
+    public int peakThreadCnt = -1;
+
+    /** */
+    @Order(43)
+    public long startedThreadCnt = -1;
+
+    /** */
+    @Order(44)
+    public int daemonThreadCnt = -1;
+
+    /** */
+    @Order(45)
+    public long lastDataVer = -1;
+
+    /** */
+    @Order(46)
+    public int sentMsgsCnt = -1;
+
+    /** */
+    @Order(47)
+    public long sentBytesCnt = -1;
+
+    /** */
+    @Order(48)
+    public int rcvdMsgsCnt = -1;
+
+    /** */
+    @Order(49)
+    public long rcvdBytesCnt = -1;
+
+    /** */
+    @Order(50)
+    public int outMesQueueSize = -1;
+
+    /** */
+    @Order(51)
+    public int totalNodes = -1;
+
+    /** */
+    @Order(52)
+    public long totalJobsExecTime = -1;
+
+    /** */
+    @Order(53)
+    public long curPmeDuration = -1;
+
+    /** */
+    public long lastUpdateTime = -1;
+
+    /** Empty constructor for serialization purposes. */
     public ClusterMetricsSnapshot() {
-        m = new NodeMetricsMessage();
+        // Like in deserialize().
+        lastUpdateTime = System.currentTimeMillis();
     }
 
     /**
-     * Creates snapshot based on the handled message.
+     * Create metrics for given nodes.
+     *
+     * @param nodes Nodes.
      */
-    public ClusterMetricsSnapshot(NodeMetricsMessage m) {
-        // As in #deserialize().
-        m.lastUpdateTime = U.currentTimeMillis();
+    public ClusterMetricsSnapshot(Collection<ClusterNode> nodes) {
+        int size = nodes.size();
+
+        curJobWaitTime = Long.MAX_VALUE;
+        lastUpdateTime = 0;
+        maxActiveJobs = 0;
+        curActiveJobs = 0;
+        avgActiveJobs = 0;
+        maxWaitingJobs = 0;
+        curWaitingJobs = 0;
+        avgWaitingJobs = 0;
+        maxRejectedJobs = 0;
+        curRejectedJobs = 0;
+        avgRejectedJobs = 0;
+        maxCancelledJobs = 0;
+        curCancelledJobs = 0;
+        avgCancelledJobs = 0;
+        totalRejectedJobs = 0;
+        totalCancelledJobs = 0;
+        totalExecutedJobs = 0;
+        totalJobsExecTime = 0;
+        maxJobWaitTime = 0;
+        avgJobWaitTime = 0;
+        maxJobExecTime = 0;
+        curJobExecTime = 0;
+        avgJobExecTime = 0;
+        totalExecTasks = 0;
+        totalIdleTime = 0;
+        curIdleTime = 0;
+        totalCpus = 0;
+        curCpuLoad = 0;
+        avgCpuLoad = 0;
+        curGcCpuLoad = 0;
+        heapInit = 0;
+        heapUsed = 0;
+        heapCommitted = 0;
+        heapMax = 0;
+        nonHeapInit = 0;
+        nonHeapUsed = 0;
+        nonHeapCommitted = 0;
+        nonHeapMax = 0;
+        nonHeapTotal = 0;
+        upTime = 0;
+        startTime = 0;
+        nodeStartTime = 0;
+        threadCnt = 0;
+        peakThreadCnt = 0;
+        startedThreadCnt = 0;
+        daemonThreadCnt = 0;
+        lastDataVer = 0;
+        sentMsgsCnt = 0;
+        sentBytesCnt = 0;
+        rcvdMsgsCnt = 0;
+        rcvdBytesCnt = 0;
+        outMesQueueSize = 0;
+        heapTotal = 0;
+        totalNodes = nodes.size();
+        curPmeDuration = 0;
+
+        for (ClusterNode node : nodes) {
+            ClusterMetrics m = node.metrics();
+
+            lastUpdateTime = max(lastUpdateTime, node.metrics().getLastUpdateTime());
+
+            curActiveJobs += m.getCurrentActiveJobs();
+            maxActiveJobs = max(maxActiveJobs, m.getCurrentActiveJobs());
+            avgActiveJobs += m.getCurrentActiveJobs();
+            totalExecutedJobs += m.getTotalExecutedJobs();
+            totalJobsExecTime += m.getTotalJobsExecutionTime();
+
+            totalExecTasks += m.getTotalExecutedTasks();
+
+            totalCancelledJobs += m.getTotalCancelledJobs();
+            curCancelledJobs += m.getCurrentCancelledJobs();
+            maxCancelledJobs = max(maxCancelledJobs, m.getCurrentCancelledJobs());
+            avgCancelledJobs += m.getCurrentCancelledJobs();
+
+            totalRejectedJobs += m.getTotalRejectedJobs();
+            curRejectedJobs += m.getCurrentRejectedJobs();
+            maxRejectedJobs = max(maxRejectedJobs, m.getCurrentRejectedJobs());
+            avgRejectedJobs += m.getCurrentRejectedJobs();
+
+            curWaitingJobs += m.getCurrentWaitingJobs();
+            maxWaitingJobs = max(maxWaitingJobs, m.getCurrentWaitingJobs());
+            avgWaitingJobs += m.getCurrentWaitingJobs();
+
+            maxJobExecTime = max(maxJobExecTime, m.getMaximumJobExecuteTime());
+            avgJobExecTime += m.getAverageJobExecuteTime();
+            curJobExecTime += m.getCurrentJobExecuteTime();
+
+            curJobWaitTime = min(curJobWaitTime, m.getCurrentJobWaitTime());
+            maxJobWaitTime = max(maxJobWaitTime, m.getCurrentJobWaitTime());
+            avgJobWaitTime += m.getAverageJobWaitTime();
+
+            daemonThreadCnt += m.getCurrentDaemonThreadCount();
+
+            peakThreadCnt = max(peakThreadCnt, m.getCurrentThreadCount());
+            threadCnt += m.getCurrentThreadCount();
+            startedThreadCnt += m.getTotalStartedThreadCount();
+
+            curIdleTime += m.getCurrentIdleTime();
+            totalIdleTime += m.getTotalIdleTime();
+
+            heapCommitted += m.getHeapMemoryCommitted();
+
+            heapUsed += m.getHeapMemoryUsed();
+
+            heapMax = max(heapMax, m.getHeapMemoryMaximum());
+
+            heapTotal += m.getHeapMemoryTotal();
+
+            heapInit += m.getHeapMemoryInitialized();
+
+            nonHeapCommitted += m.getNonHeapMemoryCommitted();
+
+            nonHeapUsed += m.getNonHeapMemoryUsed();
+
+            nonHeapMax = max(nonHeapMax, m.getNonHeapMemoryMaximum());
+
+            nonHeapTotal += m.getNonHeapMemoryTotal();
+
+            nonHeapInit += m.getNonHeapMemoryInitialized();
+
+            upTime = max(upTime, m.getUpTime());
+
+            lastDataVer = max(lastDataVer, m.getLastDataVersion());
+
+            sentMsgsCnt += m.getSentMessagesCount();
+            sentBytesCnt += m.getSentBytesCount();
+            rcvdMsgsCnt += m.getReceivedMessagesCount();
+            rcvdBytesCnt += m.getReceivedBytesCount();
+            outMesQueueSize += m.getOutboundMessagesQueueSize();
+
+            avgCpuLoad += m.getCurrentCpuLoad();
+
+            curPmeDuration = max(curPmeDuration, m.getCurrentPmeDuration());
+        }
+
+        curJobExecTime /= size;
+
+        avgActiveJobs /= size;
+        avgCancelledJobs /= size;
+        avgRejectedJobs /= size;
+        avgWaitingJobs /= size;
+        avgJobExecTime /= size;
+        avgJobWaitTime /= size;
+        avgCpuLoad /= size;
+
+        if (!F.isEmpty(nodes)) {
+            ClusterMetrics oldestNodeMetrics = oldest(nodes).metrics();
+
+            nodeStartTime = oldestNodeMetrics.getNodeStartTime();
+            startTime = oldestNodeMetrics.getStartTime();
+        }
 
-        this.m = m;
+        Map<String, Collection<ClusterNode>> neighborhood = U.neighborhood(nodes);
+
+        curGcCpuLoad = currentGcCpuLoad(neighborhood);
+        curCpuLoad = currentCpuLoad(neighborhood);
+        totalCpus = cpuCnt(neighborhood);
     }
 
-    /**
-     * Create metrics for given cluster group.
-     *
-     * @param p Projection to get metrics for.
-     */
-    public ClusterMetricsSnapshot(ClusterGroup p) {
-        assert p != null;
+    /** */
+    public ClusterMetricsSnapshot(ClusterMetrics metrics) {
+        maxActiveJobs = metrics.getMaximumActiveJobs();
+        curActiveJobs = metrics.getCurrentActiveJobs();
+        avgActiveJobs = metrics.getAverageActiveJobs();
+
+        maxWaitingJobs = metrics.getMaximumWaitingJobs();
+        curWaitingJobs = metrics.getCurrentWaitingJobs();
+        avgWaitingJobs = metrics.getAverageWaitingJobs();
+
+        maxRejectedJobs = metrics.getMaximumRejectedJobs();
+        curRejectedJobs = metrics.getCurrentRejectedJobs();
+        avgRejectedJobs = metrics.getAverageRejectedJobs();
+
+        maxCancelledJobs = metrics.getMaximumCancelledJobs();
+        curCancelledJobs = metrics.getCurrentCancelledJobs();
+        avgCancelledJobs = metrics.getAverageCancelledJobs();
+
+        totalRejectedJobs = metrics.getTotalRejectedJobs();
+        totalCancelledJobs = metrics.getTotalCancelledJobs();
+        totalExecutedJobs = metrics.getTotalExecutedJobs();
+
+        maxJobWaitTime = metrics.getMaximumJobWaitTime();
+        curJobWaitTime = metrics.getCurrentJobWaitTime();
+        avgJobWaitTime = metrics.getAverageJobWaitTime();
+
+        maxJobExecTime = metrics.getMaximumJobExecuteTime();
+        curJobExecTime = metrics.getCurrentJobExecuteTime();
+        avgJobExecTime = metrics.getAverageJobExecuteTime();
+
+        totalJobsExecTime = metrics.getTotalJobsExecutionTime();
+        totalExecTasks = metrics.getTotalExecutedTasks();
+
+        curIdleTime = metrics.getCurrentIdleTime();
+        totalIdleTime = metrics.getTotalIdleTime();
+
+        totalCpus = metrics.getTotalCpus();
+        curCpuLoad = metrics.getCurrentCpuLoad();
+        avgCpuLoad = metrics.getAverageCpuLoad();
+        curGcCpuLoad = metrics.getCurrentGcCpuLoad();
+
+        heapInit = metrics.getHeapMemoryInitialized();
+        heapUsed = metrics.getHeapMemoryUsed();
+        heapCommitted = metrics.getHeapMemoryCommitted();
+        heapMax = metrics.getHeapMemoryMaximum();
+        heapTotal = metrics.getHeapMemoryTotal();
 
-        m = new NodeMetricsMessage(p.nodes());
+        nonHeapInit = metrics.getNonHeapMemoryInitialized();
+        nonHeapUsed = metrics.getNonHeapMemoryUsed();
+        nonHeapCommitted = metrics.getNonHeapMemoryCommitted();
+        nonHeapMax = metrics.getNonHeapMemoryMaximum();
+        nonHeapTotal = metrics.getNonHeapMemoryTotal();
+
+        startTime = metrics.getStartTime();
+        nodeStartTime = metrics.getNodeStartTime();
+        upTime = metrics.getUpTime();
+
+        lastDataVer = metrics.getLastDataVersion();
+
+        curPmeDuration = metrics.getCurrentPmeDuration();
+
+        totalNodes = metrics.getTotalNodes();
+
+        threadCnt = metrics.getCurrentThreadCount();
+        peakThreadCnt = metrics.getMaximumThreadCount();
+        startedThreadCnt = metrics.getTotalStartedThreadCount();
+        daemonThreadCnt = metrics.getCurrentDaemonThreadCount();
+
+        sentMsgsCnt = metrics.getSentMessagesCount();
+        rcvdMsgsCnt = metrics.getReceivedMessagesCount();
+        outMesQueueSize = metrics.getOutboundMessagesQueueSize();
+
+        sentBytesCnt = metrics.getSentBytesCount();
+        rcvdBytesCnt = metrics.getReceivedBytesCount();
+
+        lastUpdateTime = metrics.getLastUpdateTime();
+    }
+
+    /** */
+    public static ClusterMetricsSnapshot of(ClusterMetrics metrics) {
+        return metrics instanceof ClusterMetricsSnapshot ? (ClusterMetricsSnapshot)metrics : new ClusterMetricsSnapshot(metrics);
     }
 
     /** {@inheritDoc} */
     @Override public long getHeapMemoryTotal() {
-        return m.heapMemoryTotal();
+        return heapTotal;
+    }
+
+    /**
+     * Sets total heap size.
+     *
+     * @param heapTotal Total heap.
+     */
+    public void heapMemoryTotal(long heapTotal) {
+        this.heapTotal = heapTotal;
+    }
+
+    /**
+     * Sets non-heap total heap size.
+     *
+     * @param nonHeapTotal Total heap.
+     */
+    public void nonHeapMemoryTotal(long nonHeapTotal) {
+        this.nonHeapTotal = nonHeapTotal;
     }
 
     /** {@inheritDoc} */
     @Override public long getLastUpdateTime() {
-        return m.lastUpdateTime();
+        return lastUpdateTime;
+    }
+
+    /**
+     * Sets last update time.
+     *
+     * @param lastUpdateTime Last update time.
+     */
+    public void lastUpdateTime(long lastUpdateTime) {
+        this.lastUpdateTime = lastUpdateTime;
     }
 
     /** {@inheritDoc} */
     @Override public int getMaximumActiveJobs() {
-        return m.maximumActiveJobs();
+        return maxActiveJobs;
+    }
+
+    /**
+     * Sets max active jobs.
+     *
+     * @param maxActiveJobs Max active jobs.
+     */
+    public void maximumActiveJobs(int maxActiveJobs) {
+        this.maxActiveJobs = maxActiveJobs;
     }
 
     /** {@inheritDoc} */
     @Override public int getCurrentActiveJobs() {
-        return m.currentActiveJobs();
+        return curActiveJobs;
+    }
+
+    /**
+     * Sets current active jobs.
+     *
+     * @param curActiveJobs Current active jobs.
+     */
+    public void currentActiveJobs(int curActiveJobs) {
+        this.curActiveJobs = curActiveJobs;
     }
 
     /** {@inheritDoc} */
     @Override public float getAverageActiveJobs() {
-        return m.averageActiveJobs();
+        return curActiveJobs;

Review Comment:
   method is about the average, but it reads another parameter.



##########
modules/core/src/main/java/org/apache/ignite/internal/ClusterMetricsSnapshot.java:
##########
@@ -96,324 +96,1275 @@ public class ClusterMetricsSnapshot implements ClusterMetrics {
         8/*current PME time*/;
 
     /** */
-    private NodeMetricsMessage m;
+    @Order(0)
+    public int maxActiveJobs = -1;
 
-    /**
-     * Creates empty snapshot.
-     */
+    /** */
+    @Order(1)
+    public int curActiveJobs = -1;
+
+    /** */
+    @Order(2)
+    public float avgActiveJobs = -1;
+
+    /** */
+    @Order(3)
+    public int maxWaitingJobs = -1;
+
+    /** */
+    @Order(4)
+    public int curWaitingJobs = -1;
+
+    /** */
+    @Order(5)
+    public float avgWaitingJobs = -1;
+
+    /** */
+    @Order(6)
+    public int maxRejectedJobs = -1;
+
+    /** */
+    @Order(7)
+    public int curRejectedJobs = -1;
+
+    /** */
+    @Order(8)
+    public float avgRejectedJobs = -1;
+
+    /** */
+    @Order(9)
+    public int maxCancelledJobs = -1;
+
+    /** */
+    @Order(10)
+    public int curCancelledJobs = -1;
+
+    /** */
+    @Order(11)
+    public float avgCancelledJobs = -1;
+
+    /** */
+    @Order(12)
+    public int totalRejectedJobs = -1;
+
+    /** */
+    @Order(13)
+    public int totalCancelledJobs = -1;
+
+    /** */
+    @Order(14)
+    public int totalExecutedJobs = -1;
+
+    /** */
+    @Order(15)
+    public long maxJobWaitTime = -1;
+
+    /** */
+    @Order(16)
+    public long curJobWaitTime = Long.MAX_VALUE;
+
+    /** */
+    @Order(17)
+    public double avgJobWaitTime = -1;
+
+    /** */
+    @Order(18)
+    public long maxJobExecTime = -1;
+
+    /** */
+    @Order(19)
+    public long curJobExecTime = -1;
+
+    /** */
+    @Order(20)
+    public double avgJobExecTime = -1;
+
+    /** */
+    @Order(21)
+    public int totalExecTasks = -1;
+
+    /** */
+    @Order(22)
+    public long totalIdleTime = -1;
+
+    /** */
+    @Order(23)
+    public long curIdleTime = -1;
+
+    /** */
+    @Order(24)
+    public int totalCpus = -1;
+
+    /** */
+    @Order(25)
+    public double curCpuLoad = -1;
+
+    /** */
+    @Order(26)
+    public double avgCpuLoad = -1;
+
+    /** */
+    @Order(27)
+    public double curGcCpuLoad = -1;
+
+    /** */
+    @Order(28)
+    public long heapInit = -1;
+
+    /** */
+    @Order(29)
+    public long heapUsed = -1;
+
+    /** */
+    @Order(30)
+    public long heapCommitted = -1;
+
+    /** */
+    @Order(31)
+    public long heapMax = -1;
+
+    /** */
+    @Order(32)
+    public long heapTotal = -1;
+
+    /** */
+    @Order(33)
+    public long nonHeapInit = -1;
+
+    /** */
+    @Order(34)
+    public long nonHeapUsed = -1;
+
+    /** */
+    @Order(35)
+    public long nonHeapCommitted = -1;
+
+    /** */
+    @Order(36)
+    public long nonHeapMax = -1;
+
+    /** */
+    @Order(37)
+    public long nonHeapTotal = -1;
+
+    /** */
+    @Order(38)
+    public long upTime = -1;
+
+    /** */
+    @Order(39)
+    public long startTime = -1;
+
+    /** */
+    @Order(40)
+    public long nodeStartTime = -1;
+
+    /** */
+    @Order(41)
+    public int threadCnt = -1;
+
+    /** */
+    @Order(42)
+    public int peakThreadCnt = -1;
+
+    /** */
+    @Order(43)
+    public long startedThreadCnt = -1;
+
+    /** */
+    @Order(44)
+    public int daemonThreadCnt = -1;
+
+    /** */
+    @Order(45)
+    public long lastDataVer = -1;
+
+    /** */
+    @Order(46)
+    public int sentMsgsCnt = -1;
+
+    /** */
+    @Order(47)
+    public long sentBytesCnt = -1;
+
+    /** */
+    @Order(48)
+    public int rcvdMsgsCnt = -1;
+
+    /** */
+    @Order(49)
+    public long rcvdBytesCnt = -1;
+
+    /** */
+    @Order(50)
+    public int outMesQueueSize = -1;
+
+    /** */
+    @Order(51)
+    public int totalNodes = -1;
+
+    /** */
+    @Order(52)
+    public long totalJobsExecTime = -1;
+
+    /** */
+    @Order(53)
+    public long curPmeDuration = -1;
+
+    /** */
+    public long lastUpdateTime = -1;
+
+    /** Empty constructor for serialization purposes. */
     public ClusterMetricsSnapshot() {
-        m = new NodeMetricsMessage();
+        // Like in deserialize().
+        lastUpdateTime = System.currentTimeMillis();

Review Comment:
   U.currentTimeMillis()



##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java:
##########
@@ -108,16 +107,12 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements Ignite
 
     /** Node metrics. */
     @GridToStringExclude
-    volatile ClusterMetrics metrics;
-
-    /** Node metrics message. */
-    @GridToStringExclude
     @Order(6)
-    volatile NodeMetricsMessage metricsMsg;
+    volatile ClusterMetricsSnapshot clusterMetricsSnapshot;
 
     /** Node cache metrics. */
     @GridToStringExclude
-    private volatile Map<Integer, CacheMetrics> cacheMetrics;
+    private volatile Map<Integer, CacheMetrics> cacheMetricsSnapshot;

Review Comment:
   Seems to be not a snapshot?



-- 
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-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28961 TcpDiscoveryNode should not implement SelfMarshallingMessage [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13450:
URL: https://github.com/apache/ignite/pull/13450#issuecomment-5225937043

   <!-- ignite-rolling-upgrade-check -->
   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeFullMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/NodeMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientMetricsUpdateMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientNodesMetricsMessage.java`
   - `modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryMetricsUpdateMessage.java`
   


-- 
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-unsubscribe@ignite.apache.org

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