You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2014/01/10 17:55:11 UTC
[1/2] git commit: Avoid running scale down rule if it is already
decided to scale up
Updated Branches:
refs/heads/master a0d6ce5f3 -> 1f1230cb2
Avoid running scale down rule if it is already decided to scale up
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/45b66181
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/45b66181
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/45b66181
Branch: refs/heads/master
Commit: 45b66181912be2ecadad2d8a708dac54a210668c
Parents: 9b9c081
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Fri Jan 10 22:29:29 2014 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Fri Jan 10 22:29:29 2014 +0530
----------------------------------------------------------------------
.../apache/stratos/autoscaler/rule/RuleTasksDelegator.java | 8 ++++++++
.../modules/distribution/src/main/conf/scaling.drl | 6 +++++-
2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/45b66181/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
index 8cbeb6f..3c589c9 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
@@ -22,6 +22,8 @@ public class RuleTasksDelegator {
public static final double SCALE_UP_FACTOR = 0.8; //get from config
public static final double SCALE_DOWN_FACTOR = 0.2;
+ private boolean scaledUp = false;
+
private static final Log log = LogFactory.getLog(RuleTasksDelegator.class);
public double getPredictedValueForNextMinute(float average, float gradient, float secondDerivative, int timeInterval){
@@ -137,5 +139,11 @@ public class RuleTasksDelegator {
}
+ public boolean isScaledUp() {
+ return scaledUp;
+ }
+ public void setScaledUp(boolean scaledUp) {
+ this.scaledUp = scaledUp;
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/45b66181/products/autoscaler/modules/distribution/src/main/conf/scaling.drl
----------------------------------------------------------------------
diff --git a/products/autoscaler/modules/distribution/src/main/conf/scaling.drl b/products/autoscaler/modules/distribution/src/main/conf/scaling.drl
index 4656b8a..034afca 100644
--- a/products/autoscaler/modules/distribution/src/main/conf/scaling.drl
+++ b/products/autoscaler/modules/distribution/src/main/conf/scaling.drl
@@ -106,7 +106,7 @@ dialect "mvel"
partition : Partition() from autoscaleAlgorithm.getNextScaleUpPartition($networkPartitionContext, clusterId)
eval(log.debug("[scale-up] " + " Partition available: " + (partition != null)))
eval(partition != null)
-
+ eval($delegator.setScaledUp(true))
then
log.debug("[scale-up] " + " [partition] " + partition.getId() + " [cluster] " + clusterId + " Scaling up cluster");
$delegator.delegateSpawn($networkPartitionContext.getPartitionCtxt(partition.getId()), clusterId, lbRef);
@@ -116,6 +116,10 @@ end
rule "Scaler-down Rule"
dialect "mvel"
when
+
+ eval(!$delegator.isScaledUp())
+ eval(log.debug("[scale-down] " + " [cluster] " + clusterId + " Running scale down rule since not scaled up... "))
+
$networkPartitionContext : NetworkPartitionContext ()
$loadThresholds : LoadThresholds() from autoscalePolicy.getLoadThresholds()
[2/2] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-stratos
Posted by la...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/1f1230cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/1f1230cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/1f1230cb
Branch: refs/heads/master
Commit: 1f1230cb23a5fc5862a099ecb79bed1dfa5f4550
Parents: 45b6618 a0d6ce5
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Fri Jan 10 22:29:36 2014 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Fri Jan 10 22:29:36 2014 +0530
----------------------------------------------------------------------
.../apache/stratos/autoscaler/Constants.java | 2 +-
.../cloud/controller/CloudControllerClient.java | 2 +-
.../controller/InstanceNotificationClient.java | 6 ++--
.../controllers/cartridgeDefintionSubmit.jag | 8 ++++++
.../theme1/partials/cartridge_deployments.hbs | 21 ++++++++------
.../console/util/utility.jag | 4 +++
.../SubscriptionMultiTenantBehaviour.java | 29 +++++++++++++++++---
7 files changed, 54 insertions(+), 18 deletions(-)
----------------------------------------------------------------------