ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [25/50] [abbrv] incubator-ignite git commit: IGNITE-49 Fixed Visor metrics
Date Wed, 28 Jan 2015 03:09:13 GMT
IGNITE-49 Fixed Visor metrics


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

Branch: refs/heads/ignite-32
Commit: 10356b6bc5fdc7e96da264884a1b591c1be39a5e
Parents: abe5d17
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Tue Jan 27 16:11:56 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Tue Jan 27 16:11:56 2015 +0300

----------------------------------------------------------------------
 .../ignite/visor/commands/alert/VisorAlertCommand.scala  |  7 ++++---
 .../ignite/visor/commands/top/VisorTopologyCommand.scala | 11 +++++------
 .../src/main/scala/org/apache/ignite/visor/visor.scala   |  6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/10356b6b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
index 1015a04..73c6e83 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
@@ -17,12 +17,13 @@
 
 package org.apache.ignite.visor.commands.alert
 
+import org.apache.ignite.internal.util.{GridUtils => U}
 import org.apache.ignite.internal.util.lang.{GridFunc => F}
 
 import org.apache.ignite._
 import org.apache.ignite.cluster.ClusterNode
 import org.apache.ignite.events.IgniteEventType._
-import org.apache.ignite.events.{IgniteDiscoveryEvent, IgniteEvent, IgniteEventType}
+import org.apache.ignite.events.{IgniteDiscoveryEvent, IgniteEvent}
 import org.apache.ignite.lang.IgnitePredicate
 
 import java.util.UUID
@@ -276,8 +277,8 @@ class VisorAlertCommand {
                         n match {
                             // Grid-wide metrics (not node specific).
                             case "cc" if v != null => gf = makeGridFilter(v, gf, grid.metrics().getTotalCpus)
-                            case "nc" if v != null => gf = makeGridFilter(v, gf, grid.metrics().getTotalNodes)
-                            case "hc" if v != null => gf = makeGridFilter(v, gf, grid.metrics().getTotalHosts)
+                            case "nc" if v != null => gf = makeGridFilter(v, gf, grid.nodes().size)
+                            case "hc" if v != null => gf = makeGridFilter(v, gf, U.neighborhood(grid.nodes()).size)
                             case "cl" if v != null => gf = makeGridFilter(v, gf,
                                 () => (grid.metrics().getAverageCpuLoad * 100).toLong)
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/10356b6b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala
index 6049e13..7648ea1 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala
@@ -19,7 +19,6 @@ package org.apache.ignite.visor.commands.top
 
 import org.apache.ignite.internal.GridNodeAttributes
 import org.apache.ignite.internal.util.GridUtils
-import org.apache.ignite.internal.util.typedef.internal.U
 import GridNodeAttributes._
 import org.apache.ignite.internal.util.typedef._
 
@@ -332,17 +331,17 @@ class VisorTopologyCommand {
 
         val m = grid.forNodes(nodes).metrics()
 
-        val freeHeap = (m.getAverageHeapMemoryMaximum - m.getAverageHeapMemoryUsed) * 100
/
-            m.getAverageHeapMemoryMaximum
+        val freeHeap = (m.getHeapMemoryMaximum - m.getHeapMemoryUsed) * 100 /
+          m.getHeapMemoryMaximum
 
         val sumT = VisorTextTable()
 
-        sumT += ("Total hosts", m.getTotalHosts)
-        sumT += ("Total nodes", m.getTotalNodes)
+        sumT += ("Total hosts", GridUtils.neighborhood(grid.nodes()).size)
+        sumT += ("Total nodes", grid.nodes().size)
         sumT += ("Total CPUs", m.getTotalCpus)
         sumT += ("Avg. CPU load", safePercent(m.getAverageCpuLoad * 100))
         sumT += ("Avg. free heap", formatDouble(freeHeap) + " %")
-        sumT += ("Avg. Up time", X.timeSpan2HMS(m.getAverageUpTime.toLong))
+        sumT += ("Avg. Up time", X.timeSpan2HMS(m.getUpTime.toLong))
         sumT += ("Snapshot time", formatDateTime(System.currentTimeMillis))
 
         println("Summary:")

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/10356b6b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
index b740cb4..d56ab3b 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
@@ -2522,10 +2522,10 @@ object visor extends VisorTag {
         }
 
         logText("H/N/C" + pipe +
-            m.getTotalHosts.toString.padTo(4, ' ') + pipe +
-            m.getTotalNodes.toString.padTo(4, ' ') + pipe +
+            GridUtils.neighborhood(grid.nodes()).size.toString.padTo(4, ' ') + pipe +
+            grid.nodes().size().toString.padTo(4, ' ') + pipe +
             m.getTotalCpus.toString.padTo(4, ' ') + pipe +
-            bar(m.getAverageCpuLoad, m.getAverageHeapMemoryUsed / m.getAverageHeapMemoryMaximum)
+ pipe
+            bar(m.getAverageCpuLoad, m.getHeapMemoryUsed / m.getHeapMemoryMaximum) + pipe
         )
     }
 


Mime
View raw message