You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/05/17 18:12:22 UTC
stratos git commit: Fixing CEP artifacts related to requests in
flight calculations
Repository: stratos
Updated Branches:
refs/heads/master 66e42caad -> f81f7111e
Fixing CEP artifacts related to requests in flight calculations
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f81f7111
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f81f7111
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f81f7111
Branch: refs/heads/master
Commit: f81f7111e21e91a90a17fd327c50a542ad523ef7
Parents: 66e42ca
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun May 17 21:42:06 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun May 17 21:42:06 2015 +0530
----------------------------------------------------------------------
.../AutoscalerHealthStatEventReceiver.java | 7 +---
.../monitor/cluster/ClusterMonitor.java | 17 ++------
.../InstanceStatusStatisticsBuilder.xml | 31 ---------------
.../AverageServedRequestsEventFormatter.xml | 32 ---------------
.../AverageInFlightRequestsFinder.xml | 42 ++++++++------------
...SecondDerivativeOfRequestsInFlightFinder.xml | 2 +-
.../streamdefinitions/stream-manager-config.xml | 17 --------
7 files changed, 24 insertions(+), 124 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/f81f7111/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/health/AutoscalerHealthStatEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/health/AutoscalerHealthStatEventReceiver.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/health/AutoscalerHealthStatEventReceiver.java
index 3a55442..826a325 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/health/AutoscalerHealthStatEventReceiver.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/health/AutoscalerHealthStatEventReceiver.java
@@ -61,8 +61,6 @@ public class AutoscalerHealthStatEventReceiver {
if (log.isInfoEnabled()) {
log.info("Autoscaler health stat event receiver thread started");
}
-
-
}
private void addEventListeners() {
@@ -73,8 +71,7 @@ public class AutoscalerHealthStatEventReceiver {
AverageLoadAverageEvent averageLoadAverageEvent = (AverageLoadAverageEvent) event;
String clusterId = averageLoadAverageEvent.getClusterId();
AutoscalerContext asCtx = AutoscalerContext.getInstance();
- ClusterMonitor monitor;
- monitor = asCtx.getClusterMonitor(clusterId);
+ ClusterMonitor monitor = asCtx.getClusterMonitor(clusterId);
if (null == monitor) {
if (log.isDebugEnabled()) {
log.debug(String.format("A cluster monitor is not found in autoscaler context "
@@ -279,7 +276,7 @@ public class AutoscalerHealthStatEventReceiver {
String clusterId = memberFaultEvent.getClusterId();
String memberId = memberFaultEvent.getMemberId();
if (log.isDebugEnabled()) {
- log.debug(String.format("Member fault event: [member] %s ", memberId));
+ log.debug(String.format("Member fault event received: [member] %s ", memberId));
}
if (memberId == null || memberId.isEmpty()) {
log.error("Member id not found in received message");
http://git-wip-us.apache.org/repos/asf/stratos/blob/f81f7111/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
index 4cb2deb..cb4b746 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
@@ -811,23 +811,14 @@ public class ClusterMonitor extends Monitor {
String networkPartitionId = averageRequestsInFlightEvent.getNetworkPartitionId();
String clusterId = averageRequestsInFlightEvent.getClusterId();
String clusterInstanceId = averageRequestsInFlightEvent.getClusterInstanceId();
- /*Float servedCount = averageRequestsInFlightEvent.getServedCount();
- Float activeInstances = averageRequestsInFlightEvent.getActiveInstances();
- Float requestsServedPerInstance = servedCount / activeInstances;
- if (requestsServedPerInstance.isInfinite()) {
- requestsServedPerInstance = 0f;
- }*/
float value = averageRequestsInFlightEvent.getValue();
if (log.isDebugEnabled()) {
- log.debug(String.format("Average Rif event: [cluster] %s [network-partition] %s [value] %s",
+ log.debug(String.format("Average RIF event: [cluster] %s [network-partition] %s [value] %s",
clusterId, networkPartitionId, value));
}
if (clusterInstanceId.equals(NOT_DEFINED)) {
-
ClusterLevelNetworkPartitionContext networkPartitionContext = getNetworkPartitionContext(networkPartitionId);
-
if (null != networkPartitionContext) {
-
int totalActiveMemberCount = 0;
for (InstanceContext clusterInstanceContext : networkPartitionContext.getActiveInstances()) {
if (clusterInstanceContext instanceof ClusterInstanceContext) {
@@ -871,7 +862,7 @@ public class ClusterMonitor extends Monitor {
float value = gradientOfRequestsInFlightEvent.getValue();
if (log.isDebugEnabled()) {
- log.debug(String.format("Gradient of Rif event: [cluster] %s [network-partition] %s [value] %s",
+ log.debug(String.format("Gradient of RIF event: [cluster] %s [network-partition] %s [value] %s",
clusterId, networkPartitionId, value));
}
if (clusterInstanceId.equals(NOT_DEFINED)) {
@@ -895,7 +886,7 @@ public class ClusterMonitor extends Monitor {
}
} else {
if (log.isDebugEnabled()) {
- log.debug(String.format("Network partition context is not available for :" +
+ log.debug(String.format("Network partition context is not available for:" +
" [network partition] %s", networkPartitionId));
}
}
@@ -922,7 +913,7 @@ public class ClusterMonitor extends Monitor {
String clusterInstanceId = secondDerivativeOfRequestsInFlightEvent.getClusterInstanceId();
float value = secondDerivativeOfRequestsInFlightEvent.getValue();
if (log.isDebugEnabled()) {
- log.debug(String.format("Second derivative of Rif event: [cluster] %s "
+ log.debug(String.format("Second derivative of RIF event: [cluster] %s "
+ "[network-partition] %s [value] %s", clusterId, networkPartitionId, value));
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/f81f7111/extensions/cep/artifacts/eventbuilders/InstanceStatusStatisticsBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventbuilders/InstanceStatusStatisticsBuilder.xml b/extensions/cep/artifacts/eventbuilders/InstanceStatusStatisticsBuilder.xml
deleted file mode 100644
index 6591419..0000000
--- a/extensions/cep/artifacts/eventbuilders/InstanceStatusStatisticsBuilder.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-<eventBuilder name="InstanceStatusStatisticsBuilder"
- statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventbuilder">
- <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
- <property name="stream">stratos.instance.stats</property>
- <property name="version">1.0.0</property>
- </from>
- <mapping customMapping="disable" type="wso2event"/>
- <to streamName="stratos.instance.stats" version="1.0.0"/>
-</eventBuilder>
http://git-wip-us.apache.org/repos/asf/stratos/blob/f81f7111/extensions/cep/artifacts/eventformatters/AverageServedRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/AverageServedRequestsEventFormatter.xml b/extensions/cep/artifacts/eventformatters/AverageServedRequestsEventFormatter.xml
deleted file mode 100755
index b76c40b..0000000
--- a/extensions/cep/artifacts/eventformatters/AverageServedRequestsEventFormatter.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-<eventFormatter name="AverageServedRequestsEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="average_served_request_count" version="1.0.0"/>
- <mapping customMapping="enable" type="json">
- <inline>{"org.apache.stratos.messaging.event.health.stat.AverageRequestsServingCapabilityEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_served_count}}"}}}</inline>
- </mapping>
- <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
- <property name="transport.jms.Destination">summarized-health-stats</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/f81f7111/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml b/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
index e9607a3..3ff8287 100644
--- a/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
+++ b/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
@@ -21,36 +21,28 @@
-->
<executionPlan name="AverageInFlightRequestsFinder" statistics="disable"
- trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
- <description>This will average the number of requests in flight over a minute.</description>
- <siddhiConfiguration>
- <property name="siddhi.enable.distributed.processing">false</property>
- <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
- </siddhiConfiguration>
- <importedStreams>
- <stream as="avg_rif_stat" name="in_flight_requests" version="1.0.0"/>
- </importedStreams>
- <queryExpressions><![CDATA[
+ trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+ <description>This will average the number of requests in flight over a minute.</description>
+ <siddhiConfiguration>
+ <property name="siddhi.enable.distributed.processing">false</property>
+ <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+ </siddhiConfiguration>
+ <importedStreams>
+ <stream as="avg_rif_stat" name="in_flight_requests" version="1.0.0"/>
+ </importedStreams>
+ <queryExpressions><![CDATA[
from avg_rif_stat
- select cluster_id, cluster_instance_id, network_partition_id,active_instances_count, in_flight_request_count,served_request_count,
+ select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
stratos:concat(cluster_id, '-' ,cluster_instance_id) as avg_rif_cluster_network
insert into avg_rif_concat;
define partition avg_rif_cluster_partition by avg_rif_concat.avg_rif_cluster_network;
from avg_rif_concat#window.timeBatch(1 min)
- select cluster_id, cluster_instance_id, network_partition_id,avg(active_instances_count) as instances_count, avg(in_flight_request_count) as count , sum(served_request_count) as served_count
+ select cluster_id, cluster_instance_id, network_partition_id, avg(in_flight_request_count) as count
insert into average_in_flight_requests
partition by avg_rif_cluster_partition;
- from average_in_flight_requests
- select cluster_id, cluster_instance_id, network_partition_id,instances_count, served_count,
- stratos:divider(served_count , instances_count) as requests_per_instance
- insert into served_requests_per_instance;
- from served_requests_per_instance[requests_per_instance>0]#window.timeBatch(10 min)
- select cluster_id, cluster_instance_id, network_partition_id, avg(requests_per_instance) as average_served_count
- insert into average_served_request_count;]]></queryExpressions>
- <exportedStreams>
- <stream name="average_in_flight_requests"
- valueOf="average_in_flight_requests" version="1.0.0"/>
- <stream name="average_served_request_count"
- valueOf="average_served_request_count" version="1.0.0"/>
- </exportedStreams>
+ ]]></queryExpressions>
+ <exportedStreams>
+ <stream name="average_in_flight_requests"
+ valueOf="average_in_flight_requests" version="1.0.0"/>
+ </exportedStreams>
</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/f81f7111/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml b/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
index 157fbe3..c8e4ed5 100644
--- a/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
+++ b/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
@@ -43,6 +43,6 @@
]]></queryExpressions>
<exportedStreams>
<stream name="second_derivative_in_flight_requests"
- valueOf="second_derivative_in_flight_requests" version="1.0.0"/>
+ valueOf="second_derivative_in_flight_requests" version="1.0.0"/>
</exportedStreams>
</executionPlan>
http://git-wip-us.apache.org/repos/asf/stratos/blob/f81f7111/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml b/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml
index 26110f0..4c4c7e0 100644
--- a/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml
+++ b/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml
@@ -63,27 +63,10 @@
<property name="cluster_id" type="String"/>
<property name="cluster_instance_id" type="String"/>
<property name="network_partition_id" type="String"/>
- <property name="instances_count" type="double"/>
<property name="count" type="double"/>
- <property name="served_count" type="double"/>
</payloadData>
</streamDefinition>
- <streamDefinition name="average_served_request_count" version="1.0.0">
- <description>average served count per instance</description>
- <nickName>average in-flight requests</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="average_served_count" type="double"/>
- </payloadData>
- </streamDefinition>
-
<streamDefinition name="second_derivative_in_flight_requests" version="1.0.0">
<description>second derivative of in-flight request count</description>
<nickName>second derivative in-flight requests</nickName>