Repository: stratos
Updated Branches:
  refs/heads/master a2e8e0cff -> 396aa955c


fixing STRATOS-675


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/396aa955
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/396aa955
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/396aa955

Branch: refs/heads/master
Commit: 396aa955c487187d57390e7b4b0d21951ead47ee
Parents: a2e8e0c
Author: rekathiru <[email protected]>
Authored: Tue Jun 24 18:41:50 2014 +0530
Committer: rekathiru <[email protected]>
Committed: Tue Jun 24 18:41:50 2014 +0530

----------------------------------------------------------------------
 .../executionplans/AverageHeathRequest.xml      | 33 ++++++++++++++++----
 .../AverageInFlightRequestsFinder.xml           | 13 ++++++--
 .../executionplans/GradientOfHealthRequest.xml  | 32 +++++++++++++++----
 .../GradientOfRequestsInFlightFinder.xml        | 17 +++++++---
 .../SecondDerivativeOfHealthRequest.xml         | 30 +++++++++++++++---
 ...SecondDerivativeOfRequestsInFlightFinder.xml | 14 +++++++--
 .../src/main/conf/siddhi/siddhi.extension       |  1 +
 7 files changed, 113 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/396aa955/extensions/cep/artifacts/executionplans/AverageHeathRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/executionplans/AverageHeathRequest.xml 
b/extensions/cep/artifacts/executionplans/AverageHeathRequest.xml
index 7a6ec84..598f62a 100644
--- a/extensions/cep/artifacts/executionplans/AverageHeathRequest.xml
+++ b/extensions/cep/artifacts/executionplans/AverageHeathRequest.xml
@@ -28,13 +28,34 @@
     <property 
name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
   </siddhiConfiguration>
   <importedStreams>
-    <stream as="healthStats1" name="cartridge_agent_health_stats" 
version="1.0.0"/>
+    <stream as="health_avg_processsor" name="cartridge_agent_health_stats" 
version="1.0.0"/>
   </importedStreams>
-  <queryExpressions><![CDATA[from healthStats1 [health_description == 
'ports_not_open'] select cluster_id, network_partition_id, member_id, 
partition_id insert into fault_message;
-  from healthStats1 [health_description == 'load_average'] #window.timeBatch(1 
min) select cluster_id, network_partition_id, avg(value) as 
average_load_average group by cluster_id, network_partition_id insert into 
average_load_average_stats;
-  from healthStats1 [health_description == 'load_average'] #window.timeBatch(1 
min) select member_id, cluster_id, network_partition_id, avg(value) as 
member_average_load_average group by member_id insert into 
member_average_load_average_stats;
-  from healthStats1 [health_description == 'memory_consumption'] 
#window.timeBatch(1 min) select member_id, cluster_id, network_partition_id, 
avg(value) as member_average_memory_consumption group by member_id insert into 
member_average_memory_consumption_stats;
-  from healthStats1 [health_description == 'memory_consumption'] 
#window.timeBatch(1 min) select cluster_id, network_partition_id, avg(value) as 
average_memory_consumption group by cluster_id, network_partition_id insert 
into average_memory_consumption_stats;]]></queryExpressions>
+  <queryExpressions><![CDATA[
+       from health_avg_processsor [health_description == 'ports_not_open'] 
+               select cluster_id, network_partition_id, member_id, 
partition_id insert into fault_message;
+       from health_avg_processsor
+               select cluster_id, network_partition_id, member_id, 
partition_id, health_description, value, 
+               stratos:concat(cluster_id, '-' , network_partition_id) as 
health_grad_cluster_network 
+               insert into health_avg_concatinator;
+       define partition health_avg_cluster_partition by   
health_avg_concatinator.health_grad_cluster_network;
+       define partition member_health_avg_cluster_partition by  
health_avg_processsor.member_id;
+       from health_avg_concatinator [health_description == 'load_average'] 
+               #window.timeBatch(1 min) select cluster_id, 
network_partition_id, avg(value) as average_load_average   
+               insert into average_load_average_stats 
+               partition by health_avg_cluster_partition;
+       from health_avg_processsor [health_description == 'load_average'] 
+               #window.timeBatch(1 min) select member_id, cluster_id, 
network_partition_id, avg(value) as member_average_load_average 
+               insert into member_average_load_average_stats 
+               partition by member_health_avg_cluster_partition;
+       from health_avg_processsor [health_description == 'memory_consumption'] 
+               #window.timeBatch(1 min) select member_id, cluster_id, 
network_partition_id, avg(value) as member_average_memory_consumption 
+               insert into member_average_memory_consumption_stats 
+               partition by member_health_avg_cluster_partition;
+       from health_avg_concatinator [health_description == 
'memory_consumption'] 
+               #window.timeBatch(1 min) select cluster_id, 
network_partition_id, avg(value) as average_memory_consumption 
+               insert into average_memory_consumption_stats 
+               partition by health_avg_cluster_partition;
+  ]]></queryExpressions>
   <exportedStreams>
     <stream name="average_load_average_stats" passthroughFlow="disable"
       valueOf="average_load_average_stats" version="1.0.0"/>

http://git-wip-us.apache.org/repos/asf/stratos/blob/396aa955/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
----------------------------------------------------------------------
diff --git 
a/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml 
b/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
index 675e8b7..6826dab 100644
--- a/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
+++ b/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
@@ -28,11 +28,18 @@
     <property 
name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
   </siddhiConfiguration>
   <importedStreams>
-    <stream as="lbStats1" name="in_flight_requests" version="1.0.0"/>
+    <stream as="avg_rif_stat" name="in_flight_requests" version="1.0.0"/>
   </importedStreams>
   <queryExpressions><![CDATA[ 
-from lbStats1#window.timeBatch(1 min)
-select cluster_id,network_partition_id, avg(in_flight_request_count) as count 
group by cluster_id,network_partition_id  insert into 
average_in_flight_requests;]]></queryExpressions>
+       from avg_rif_stat
+               select cluster_id, network_partition_id, 
in_flight_request_count, 
+               stratos:concat(cluster_id, '-' , network_partition_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,network_partition_id, 
avg(in_flight_request_count) as count 
+               insert into average_in_flight_requests 
+               partition by avg_rif_cluster_partition;]]></queryExpressions>
   <exportedStreams>
     <stream name="average_in_flight_requests"
       valueOf="average_in_flight_requests" version="1.0.0"/>

http://git-wip-us.apache.org/repos/asf/stratos/blob/396aa955/extensions/cep/artifacts/executionplans/GradientOfHealthRequest.xml
----------------------------------------------------------------------
diff --git 
a/extensions/cep/artifacts/executionplans/GradientOfHealthRequest.xml 
b/extensions/cep/artifacts/executionplans/GradientOfHealthRequest.xml
index 7b69214..9ae0042 100644
--- a/extensions/cep/artifacts/executionplans/GradientOfHealthRequest.xml
+++ b/extensions/cep/artifacts/executionplans/GradientOfHealthRequest.xml
@@ -28,14 +28,34 @@
     <property 
name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
   </siddhiConfiguration>
   <importedStreams>
-    <stream as="healthStats2" name="cartridge_agent_health_stats" 
version="1.0.0"/>
+    <stream as="health_grad_processsor" name="cartridge_agent_health_stats" 
version="1.0.0"/>
   </importedStreams>
   <queryExpressions><![CDATA[
-  from healthStats2 #window.stratos:faultHandling(1min, member_id) select 
cluster_id, network_partition_id, member_id, partition_id group by cluster_id, 
network_partition_id insert into fault_message;
-  from healthStats2 [health_description == 'load_average'] 
#window.stratos:gradient(1 min, value) select cluster_id, network_partition_id, 
value as gradient_load_average group by cluster_id, network_partition_id insert 
into gradient_load_average_stats;
-  from healthStats2 [health_description == 'load_average'] 
#window.stratos:gradient(1 min, value) select member_id, cluster_id, 
network_partition_id, value as member_gradient_load_average group by member_id 
insert into member_gradient_load_average_stats;
-  from healthStats2 [health_description == 'memory_consumption'] 
#window.stratos:gradient(1 min, value) select member_id, cluster_id, 
network_partition_id, value as member_gradient_memory_consumption group by 
member_id insert into member_gradient_memory_consumption_stats;
-  from healthStats2 [health_description == 'memory_consumption'] 
#window.stratos:gradient(1 min, value) select cluster_id, network_partition_id, 
value as gradient_memory_consumption group by cluster_id, network_partition_id 
insert into gradient_memory_consumption_stats;]]></queryExpressions>
+       from health_grad_processsor 
+               #window.stratos:faultHandling(1min, member_id) select 
cluster_id, network_partition_id, member_id, partition_id 
+               group by cluster_id, network_partition_id 
+               insert into fault_message;
+       from health_grad_processsor
+               select cluster_id, network_partition_id, member_id, 
partition_id, health_description, value, 
+               stratos:concat(cluster_id, '-' , network_partition_id) as 
health_grad_cluster_network 
+               insert into health_grad_concatinator;
+       define partition health_grad_cluster_partition by  
health_grad_concatinator.health_grad_cluster_network;
+       define partition member_health_grad_cluster_partition by 
health_grad_processsor.member_id;
+       from health_grad_concatinator [health_description == 'load_average'] 
+               #window.stratos:gradient(1 min, value) select cluster_id, 
network_partition_id, value as gradient_load_average 
+               insert into gradient_load_average_stats 
+               partition by health_grad_cluster_partition;
+       from health_grad_processsor [health_description == 'load_average'] 
+               #window.stratos:gradient(1 min, value) select member_id, 
cluster_id, network_partition_id, value as member_gradient_load_average 
+               insert into member_gradient_load_average_stats 
+               partition by member_health_grad_cluster_partition;
+       from health_grad_processsor [health_description == 
'memory_consumption'] 
+               #window.stratos:gradient(1 min, value) select member_id, 
cluster_id, network_partition_id, value as member_gradient_memory_consumption 
+               insert into member_gradient_memory_consumption_stats  partition 
by member_health_grad_cluster_partition;
+       from health_grad_concatinator [health_description == 
'memory_consumption'] 
+               #window.stratos:gradient(1 min, value) select cluster_id, 
network_partition_id, value as gradient_memory_consumption 
+               insert into gradient_memory_consumption_stats 
+               partition by 
health_grad_cluster_partition;]]></queryExpressions>
   <exportedStreams>
     <stream name="gradient_load_average_stats"
       valueOf="gradient_load_average_stats" version="1.0.0"/>

http://git-wip-us.apache.org/repos/asf/stratos/blob/396aa955/extensions/cep/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git 
a/extensions/cep/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml 
b/extensions/cep/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
index b76219a..e63911e 100644
--- 
a/extensions/cep/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
+++ 
b/extensions/cep/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
@@ -28,11 +28,20 @@
     <property 
name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
   </siddhiConfiguration>
   <importedStreams>
-    <stream as="lbStats2" name="in_flight_requests" version="1.0.0"/>
+    <stream as="gradient_rif_processor" name="in_flight_requests" 
version="1.0.0"/>
   </importedStreams>
-  <queryExpressions><![CDATA[ 
-from lbStats2#window.stratos:gradient(1 min, in_flight_request_count)
-select cluster_id,network_partition_id,in_flight_request_count as count group 
by cluster_id,network_partition_id insert into 
gradient_in_flight_requests;]]></queryExpressions>
+  <queryExpressions><![CDATA[
+       from gradient_rif_processor 
+                select cluster_id, network_partition_id, 
in_flight_request_count, 
+                stratos:concat(cluster_id, '-' , network_partition_id) as 
request_grad_cluster_network 
+                insert into gradient_rif_concatinator;
+        define partition request_grad_cluster_partition  by 
gradient_rif_concatinator.request_grad_cluster_network;
+        from gradient_rif_concatinator
+                #window.stratos:gradient(1 min, in_flight_request_count)
+                select cluster_id,network_partition_id,in_flight_request_count 
as count  
+                insert into gradient_in_flight_requests 
+                partition by request_grad_cluster_partition;
+]]></queryExpressions>
   <exportedStreams>
     <stream name="gradient_in_flight_requests" 
valueOf="gradient_in_flight_requests" version="1.0.0"/>
   </exportedStreams>

http://git-wip-us.apache.org/repos/asf/stratos/blob/396aa955/extensions/cep/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
----------------------------------------------------------------------
diff --git 
a/extensions/cep/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml 
b/extensions/cep/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
index f2bbbe1..101a70a 100644
--- 
a/extensions/cep/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
+++ 
b/extensions/cep/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
@@ -28,13 +28,33 @@
     <property 
name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
   </siddhiConfiguration>
   <importedStreams>
-    <stream as="healthStats3" name="cartridge_agent_health_stats" 
version="1.0.0"/>
+    <stream as="health_second_der_request" name="cartridge_agent_health_stats" 
version="1.0.0"/>
   </importedStreams>
   <queryExpressions><![CDATA[ 
-    from healthStats3 [health_description == 'memory_consumption'] 
#window.stratos:secondDerivative(1 min, value) select cluster_id, 
network_partition_id, value as second_derivative_memory_consumption group by 
cluster_id,network_partition_id insert into 
second_derivative_memory_consumption_stats;
-    from healthStats3 [health_description == 'memory_consumption'] 
#window.stratos:secondDerivative(1 min, value) select member_id, cluster_id, 
network_partition_id, value as member_second_derivative_memory_consumption 
group by member_id insert into 
member_second_derivative_memory_consumption_stats;
-  from healthStats3 [health_description == 'load_average'] 
#window.stratos:secondDerivative(1 min, value) select member_id, cluster_id, 
network_partition_id, value as member_second_derivative_load_average group by 
member_id insert into member_second_derivative_load_average_stats;
-  from healthStats3 [health_description == 'load_average'] 
#window.stratos:secondDerivative(1 min, value) select cluster_id, 
network_partition_id, value as second_derivative_load_average group by 
cluster_id,network_partition_id insert into 
second_derivative_load_average_stats;]]></queryExpressions>
+        from health_second_der_request
+               select member_id, cluster_id, network_partition_id, 
health_description, value, 
+               stratos:concat(cluster_id, '-' ,network_partition_id) as 
health_second_der_cluster_network
+               insert into health_second_der_concat;
+       define partition health_second_der_cluster_partition  by 
health_second_der_concat.health_second_der_cluster_network;
+       from health_second_der_concat [health_description == 
'memory_consumption'] 
+               #window.stratos:secondDerivative(1 min, value) select 
cluster_id, network_partition_id, value as second_derivative_memory_consumption 
+               insert into second_derivative_memory_consumption_stats 
+               partition by health_second_der_cluster_partition;
+       from health_second_der_concat [health_description == 'load_average'] 
+               #window.stratos:secondDerivative(1 min, value) select 
cluster_id, network_partition_id, value as second_derivative_load_average 
+               insert into second_derivative_load_average_stats 
+               partition by health_second_der_cluster_partition;
+       define partition health_second_der_member_partition by 
health_second_der_request.member_id;
+       from health_second_der_request [health_description == 
'memory_consumption'] 
+               #window.stratos:secondDerivative(1 min, value) 
+               select member_id, cluster_id, network_partition_id, value as 
member_second_derivative_memory_consumption 
+               insert into member_second_derivative_memory_consumption_stats 
+               partition by health_second_der_member_partition;
+       from health_second_der_request [health_description == 'load_average'] 
+               #window.stratos:secondDerivative(1 min, value)
+               select member_id, cluster_id, network_partition_id, value as 
member_second_derivative_load_average
+                insert into member_second_derivative_load_average_stats 
+               partition by 
health_second_der_member_partition;]]></queryExpressions>
   <exportedStreams>
     <stream name="second_derivative_memory_consumption_stats"
       valueOf="second_derivative_memory_consumption_stats" version="1.0.0"/>

http://git-wip-us.apache.org/repos/asf/stratos/blob/396aa955/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git 
a/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
 
b/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
index 53a88e0..18e2eaf 100644
--- 
a/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
+++ 
b/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
@@ -28,11 +28,19 @@
     <property 
name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
   </siddhiConfiguration>
   <importedStreams>
-    <stream as="lbStats3" name="in_flight_requests" version="1.0.0"/>
+    <stream as="second_der_rif" name="in_flight_requests" version="1.0.0"/>
   </importedStreams>
   <queryExpressions><![CDATA[ 
-from lbStats3#window.stratos:secondDerivative(1 min, in_flight_request_count)
-select cluster_id,network_partition_id,in_flight_request_count as count group 
by cluster_id,network_partition_id insert into 
second_derivative_in_flight_requests;]]></queryExpressions>
+       from second_der_rif
+               select cluster_id, network_partition_id, 
in_flight_request_count, 
+               stratos:concat(cluster_id, '-' ,network_partition_id) as 
rif_second_der_cluster_network
+               insert into rif_second_der_concat;
+       define partition rif_second_der_cluster_partition by 
rif_second_der_concat.rif_second_der_cluster_network;
+       from rif_second_der_concat#window.stratos:secondDerivative(1 min, 
in_flight_request_count)
+               select cluster_id,network_partition_id,in_flight_request_count 
as count 
+               insert into second_derivative_in_flight_requests 
+               partition by rif_second_der_cluster_partition;
+  ]]></queryExpressions>
   <exportedStreams>
     <stream name="second_derivative_in_flight_requests"
       valueOf="second_derivative_in_flight_requests" version="1.0.0"/>

http://git-wip-us.apache.org/repos/asf/stratos/blob/396aa955/products/stratos/modules/distribution/src/main/conf/siddhi/siddhi.extension
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/distribution/src/main/conf/siddhi/siddhi.extension 
b/products/stratos/modules/distribution/src/main/conf/siddhi/siddhi.extension
index 6bb9aca..470d66c 100644
--- 
a/products/stratos/modules/distribution/src/main/conf/siddhi/siddhi.extension
+++ 
b/products/stratos/modules/distribution/src/main/conf/siddhi/siddhi.extension
@@ -1,3 +1,4 @@
 org.apache.stratos.cep.extension.GradientFinderWindowProcessor
 org.apache.stratos.cep.extension.SecondDerivativeFinderWindowProcessor
 org.apache.stratos.cep.extension.FaultHandlingWindowProcessor
+org.apache.stratos.cep.extension.ConcatWindowProcessor

Reply via email to