brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [3/5] git commit: Fixed sensor ClassCastExceptions
Date Wed, 18 Jun 2014 16:45:15 GMT
Fixed sensor ClassCastExceptions


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

Branch: refs/heads/master
Commit: b441e1dcaa509a760fafd8bfd6e4df90ef92060e
Parents: f5ccb4b
Author: Martin Harris <github@nakomis.com>
Authored: Wed Jun 18 13:52:16 2014 +0100
Committer: Martin Harris <github@nakomis.com>
Committed: Wed Jun 18 13:52:16 2014 +0100

----------------------------------------------------------------------
 .../nosql/couchbase/CouchbaseCluster.java       | 31 ++++++++++----------
 .../nosql/couchbase/CouchbaseClusterImpl.java   | 10 +++----
 .../entity/nosql/couchbase/CouchbaseNode.java   |  4 +--
 3 files changed, 23 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b441e1dc/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseCluster.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseCluster.java
b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseCluster.java
index 1e49d43..2534940 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseCluster.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseCluster.java
@@ -47,28 +47,29 @@ public interface CouchbaseCluster extends DynamicCluster {
         "couchbase.cluster.node.addresses", "List of host:port of all active nodes in the
cluster (http admin port, and public hostname/IP)");
     
     // Interesting stats
-    AttributeSensor<Long> OPS_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.ops",

+    AttributeSensor<Double> OPS_PER_NODE = Sensors.newDoubleSensor("couchbase.stats.cluster.per.node.ops",

             "Average across cluster for pools/nodes/<current node>/interestingStats/ops");
+    AttributeSensor<Double> EP_BG_FETCHED_PER_NODE = Sensors.newDoubleSensor("couchbase.stats.cluster.per.node.ep.bg.fetched",

+            "Average across cluster for pools/nodes/<current node>/interestingStats/ep_bg_fetched");
+    AttributeSensor<Double> CURR_ITEMS_PER_NODE = Sensors.newDoubleSensor("couchbase.stats.cluster.per.node.curr.items",

+            "Average across cluster for pools/nodes/<current node>/interestingStats/curr_items");
+    AttributeSensor<Double> VB_REPLICA_CURR_ITEMS_PER_NODE = Sensors.newDoubleSensor("couchbase.stats.cluster.per.node.vb.replica.curr.items",

+            "Average across cluster for pools/nodes/<current node>/interestingStats/vb_replica_curr_items");
+    AttributeSensor<Double> GET_HITS_PER_NODE = Sensors.newDoubleSensor("couchbase.stats.cluster.per.node.get.hits",

+            "Average across cluster for pools/nodes/<current node>/interestingStats/get_hits");
+    AttributeSensor<Double> CMD_GET_PER_NODE = Sensors.newDoubleSensor("couchbase.stats.cluster.per.node.cmd.get",

+            "Average across cluster for pools/nodes/<current node>/interestingStats/cmd_get");
+    AttributeSensor<Double> CURR_ITEMS_TOT_PER_NODE = Sensors.newDoubleSensor("couchbase.stats.cluster.per.node.curr.items.tot",

+            "Average across cluster for pools/nodes/<current node>/interestingStats/curr_items_tot");
+    // Although these are Double (after aggregation), they need to be coerced to Long for
ByteSizeStrings rendering
     AttributeSensor<Long> COUCH_DOCS_DATA_SIZE_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.couch.docs.data.size",

             "Average across cluster for pools/nodes/<current node>/interestingStats/couch_docs_data_size");
-    AttributeSensor<Long> COUCH_DOCS_ACTUAL_DISK_SIZE_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.couch.docs.actual.disk.size",

-            "Average across cluster for pools/nodes/<current node>/interestingStats/couch_docs_actual_disk_size");
-    AttributeSensor<Long> EP_BG_FETCHED_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.ep.bg.fetched",

-            "Average across cluster for pools/nodes/<current node>/interestingStats/ep_bg_fetched");
     AttributeSensor<Long> MEM_USED_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.mem.used",

             "Average across cluster for pools/nodes/<current node>/interestingStats/mem_used");
     AttributeSensor<Long> COUCH_VIEWS_ACTUAL_DISK_SIZE_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.couch.views.actual.disk.size",

             "Average across cluster for pools/nodes/<current node>/interestingStats/couch_views_actual_disk_size");
-    AttributeSensor<Long> CURR_ITEMS_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.curr.items",

-            "Average across cluster for pools/nodes/<current node>/interestingStats/curr_items");
-    AttributeSensor<Long> VB_REPLICA_CURR_ITEMS_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.vb.replica.curr.items",

-            "Average across cluster for pools/nodes/<current node>/interestingStats/vb_replica_curr_items");
+    AttributeSensor<Long> COUCH_DOCS_ACTUAL_DISK_SIZE_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.couch.docs.actual.disk.size",

+            "Average across cluster for pools/nodes/<current node>/interestingStats/couch_docs_actual_disk_size");
     AttributeSensor<Long> COUCH_VIEWS_DATA_SIZE_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.couch.views.data.size",

             "Average across cluster for pools/nodes/<current node>/interestingStats/couch_views_data_size");
-    AttributeSensor<Long> GET_HITS_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.get.hits",

-            "Average across cluster for pools/nodes/<current node>/interestingStats/get_hits");
-    AttributeSensor<Long> CMD_GET_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.cmd.get",

-            "Average across cluster for pools/nodes/<current node>/interestingStats/cmd_get");
-    AttributeSensor<Long> CURR_ITEMS_TOT_PER_NODE = Sensors.newLongSensor("couchbase.stats.cluster.per.node.curr.items.tot",

-            "Average across cluster for pools/nodes/<current node>/interestingStats/curr_items_tot");
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b441e1dc/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
index d277a03..809aa30 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
@@ -62,8 +62,8 @@ public class CouchbaseClusterImpl extends DynamicClusterImpl implements
Couchbas
             }).build()
         );
         
-        Map<? extends AttributeSensor<Long>, ? extends AttributeSensor<Long>>
enricherSetup = 
-            ImmutableMap.<AttributeSensor<Long>, AttributeSensor<Long>>builder()
+        Map<? extends AttributeSensor<? extends Number>, ? extends AttributeSensor<?
extends Number>> enricherSetup = 
+            ImmutableMap.<AttributeSensor<? extends Number>, AttributeSensor<?
extends Number>>builder()
                 .put(CouchbaseNode.OPS, CouchbaseCluster.OPS_PER_NODE)
                 .put(CouchbaseNode.COUCH_DOCS_DATA_SIZE, CouchbaseCluster.COUCH_DOCS_DATA_SIZE_PER_NODE)
                 .put(CouchbaseNode.COUCH_DOCS_ACTUAL_DISK_SIZE, CouchbaseCluster.COUCH_DOCS_ACTUAL_DISK_SIZE_PER_NODE)
@@ -78,14 +78,14 @@ public class CouchbaseClusterImpl extends DynamicClusterImpl implements
Couchbas
                 .put(CouchbaseNode.CURR_ITEMS_TOT, CouchbaseCluster.CURR_ITEMS_TOT_PER_NODE)
             .build();
         
-        for (AttributeSensor<Long> nodeSensor : enricherSetup.keySet()) {
+        for (AttributeSensor<? extends Number> nodeSensor : enricherSetup.keySet())
{
             addSummingMemberEnricher(nodeSensor);
             addAveragingMemberEnricher(nodeSensor, enricherSetup.get(nodeSensor));
         }
         
     }
     
-    private void addAveragingMemberEnricher(AttributeSensor<Long> fromSensor, AttributeSensor<Long>
toSensor) {
+    private void addAveragingMemberEnricher(AttributeSensor<? extends Number> fromSensor,
AttributeSensor<? extends Number> toSensor) {
         addEnricher(Enrichers.builder()
             .aggregating(fromSensor)
             .publishing(toSensor)
@@ -95,7 +95,7 @@ public class CouchbaseClusterImpl extends DynamicClusterImpl implements
Couchbas
         );
     }
 
-    private void addSummingMemberEnricher(AttributeSensor<Long> source) {
+    private void addSummingMemberEnricher(AttributeSensor<? extends Number> source)
{
         addEnricher(Enrichers.builder()
             .aggregating(source)
             .publishing(source)

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b441e1dc/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNode.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNode.java
b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNode.java
index 26cf369..909aad3 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNode.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNode.java
@@ -56,7 +56,7 @@ public interface CouchbaseNode extends SoftwareProcess {
     public static final AttributeSensor<String> COUCHBASE_WEB_ADMIN_URL = WebAppServiceConstants.ROOT_URL;
// By using this specific sensor, the value will be shown in the summary tab
     
     // Interesting stats
-    AttributeSensor<Long> OPS = Sensors.newLongSensor("couchbase.stats.ops", 
+    AttributeSensor<Double> OPS = Sensors.newDoubleSensor("couchbase.stats.ops", 
             "Retrieved from pools/nodes/<current node>/interestingStats/ops");
     AttributeSensor<Long> COUCH_DOCS_DATA_SIZE = Sensors.newLongSensor("couchbase.stats.couch.docs.data.size",

             "Retrieved from pools/nodes/<current node>/interestingStats/couch_docs_data_size");
@@ -76,7 +76,7 @@ public interface CouchbaseNode extends SoftwareProcess {
             "Retrieved from pools/nodes/<current node>/interestingStats/couch_views_data_size");
     AttributeSensor<Long> GET_HITS = Sensors.newLongSensor("couchbase.stats.get.hits",

             "Retrieved from pools/nodes/<current node>/interestingStats/get_hits");
-    AttributeSensor<Long> CMD_GET = Sensors.newLongSensor("couchbase.stats.cmd.get",

+    AttributeSensor<Double> CMD_GET = Sensors.newDoubleSensor("couchbase.stats.cmd.get",

             "Retrieved from pools/nodes/<current node>/interestingStats/cmd_get");
     AttributeSensor<Long> CURR_ITEMS_TOT = Sensors.newLongSensor("couchbase.stats.curr.items.tot",

             "Retrieved from pools/nodes/<current node>/interestingStats/curr_items_tot");


Mime
View raw message