You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by gr...@apache.org on 2015/03/24 21:14:38 UTC
[1/4] incubator-brooklyn git commit: Riak Linux - add more sensors
Repository: incubator-brooklyn
Updated Branches:
refs/heads/master 9e7b523bf -> 7fbcf8488
Riak Linux - add more sensors
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/bdffc952
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/bdffc952
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/bdffc952
Branch: refs/heads/master
Commit: bdffc9520a5b9b7c11e5fb6266fa43595c2ea301
Parents: e08d320
Author: Valentin Aitken <bo...@gmail.com>
Authored: Mon Mar 23 20:29:58 2015 +0200
Committer: Valentin Aitken <bo...@gmail.com>
Committed: Mon Mar 23 22:31:44 2015 +0200
----------------------------------------------------------------------
.../brooklyn/entity/nosql/riak/RiakNode.java | 55 +++++++++++++-------
.../entity/nosql/riak/RiakNodeImpl.java | 14 +++--
2 files changed, 48 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/bdffc952/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
index c1f1bf8..12724d1 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
@@ -29,12 +29,10 @@ import brooklyn.entity.basic.MethodEffector;
import brooklyn.entity.basic.SoftwareProcess;
import brooklyn.entity.proxying.ImplementedBy;
import brooklyn.event.AttributeSensor;
-import brooklyn.event.basic.AttributeSensorAndConfigKey;
-import brooklyn.event.basic.PortAttributeSensorAndConfigKey;
-import brooklyn.event.basic.Sensors;
-import brooklyn.event.basic.TemplatedStringAttributeSensorAndConfigKey;
+import brooklyn.event.basic.*;
import brooklyn.util.flags.SetFromFlag;
+import com.google.common.collect.ImmutableList;
import com.google.common.reflect.TypeToken;
@Catalog(name="Riak Node", description="Riak is a distributed NoSQL key-value data store that offers "
@@ -116,24 +114,24 @@ public interface RiakNode extends SoftwareProcess {
PortAttributeSensorAndConfigKey SEARCH_SOLR_PORT = new PortAttributeSensorAndConfigKey("riak.search.solr.port", "Solr port", "8093+");
PortAttributeSensorAndConfigKey SEARCH_SOLR_JMX_PORT = new PortAttributeSensorAndConfigKey("riak.search.solr.jmx_port", "Solr port", "8985+");
- AttributeSensor<Integer> NODE_GETS = Sensors.newIntegerSensor("node.gets");
- AttributeSensor<Integer> NODE_GETS_TOTAL = Sensors.newIntegerSensor("node.gets.total");
- AttributeSensor<Integer> NODE_PUTS = Sensors.newIntegerSensor("node.puts");
- AttributeSensor<Integer> NODE_PUTS_TOTAL = Sensors.newIntegerSensor("node.puts.total");
- AttributeSensor<Integer> VNODE_GETS = Sensors.newIntegerSensor("vnode.gets");
- AttributeSensor<Integer> VNODE_GETS_TOTAL = Sensors.newIntegerSensor("vnode.gets.total");
+ AttributeSensor<Integer> NODE_GETS = Sensors.newIntegerSensor("riak.node.gets");
+ AttributeSensor<Integer> NODE_GETS_TOTAL = Sensors.newIntegerSensor("riak.node.gets.total");
+ AttributeSensor<Integer> NODE_PUTS = Sensors.newIntegerSensor("riak.node.puts");
+ AttributeSensor<Integer> NODE_PUTS_TOTAL = Sensors.newIntegerSensor("riak.node.puts.total");
+ AttributeSensor<Integer> VNODE_GETS = Sensors.newIntegerSensor("riak.vnode.gets");
+ AttributeSensor<Integer> VNODE_GETS_TOTAL = Sensors.newIntegerSensor("riak.vnode.gets.total");
//Sensors for Riak Node Counters (within 1 minute window or lifetime of node.
//http://docs.basho.com/riak/latest/ops/running/stats-and-monitoring/#Statistics-from-Riak
- AttributeSensor<Integer> VNODE_PUTS = Sensors.newIntegerSensor("vnode.puts");
- AttributeSensor<Integer> VNODE_PUTS_TOTAL = Sensors.newIntegerSensor("vnode.puts.total");
- AttributeSensor<Integer> READ_REPAIRS_TOTAL = Sensors.newIntegerSensor("read.repairs.total");
- AttributeSensor<Integer> COORD_REDIRS_TOTAL = Sensors.newIntegerSensor("coord.redirs.total");
+ AttributeSensor<Integer> VNODE_PUTS = Sensors.newIntegerSensor("riak.vnode.puts");
+ AttributeSensor<Integer> VNODE_PUTS_TOTAL = Sensors.newIntegerSensor("riak.vnode.puts.total");
+ AttributeSensor<Integer> READ_REPAIRS_TOTAL = Sensors.newIntegerSensor("riak.read.repairs.total");
+ AttributeSensor<Integer> COORD_REDIRS_TOTAL = Sensors.newIntegerSensor("riak.coord.redirs.total");
//Additional Riak node counters
- AttributeSensor<Integer> MEMORY_PROCESSES_USED = Sensors.newIntegerSensor("memory.processes.used");
- AttributeSensor<Integer> SYS_PROCESS_COUNT = Sensors.newIntegerSensor("sys.process.count");
- AttributeSensor<Integer> PBC_CONNECTS = Sensors.newIntegerSensor("pbc.connects");
- AttributeSensor<Integer> PBC_ACTIVE = Sensors.newIntegerSensor("pbc.active");
+ AttributeSensor<Integer> MEMORY_PROCESSES_USED = Sensors.newIntegerSensor("riak.memory.processes.used");
+ AttributeSensor<Integer> SYS_PROCESS_COUNT = Sensors.newIntegerSensor("riak.sys.process.count");
+ AttributeSensor<Integer> PBC_CONNECTS = Sensors.newIntegerSensor("riak.pbc.connects");
+ AttributeSensor<Integer> PBC_ACTIVE = Sensors.newIntegerSensor("riak.pbc.active");
@SuppressWarnings("serial")
AttributeSensor<List<String>> RING_MEMBERS = Sensors.newSensor(new TypeToken<List<String>>() {},
"ring.members", "all the riak nodes in the ring");
@@ -142,6 +140,27 @@ public interface RiakNode extends SoftwareProcess {
MethodEffector<Void> LEAVE_RIAK_CLUSTER = new MethodEffector<Void>(RiakNode.class, "leaveCluster");
MethodEffector<Void> COMMIT_RIAK_CLUSTER = new MethodEffector<Void>(RiakNode.class, "commitCluster");
+ AttributeSensor<Integer> RIAK_NODE_GET_FSM_TIME_MEAN = Sensors.newIntegerSensor("riak.node_get_fsm_time_mean", "Time between reception of client read request and subsequent response to client");
+ AttributeSensor<Integer> RIAK_NODE_PUT_FSM_TIME_MEAN = Sensors.newIntegerSensor("riak.node_put_fsm_time_mean", "Time between reception of client write request and subsequent response to client");
+ AttributeSensor<Integer> RIAK_OBJECT_COUNTER_MERGE_TIME_MEAN = Sensors.newIntegerSensor("riak.object_counter_merge_time_mean", "Time it takes to perform an Update Counter operation");
+ AttributeSensor<Integer> RIAK_OBJECT_SET_MERGE_TIME_MEAN = Sensors.newIntegerSensor("riak.object_set_merge_time_mean", "Time it takes to perform an Update Set operation");
+ AttributeSensor<Integer> RIAK_OBJECT_MAP_MERGE_TIME_MEAN = Sensors.newIntegerSensor("riak.object_map_merge_time_mean", "Time it takes to perform an Update Map operation");
+ AttributeSensor<Integer> RIAK_SEARCH_QUERY_LATENCY_MEDIAN = Sensors.newIntegerSensor("riak.search_query_latency_median", "Search query latency");
+ AttributeSensor<Integer> RIAK_SEARCH_INDEX_LATENCY_MEDIAN = Sensors.newIntegerSensor("riak.search_index_latency_median", "Time it takes Search to index a new document");
+ AttributeSensor<Integer> RIAK_CONSISTENT_GET_TIME_MEAN = Sensors.newIntegerSensor("riak.consistent_get_time_mean", "Strongly consistent read latency");
+ AttributeSensor<Integer> RIAK_CONSISTENT_PUT_TIME_MEAN = Sensors.newIntegerSensor("riak.consistent_put_time_mean", "Strongly consistent write latency");
+
+ List<AttributeSensor<Integer>> ONE_MINUTE_STRING_SENSORS = ImmutableList.of(RIAK_NODE_GET_FSM_TIME_MEAN, RIAK_NODE_PUT_FSM_TIME_MEAN,
+ RIAK_OBJECT_COUNTER_MERGE_TIME_MEAN, RIAK_OBJECT_SET_MERGE_TIME_MEAN, RIAK_OBJECT_MAP_MERGE_TIME_MEAN,
+ RIAK_SEARCH_QUERY_LATENCY_MEDIAN, RIAK_SEARCH_INDEX_LATENCY_MEDIAN,
+ RIAK_CONSISTENT_GET_TIME_MEAN, RIAK_CONSISTENT_PUT_TIME_MEAN);
+
+ ConfigKey<Boolean> DO_OS_TUNING = new BasicConfigKey<Boolean>(
+ Boolean.class,
+ "do.os.tunning",
+ "Does sysctl OS optimizations. By default it is true",
+ true);
+
// accessors, for use from template file
Integer getRiakWebPort();
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/bdffc952/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java
index 0667a7a..992c77c 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java
@@ -30,6 +30,7 @@ import javax.annotation.Nullable;
import brooklyn.entity.basic.Entities;
import brooklyn.entity.basic.SoftwareProcessImpl;
import brooklyn.entity.webapp.WebAppServiceMethods;
+import brooklyn.event.AttributeSensor;
import brooklyn.event.basic.AttributeSensorAndConfigKey;
import brooklyn.event.feed.http.HttpFeed;
import brooklyn.event.feed.http.HttpPollConfig;
@@ -104,7 +105,7 @@ public class RiakNodeImpl extends SoftwareProcessImpl implements RiakNode {
connectServiceUpIsRunning();
HostAndPort accessible = BrooklynAccessUtils.getBrooklynAccessibleAddress(this, getRiakWebPort());
- httpFeed = HttpFeed.builder()
+ HttpFeed.Builder httpFeedBuilder = HttpFeed.builder()
.entity(this)
.period(500, TimeUnit.MILLISECONDS)
.baseUri(String.format("http://%s/stats", accessible.toString()))
@@ -161,8 +162,15 @@ public class RiakNodeImpl extends SoftwareProcessImpl implements RiakNode {
}
}
))
- .onFailureOrException(Functions.constant(Arrays.asList(new String[0]))))
- .build();
+ .onFailureOrException(Functions.constant(Arrays.asList(new String[0]))));
+
+ for (AttributeSensor<Integer> sensor : ONE_MINUTE_STRING_SENSORS) {
+ httpFeedBuilder.poll(new HttpPollConfig<Integer>(sensor)
+ .onSuccess(HttpValueFunctions.jsonContents(sensor.getName().substring(5), Integer.class))
+ .onFailureOrException(Functions.constant(-1)));
+ }
+
+ httpFeed = httpFeedBuilder.build();
WebAppServiceMethods.connectWebAppServerPolicies(this);
}
[2/4] incubator-brooklyn git commit: Remove wildcard import
Posted by gr...@apache.org.
Remove wildcard import
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3c3ac2a0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3c3ac2a0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3c3ac2a0
Branch: refs/heads/master
Commit: 3c3ac2a07b9400863d56af24d79b4db3b64c67c9
Parents: bdffc95
Author: Valentin Aitken <bo...@gmail.com>
Authored: Tue Mar 24 13:28:24 2015 +0200
Committer: Valentin Aitken <bo...@gmail.com>
Committed: Tue Mar 24 13:28:24 2015 +0200
----------------------------------------------------------------------
.../src/main/java/brooklyn/entity/nosql/riak/RiakNode.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3c3ac2a0/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
index 12724d1..0f9ac54 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
@@ -29,7 +29,11 @@ import brooklyn.entity.basic.MethodEffector;
import brooklyn.entity.basic.SoftwareProcess;
import brooklyn.entity.proxying.ImplementedBy;
import brooklyn.event.AttributeSensor;
-import brooklyn.event.basic.*;
+import brooklyn.event.basic.AttributeSensorAndConfigKey;
+import brooklyn.event.basic.BasicConfigKey;
+import brooklyn.event.basic.PortAttributeSensorAndConfigKey;
+import brooklyn.event.basic.Sensors;
+import brooklyn.event.basic.TemplatedStringAttributeSensorAndConfigKey;
import brooklyn.util.flags.SetFromFlag;
import com.google.common.collect.ImmutableList;
[4/4] incubator-brooklyn git commit: This closes #565
Posted by gr...@apache.org.
This closes #565
* github/pr/565:
Prefixing riak sensorAttributes - fix bug
Remove wildcard import
Riak Linux - add more sensors
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/7fbcf848
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/7fbcf848
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/7fbcf848
Branch: refs/heads/master
Commit: 7fbcf8488250b86809147435b1ef435985b2fc9c
Parents: 9e7b523 7be66be
Author: Andrew Kennedy <gr...@apache.org>
Authored: Tue Mar 24 20:14:35 2015 +0000
Committer: Andrew Kennedy <gr...@apache.org>
Committed: Tue Mar 24 20:14:35 2015 +0000
----------------------------------------------------------------------
.../brooklyn/entity/nosql/riak/RiakNode.java | 65 +++++++++++++-------
.../entity/nosql/riak/RiakNodeImpl.java | 14 ++++-
2 files changed, 55 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/7fbcf848/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/7fbcf848/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java
----------------------------------------------------------------------
[3/4] incubator-brooklyn git commit: Prefixing riak sensorAttributes
- fix bug
Posted by gr...@apache.org.
Prefixing riak sensorAttributes - fix bug
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/7be66be1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/7be66be1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/7be66be1
Branch: refs/heads/master
Commit: 7be66be15c1544f298315df3d2ff4e7d59f1669c
Parents: 3c3ac2a
Author: Valentin Aitken <bo...@gmail.com>
Authored: Tue Mar 24 16:44:04 2015 +0200
Committer: Valentin Aitken <bo...@gmail.com>
Committed: Tue Mar 24 16:44:04 2015 +0200
----------------------------------------------------------------------
.../main/java/brooklyn/entity/nosql/riak/RiakNode.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/7be66be1/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
index 0f9ac54..ba0f689 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
@@ -111,12 +111,12 @@ public interface RiakNode extends SoftwareProcess {
AttributeSensor<String> RIAK_NODE_NAME = Sensors.newStringSensor("riak.node", "Returns the riak node name as defined in vm.args");
// these needed for nodes to talk to each other, but not clients (so ideally set up in the security group for internal access)
- PortAttributeSensorAndConfigKey HANDOFF_LISTENER_PORT = new PortAttributeSensorAndConfigKey("riak.handoffListenerPort", "Handoff Listener Port", "8099+");
- PortAttributeSensorAndConfigKey EPMD_LISTENER_PORT = new PortAttributeSensorAndConfigKey("riak.epmdListenerPort", "Erlang Port Mapper Daemon Listener Port", "4369");
- PortAttributeSensorAndConfigKey ERLANG_PORT_RANGE_START = new PortAttributeSensorAndConfigKey("riak.erlangPortRangeStart", "Erlang Port Range Start", "6000+");
- PortAttributeSensorAndConfigKey ERLANG_PORT_RANGE_END = new PortAttributeSensorAndConfigKey("riak.erlangPortRangeEnd", "Erlang Port Range End", "7999+");
- PortAttributeSensorAndConfigKey SEARCH_SOLR_PORT = new PortAttributeSensorAndConfigKey("riak.search.solr.port", "Solr port", "8093+");
- PortAttributeSensorAndConfigKey SEARCH_SOLR_JMX_PORT = new PortAttributeSensorAndConfigKey("riak.search.solr.jmx_port", "Solr port", "8985+");
+ PortAttributeSensorAndConfigKey HANDOFF_LISTENER_PORT = new PortAttributeSensorAndConfigKey("handoffListenerPort", "Handoff Listener Port", "8099+");
+ PortAttributeSensorAndConfigKey EPMD_LISTENER_PORT = new PortAttributeSensorAndConfigKey("epmdListenerPort", "Erlang Port Mapper Daemon Listener Port", "4369");
+ PortAttributeSensorAndConfigKey ERLANG_PORT_RANGE_START = new PortAttributeSensorAndConfigKey("erlangPortRangeStart", "Erlang Port Range Start", "6000+");
+ PortAttributeSensorAndConfigKey ERLANG_PORT_RANGE_END = new PortAttributeSensorAndConfigKey("erlangPortRangeEnd", "Erlang Port Range End", "7999+");
+ PortAttributeSensorAndConfigKey SEARCH_SOLR_PORT = new PortAttributeSensorAndConfigKey("search.solr.port", "Solr port", "8093+");
+ PortAttributeSensorAndConfigKey SEARCH_SOLR_JMX_PORT = new PortAttributeSensorAndConfigKey("search.solr.jmx_port", "Solr port", "8985+");
AttributeSensor<Integer> NODE_GETS = Sensors.newIntegerSensor("riak.node.gets");
AttributeSensor<Integer> NODE_GETS_TOTAL = Sensors.newIntegerSensor("riak.node.gets.total");