ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-2930 Fixed Visor cmd alerts execution.
Date Wed, 11 May 2016 02:51:05 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.6 aef460f0a -> 949f0a47b


IGNITE-2930 Fixed Visor cmd alerts execution.


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

Branch: refs/heads/ignite-1.6
Commit: 949f0a47bc20b094f7cb87765db7d607aced9577
Parents: aef460f
Author: vsisko <vsisko@gridgain.com>
Authored: Wed May 11 09:51:42 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Wed May 11 09:51:42 2016 +0700

----------------------------------------------------------------------
 .../commands/alert/VisorAlertCommand.scala      | 43 +++++++++-----------
 1 file changed, 20 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/949f0a47/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 9e2aec0..85851a8 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
@@ -194,7 +194,7 @@ class VisorAlertCommand extends VisorConsoleCommand {
      * @param f Node filter
      * @param value Value generator.
      */
-    private def makeNodeFilter(exprStr: String, f: ClusterNode => Boolean, value: ClusterNode
=> Long):
+    private def makeNodeFilter(exprStr: String, f: (ClusterNode) => Boolean, value: (ClusterNode)
=> Long):
         ClusterNode => Boolean = {
         assert(exprStr != null)
         assert(f != null)
@@ -247,31 +247,28 @@ class VisorAlertCommand extends VisorConsoleCommand {
                 var freq = DFLT_FREQ
 
                 try {
-                    args foreach (arg => {
-                        val (n, v) = arg
+                    args.foreach(arg => {
+                        val (alertName, v) = arg
 
-                        n match {
+                        alertName match {
                             // Grid-wide metrics (not node specific).
-                            case "cc" if v != null => gf = makeGridFilter(v, gf, ignite.cluster.metrics().getTotalCpus)
-                            case "nc" if v != null => gf = makeGridFilter(v, gf, ignite.cluster.nodes().size)
-                            case "hc" if v != null => gf = makeGridFilter(v, gf,
-                                U.neighborhood(ignite.cluster.nodes()).size)
-                            case "cl" if v != null => gf = makeGridFilter(v, gf,
-                                () => (ignite.cluster.metrics().getAverageCpuLoad * 100).toLong)
+                            case "cc" if v != null => gf = makeGridFilter(v, gf, () =>
ignite.cluster.metrics().getTotalCpus)
+                            case "nc" if v != null => gf = makeGridFilter(v, gf, () =>
ignite.cluster.nodes().size)
+                            case "hc" if v != null => gf = makeGridFilter(v, gf, () =>
U.neighborhood(ignite.cluster.nodes()).size)
+                            case "cl" if v != null => gf = makeGridFilter(v, gf, () =>
(ignite.cluster.metrics().getAverageCpuLoad * 100).toLong)
 
                             // Per-node current metrics.
-                            case "aj" if v != null => nf = makeNodeFilter(v, nf, _.metrics().getCurrentActiveJobs)
-                            case "cj" if v != null => nf = makeNodeFilter(v, nf, _.metrics().getCurrentCancelledJobs)
-                            case "tc" if v != null => nf = makeNodeFilter(v, nf, _.metrics().getCurrentThreadCount)
-                            case "ut" if v != null => nf = makeNodeFilter(v, nf, _.metrics().getUpTime)
-                            case "je" if v != null => nf = makeNodeFilter(v, nf, _.metrics().getCurrentJobExecuteTime)
-                            case "jw" if v != null => nf = makeNodeFilter(v, nf, _.metrics().getCurrentJobWaitTime)
-                            case "wj" if v != null => nf = makeNodeFilter(v, nf, _.metrics().getCurrentWaitingJobs)
-                            case "rj" if v != null => nf = makeNodeFilter(v, nf, _.metrics().getCurrentRejectedJobs)
-                            case "hu" if v != null => nf = makeNodeFilter(v, nf, _.metrics().getHeapMemoryUsed)
-                            case "hm" if v != null => nf = makeNodeFilter(v, nf, _.metrics().getHeapMemoryMaximum)
-                            case "cd" if v != null => nf = makeNodeFilter(v, nf,
-                                (n: ClusterNode) => (n.metrics().getCurrentCpuLoad * 100).toLong)
+                            case "aj" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> n.metrics().getCurrentActiveJobs)
+                            case "cj" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> n.metrics().getCurrentCancelledJobs)
+                            case "tc" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> n.metrics().getCurrentThreadCount)
+                            case "ut" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> n.metrics().getUpTime)
+                            case "je" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> n.metrics().getCurrentJobExecuteTime)
+                            case "jw" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> n.metrics().getCurrentJobWaitTime)
+                            case "wj" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> n.metrics().getCurrentWaitingJobs)
+                            case "rj" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> n.metrics().getCurrentRejectedJobs)
+                            case "hu" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> n.metrics().getHeapMemoryUsed)
+                            case "hm" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> n.metrics().getHeapMemoryMaximum)
+                            case "cd" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode)
=> (n.metrics().getCurrentCpuLoad * 100).toLong)
 
                             // Other tags.
                             case "t" if v != null => freq = v.toLong
@@ -337,7 +334,7 @@ class VisorAlertCommand extends VisorConsoleCommand {
 
                     val node = ignite.cluster.node(discoEvt.eventNode().id())
 
-                    if (node != null)
+                    if (node != null && !node.isDaemon)
                         alerts foreach (t => {
                             val (id, alert) = t
 


Mime
View raw message