ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [07/30] incubator-ignite git commit: IGNITE-236 Fixed init value.
Date Fri, 13 Feb 2015 12:59:27 GMT
IGNITE-236 Fixed init value.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e6beac46
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e6beac46
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e6beac46

Branch: refs/heads/ignite-189
Commit: e6beac46b50924f8a25f9ea77c20492ae846b8dc
Parents: 322408f
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Fri Feb 13 09:54:43 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Fri Feb 13 09:54:43 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/ClusterMetricsSnapshot.java | 49 ++++++++++++++++++++
 .../internal/ClusterNodeMetricsSelfTest.java    | 16 +++++++
 2 files changed, 65 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e6beac46/modules/core/src/main/java/org/apache/ignite/internal/ClusterMetricsSnapshot.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/ClusterMetricsSnapshot.java
b/modules/core/src/main/java/org/apache/ignite/internal/ClusterMetricsSnapshot.java
index 1bfe6a2..7129453 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/ClusterMetricsSnapshot.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/ClusterMetricsSnapshot.java
@@ -255,6 +255,55 @@ public class ClusterMetricsSnapshot implements ClusterMetrics {
         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;
+        maxJobWaitTime = 0;
+        avgJobWaitTime = 0;
+        maxJobExecTime = 0;
+        curJobExecTime = 0;
+        avgJobExecTime = 0;
+        totalExecTasks = 0;
+        totalIdleTime = 0;
+        curIdleTime = 0;
+        availProcs = 0;
+        load = 0;
+        avgLoad = 0;
+        gcLoad = 0;
+        heapInit = 0;
+        heapUsed = 0;
+        heapCommitted = 0;
+        heapMax = 0;
+        nonHeapInit = 0;
+        nonHeapUsed = 0;
+        nonHeapCommitted = 0;
+        nonHeapMax = 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;
 
         for (ClusterNode node : nodes) {
             ClusterMetrics m = node.metrics();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e6beac46/modules/core/src/test/java/org/apache/ignite/internal/ClusterNodeMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/ClusterNodeMetricsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/ClusterNodeMetricsSelfTest.java
index 5ca4f87..31543e6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/ClusterNodeMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/ClusterNodeMetricsSelfTest.java
@@ -228,6 +228,22 @@ public class ClusterNodeMetricsSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testClusterNodeMetrics() throws Exception {
+        Ignite ignite0 = grid();
+        Ignite ignite1 = startGrid(1);
+
+        ClusterMetrics metrics0 = ignite0.cluster().localNode().metrics();
+        ClusterMetrics metrics1 = ignite1.cluster().localNode().metrics();
+
+        ClusterMetrics nodesMetrics =
+            ignite0.cluster().forNode(ignite0.cluster().localNode(), ignite1.cluster().localNode()).metrics();
+
+        assertEquals(metrics0.getTotalCpus() + metrics1.getTotalCpus(), nodesMetrics.getTotalCpus());
+    }
+
+    /**
      * Test message.
      */
     @SuppressWarnings("UnusedDeclaration")


Mime
View raw message