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/07/23 14:18:44 UTC

[02/18] stratos git commit: Metering Service Implementation

http://git-wip-us.apache.org/repos/asf/stratos/blob/2fd289b8/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java
index 1275f5c..2a7e5d8 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java
@@ -18,197 +18,211 @@
  */
 package org.apache.stratos.common.constants;
 
-
 public class StratosConstants {
 
-    public static final String CLOUD_SERVICE_IS_ACTIVE_PROP_KEY = "active";
-
-    public static final String CLOUD_SERVICE_INFO_STORE_PATH =
-            "/repository/components/org.apache.stratos/cloud-manager/cloud-services";
-
-    public static final String TENANT_USER_VALIDATION_STORE_PATH =
-            "/repository/components/org.wso2.carbon.validations";
-    public static final String ADMIN_EMAIL_VERIFICATION_FLAG_PATH =
-            "/repository/components/org.wso2.carbon.email-confirmation-flag";
-    public static final String TENANT_DOMAIN_VERIFICATION_FLAG_PATH =
-            "/repository/components/org.wso2.carbon.domain-confirmation-flag";
-
-    public static final String DOMAIN_VALIDATOR_INFO_PATH =
-            "/repository/components/org.wso2.carbon.domain-validator-info";
-
-    public static final String TENANT_CREATION_THEME_PAGE_TOKEN =
-            "/repository/components/org.wso2.carbon.theme-page-token";
-
-    public static final String TENANT_PACKAGE_INFO_PATH =
-            "/repository/components/org.wso2.carbon.package-info";
-
-    public static final String ALL_THEMES_PATH =
-            "/repository/components/org.wso2.carbon.all-themes";
-
-    public static final String THROTTLING_RULES_PATH =
-            "/repository/components/org.wso2.carbon.throttling-rules";
-
-    public static final String ORIGINATED_SERVICE_PATH =
-            "/repository/components/org.wso2.carbon.originated-service";
-
-    public static final String PATH_SEPARATOR = "/";
-
-    public static final String CLOUD_SERVICE_ICONS_STORE_PATH =
-            "/repository/components/org.wso2.carbon.cloud-manager/" +
-                    "cloud-services-icons";
-
-    public static final String VALIDATION_KEY_RESOURCE_NAME = "validation-key";
-    public static final String INCOMING_PATH_DIR = "incoming";
-    public static final String OUTGOING_PATH_DIR = "outgoing";
-    public static final String MULTITENANCY_SCHEDULED_TASK_ID = "multitenancyScheduledTask";
-    public static final String MULTITENANCY_VIEWING_TASK_ID = "multitenancyViewingTask";
-
-    public static final String INVALID_TENANT = "invalidTenant";
-    public static final String INACTIVE_TENANT = "inactiveTenant";
-    public static final String ACTIVE_TENANT = "activeTenant";
-    public static final String IS_EMAIL_VALIDATED = "isEmailValidated";
-    public static final String IS_CREDENTIALS_ALREADY_RESET = "isCredentialsReset";
-    public static final String TENANT_ADMIN = "tenantAdminUsername";
-
-    public static final String CLOUD_MANAGER_SERVICE = "Apache Stratos Controller";
-    public static final String CLOUD_IDENTITY_SERVICE = "WSO2 Stratos Identity";
-    public static final String CLOUD_GOVERNANCE_SERVICE = "WSO2 Stratos Governance";
-    public static final String CLOUD_ESB_SERVICE = "WSO2 Stratos Enterprise Service Bus";
-
-    // keystore mgt related Constants
-    public static final String TENANT_KS = "/repository/security/key-stores/";
-    public static final String TENANT_PUB_KEY = "/repository/security/pub-key";
-    public static final String PROP_TENANT_KS_TYPE = "key-store-type";
-    public static final String PROP_TENANT_KS_PASSWD = "key-store-password";
-    public static final String PROP_TENANT_KS_PRIV_KEY_PASSWD = "priv-key-password";
-    public static final String PROP_TENANT_KS_ALIAS = "alias";
-
-    // constants related to redirection
-
-    public static final String UNVERIFIED_ACCOUNT_DOMAIN_SUFFIX = "-unverified";
-    public static final String TENANT_SPECIFIC_URL_RESOLVED = "tenant-sepcific-url-resolved";
-    public static final String SUFFIXED_UNVERIFIED_SESSION_FLAG = "temp-suffixed-unverified";
-
-    // metering constants
-    public static final String THROTTLING_ALL_ACTION = "all_actions";
-    public static final String THROTTLING_IN_DATA_ACTION = "in_data_action"; //this covers registry capacity + registry bandwidth
-    public static final String THROTTLING_OUT_DATA_ACTION = "out_data_action"; //this covers registry bandwidth
-    public static final String THROTTLING_ADD_USER_ACTION = "add_user_action";
-    public static final String THROTTLING_SERVICE_IN_BANDWIDTH_ACTION = "service_in_bandwith_action";
-    public static final String THROTTLING_SERVICE_OUT_BANDWIDTH_ACTION = "service_out_bandwith_action";
-    public static final String THROTTLING_WEBAPP_IN_BANDWIDTH_ACTION = "webapp_in_bandwith_action";
-    public static final String THROTTLING_WEBAPP_OUT_BANDWIDTH_ACTION = "webapp_out_bandwith_action";
-    public static final String THROTTLING_SERVICE_REQUEST_ACTION = "service_request_action";
-    public static final String THROTTLING_SERVICE_RESPONSE_ACTION = "service_response_action";
-
-    // the session attribute to keep track whether the registry action validated
-    // and the usage persisted
-    public static final String REGISTRY_ACTION_VALIDATED_SESSION_ATTR = "registryActionValidated";
-    public static final String REGISTRY_USAGE_PERSISTED_SESSION_ATTR = "usagePersited";
-
-    // Metering servlet attributes
-    public static final String SERVICE_NAME_SERVLET_ATTR = "meteringServiceName";
-    public static final String TENANT_ID_SERVLET_ATTR = "tenantId";
-    public static final String ADMIN_SERVICE_SERVLET_ATTR = "adminService";
-
-    // * as a Service impl related constants
-    public static final String ORIGINATED_SERVICE = "originatedService";
-
-    // Configuration file name
-    public static final String STRATOS_CONF_FILE = "stratos.xml";
-    //public static final String STRATOS_CONF_LOC = "repository/conf/";
-    //public static final String STRATOS_CONF_FILE_WITH_PATH = STRATOS_CONF_LOC + STRATOS_CONF_FILE;
-
-    // EULA location
-    public static final String STRATOS_EULA = "eula.xml";
-
-    // EULA default text.
-    public static final String STRATOS_EULA_DEFAULT_TEXT =
-            "Please refer to: " + StratosConstants.STRATOS_TERMS_OF_USAGE +
-                    " for terms and usage and " + StratosConstants.STRATOS_PRIVACY_POLICY +
-                    " for privacy policy of WSO2 Stratos.";
-
-    // Web location of Terms of Usage and privacy policy
-    public static final String STRATOS_TERMS_OF_USAGE =
-            "http://wso2.com/cloud/services/terms-of-use/";
-    public static final String STRATOS_PRIVACY_POLICY =
-            "http://wso2.com/cloud/services/privacy-policy/";
-    public static final String MULTITENANCY_FREE_PLAN = "Demo";
-    public static final String MULTITENANCY_SMALL_PLAN = "SMB";
-    public static final String MULTITENANCY_MEDIUM_PLAN = "Professional";
-    public static final String MULTITENANCY_LARGE_PLAN = "Enterprise";
-    public static final String EMAIL_CONFIG = "email";
-    public static final String MULTITENANCY_CONFIG_FOLDER = "multitenancy";
-
-    // Cloud controller - payload
-    public static final String MEMBER_ID = "MEMBER_ID";
-    public static final String LB_CLUSTER_ID = "LB_CLUSTER_ID";
-    public static final String NETWORK_PARTITION_ID = "NETWORK_PARTITION_ID";
-
-    // Kubernetes related constants
-    public static final String KUBERNETES_CLUSTER_ID = "KUBERNETES_CLUSTER_ID";
-    public static final String KUBERNETES_MASTER_PORT = "KUBERNETES_MASTER_PORT";
-    public static final String KUBERNETES_MASTER_DEFAULT_PORT = "8080";
-
-    //drools related constants
-    public static final String DROOLS_DIR_NAME = "drools";
-    public static final String SCALE_CHECK_DROOL_FILE = "scaling.drl";
-    public static final String DEPENDENT_SCALE_CHECK_DROOL_FILE = "dependent-scaling.drl";
-    public static final String MIN_CHECK_DROOL_FILE = "mincheck.drl";
-    public static final String MAX_CHECK_DROOL_FILE = "maxcheck.drl";
-    public static final String OBSOLETE_CHECK_DROOL_FILE = "obsoletecheck.drl";
-    public static final String MIN_COUNT = "MIN_COUNT";
-
-    // Policy and definition related constants
-    public static final int PUBLIC_DEFINITION = 0;
-
-    // member expiry timeout constants
-    public static final String PENDING_MEMBER_EXPIRY_TIMEOUT = "autoscaler.member.pendingMemberExpiryTimeout";
-    public static final String OBSOLETED_MEMBER_EXPIRY_TIMEOUT = "autoscaler.member.obsoletedMemberExpiryTimeout";
-    public static final String PENDING_TERMINATION_MEMBER_EXPIRY_TIMEOUT = "autoscaler.member.pendingTerminationMemberExpiryTimeout";
-
-    public static final String FILTER_VALUE_SEPARATOR = ",";
-    public static final String TOPOLOGY_APPLICATION_FILTER = "stratos.topology.application.filter";
-    public static final String TOPOLOGY_SERVICE_FILTER = "stratos.topology.service.filter";
-    public static final String TOPOLOGY_CLUSTER_FILTER = "stratos.topology.cluster.filter";
-    public static final String TOPOLOGY_MEMBER_FILTER = "stratos.topology.member.filter";
-    public static final String TOPOLOGY_NETWORK_PARTITION_FILTER = "stratos.topology.network.partition.filter";
-
-    // to identify a lb cluster
-    public static final String LOAD_BALANCER_REF = "load.balancer.ref";
-    public static final String SERVICE_AWARE_LOAD_BALANCER = "service.aware.load.balancer";
-    public static final String DEFAULT_LOAD_BALANCER = "default.load.balancer";
-    public static final String NO_LOAD_BALANCER = "no.load.balancer";
-    public static final String EXISTING_LOAD_BALANCERS = "existing.load.balancers";
-
-    public static final long HAZELCAST_INSTANCE_INIT_TIMEOUT = 300000; // 5 min
-
-    public static final String AUTOSCALER_SERVICE_URL = "autoscaler.service.url";
-    public static final String CLOUD_CONTROLLER_SERVICE_URL = "cloud.controller.service.url";
-    public static final String STRATOS_MANAGER_SERVICE_URL = "stratos.manager.service.url";
-
-    public static final String CLOUD_CONTROLLER_CLIENT_SOCKET_TIMEOUT = "cc.socket.timeout";
-    public static final String CLOUD_CONTROLLER_CLIENT_CONNECTION_TIMEOUT = "cc.connection.timeout";
-    public static final String AUTOSCALER_CLIENT_SOCKET_TIMEOUT = "autoscaler.socket.timeout";
-    public static final String AUTOSCALER_CLIENT_CONNECTION_TIMEOUT = "autoscaler.connection.timeout";
-    public static final String STRATOS_MANAGER_CLIENT_SOCKET_TIMEOUT = "stratos.manager.socket.timeout";
-    public static final String STRATOS_MANAGER_CLIENT_CONNECTION_TIMEOUT = "stratos.manager.connection.timeout";
-
-    public static final String DEFAULT_CLIENT_SOCKET_TIMEOUT = "300000";
-    public static final String DEFAULT_CLIENT_CONNECTION_TIMEOUT = "300000";
-
-    // partition algorithm id constants
-    public static final String PARTITION_ROUND_ROBIN_ALGORITHM_ID = "round-robin";
-    public static final String PARTITION_WEIGHTED_ROUND_ROBIN_ALGORITHM_ID = "weighted-round-robin";
-    public static final String PARTITION_ONE_AFTER_ANOTHER_ALGORITHM_ID = "one-after-another";
-    // network partition algorithm id constants
-    public static final String NETWORK_PARTITION_ONE_AFTER_ANOTHER_ALGORITHM_ID = "one-after-another";
-    public static final String NETWORK_PARTITION_ALL_AT_ONCE_ALGORITHM_ID = "all-at-once";
-    public static final String APPLICATION_POLICY_NETWORK_PARTITION_GROUPS = "networkPartitionGroups";
-    public static final String APPLICATION_POLICY_NETWORK_PARTITIONS_SPLITTER = "\\|";
-    public static final String APPLICATION_POLICY_NETWORK_PARTITION_GROUPS_SPLITTER = ",";
-
-    public static final String NOT_DEFINED = "not-defined";
-    public static final String CLUSTER_INSTANCE_ID = "cluster.instance.id";
+	public static final String CLOUD_SERVICE_IS_ACTIVE_PROP_KEY = "active";
+
+	public static final String CLOUD_SERVICE_INFO_STORE_PATH =
+			"/repository/components/org.apache.stratos/cloud-manager/cloud-services";
+
+	public static final String TENANT_USER_VALIDATION_STORE_PATH =
+			"/repository/components/org.wso2.carbon.validations";
+	public static final String ADMIN_EMAIL_VERIFICATION_FLAG_PATH =
+			"/repository/components/org.wso2.carbon.email-confirmation-flag";
+	public static final String TENANT_DOMAIN_VERIFICATION_FLAG_PATH =
+			"/repository/components/org.wso2.carbon.domain-confirmation-flag";
+
+	public static final String DOMAIN_VALIDATOR_INFO_PATH =
+			"/repository/components/org.wso2.carbon.domain-validator-info";
+
+	public static final String TENANT_CREATION_THEME_PAGE_TOKEN =
+			"/repository/components/org.wso2.carbon.theme-page-token";
+
+	public static final String TENANT_PACKAGE_INFO_PATH =
+			"/repository/components/org.wso2.carbon.package-info";
+
+	public static final String ALL_THEMES_PATH =
+			"/repository/components/org.wso2.carbon.all-themes";
+
+	public static final String THROTTLING_RULES_PATH =
+			"/repository/components/org.wso2.carbon.throttling-rules";
+
+	public static final String ORIGINATED_SERVICE_PATH =
+			"/repository/components/org.wso2.carbon.originated-service";
+
+	public static final String PATH_SEPARATOR = "/";
+
+	public static final String CLOUD_SERVICE_ICONS_STORE_PATH =
+			"/repository/components/org.wso2.carbon.cloud-manager/" + "cloud-services-icons";
+
+	public static final String VALIDATION_KEY_RESOURCE_NAME = "validation-key";
+	public static final String INCOMING_PATH_DIR = "incoming";
+	public static final String OUTGOING_PATH_DIR = "outgoing";
+	public static final String MULTITENANCY_SCHEDULED_TASK_ID = "multitenancyScheduledTask";
+	public static final String MULTITENANCY_VIEWING_TASK_ID = "multitenancyViewingTask";
+
+	public static final String INVALID_TENANT = "invalidTenant";
+	public static final String INACTIVE_TENANT = "inactiveTenant";
+	public static final String ACTIVE_TENANT = "activeTenant";
+	public static final String IS_EMAIL_VALIDATED = "isEmailValidated";
+	public static final String IS_CREDENTIALS_ALREADY_RESET = "isCredentialsReset";
+	public static final String TENANT_ADMIN = "tenantAdminUsername";
+
+	public static final String CLOUD_MANAGER_SERVICE = "Apache Stratos Controller";
+	public static final String CLOUD_IDENTITY_SERVICE = "WSO2 Stratos Identity";
+	public static final String CLOUD_GOVERNANCE_SERVICE = "WSO2 Stratos Governance";
+	public static final String CLOUD_ESB_SERVICE = "WSO2 Stratos Enterprise Service Bus";
+
+	// keystore mgt related Constants
+	public static final String TENANT_KS = "/repository/security/key-stores/";
+	public static final String TENANT_PUB_KEY = "/repository/security/pub-key";
+	public static final String PROP_TENANT_KS_TYPE = "key-store-type";
+	public static final String PROP_TENANT_KS_PASSWD = "key-store-password";
+	public static final String PROP_TENANT_KS_PRIV_KEY_PASSWD = "priv-key-password";
+	public static final String PROP_TENANT_KS_ALIAS = "alias";
+
+	// constants related to redirection
+
+	public static final String UNVERIFIED_ACCOUNT_DOMAIN_SUFFIX = "-unverified";
+	public static final String TENANT_SPECIFIC_URL_RESOLVED = "tenant-sepcific-url-resolved";
+	public static final String SUFFIXED_UNVERIFIED_SESSION_FLAG = "temp-suffixed-unverified";
+
+	// metering constants
+	public static final String THROTTLING_ALL_ACTION = "all_actions";
+	public static final String THROTTLING_IN_DATA_ACTION = "in_data_action";
+			//this covers registry capacity + registry bandwidth
+	public static final String THROTTLING_OUT_DATA_ACTION = "out_data_action";
+			//this covers registry bandwidth
+	public static final String THROTTLING_ADD_USER_ACTION = "add_user_action";
+	public static final String THROTTLING_SERVICE_IN_BANDWIDTH_ACTION =
+			"service_in_bandwith_action";
+	public static final String THROTTLING_SERVICE_OUT_BANDWIDTH_ACTION =
+			"service_out_bandwith_action";
+	public static final String THROTTLING_WEBAPP_IN_BANDWIDTH_ACTION = "webapp_in_bandwith_action";
+	public static final String THROTTLING_WEBAPP_OUT_BANDWIDTH_ACTION =
+			"webapp_out_bandwith_action";
+	public static final String THROTTLING_SERVICE_REQUEST_ACTION = "service_request_action";
+	public static final String THROTTLING_SERVICE_RESPONSE_ACTION = "service_response_action";
+
+	// the session attribute to keep track whether the registry action validated
+	// and the usage persisted
+	public static final String REGISTRY_ACTION_VALIDATED_SESSION_ATTR = "registryActionValidated";
+	public static final String REGISTRY_USAGE_PERSISTED_SESSION_ATTR = "usagePersited";
+
+	// Metering servlet attributes
+	public static final String SERVICE_NAME_SERVLET_ATTR = "meteringServiceName";
+	public static final String TENANT_ID_SERVLET_ATTR = "tenantId";
+	public static final String ADMIN_SERVICE_SERVLET_ATTR = "adminService";
+
+	// * as a Service impl related constants
+	public static final String ORIGINATED_SERVICE = "originatedService";
+
+	// Configuration file name
+	public static final String STRATOS_CONF_FILE = "stratos.xml";
+	//public static final String STRATOS_CONF_LOC = "repository/conf/";
+	//public static final String STRATOS_CONF_FILE_WITH_PATH = STRATOS_CONF_LOC + STRATOS_CONF_FILE;
+
+	// EULA location
+	public static final String STRATOS_EULA = "eula.xml";
+
+	// EULA default text.
+	public static final String STRATOS_EULA_DEFAULT_TEXT =
+			"Please refer to: " + StratosConstants.STRATOS_TERMS_OF_USAGE +
+			" for terms and usage and " + StratosConstants.STRATOS_PRIVACY_POLICY +
+			" for privacy policy of WSO2 Stratos.";
+
+	// Web location of Terms of Usage and privacy policy
+	public static final String STRATOS_TERMS_OF_USAGE =
+			"http://wso2.com/cloud/services/terms-of-use/";
+	public static final String STRATOS_PRIVACY_POLICY =
+			"http://wso2.com/cloud/services/privacy-policy/";
+	public static final String MULTITENANCY_FREE_PLAN = "Demo";
+	public static final String MULTITENANCY_SMALL_PLAN = "SMB";
+	public static final String MULTITENANCY_MEDIUM_PLAN = "Professional";
+	public static final String MULTITENANCY_LARGE_PLAN = "Enterprise";
+	public static final String EMAIL_CONFIG = "email";
+	public static final String MULTITENANCY_CONFIG_FOLDER = "multitenancy";
+
+	// Cloud controller - payload
+	public static final String MEMBER_ID = "MEMBER_ID";
+	public static final String LB_CLUSTER_ID = "LB_CLUSTER_ID";
+	public static final String NETWORK_PARTITION_ID = "NETWORK_PARTITION_ID";
+
+	// Kubernetes related constants
+	public static final String KUBERNETES_CLUSTER_ID = "KUBERNETES_CLUSTER_ID";
+	public static final String KUBERNETES_MASTER_PORT = "KUBERNETES_MASTER_PORT";
+	public static final String KUBERNETES_MASTER_DEFAULT_PORT = "8080";
+
+	//drools related constants
+	public static final String DROOLS_DIR_NAME = "drools";
+	public static final String SCALE_CHECK_DROOL_FILE = "scaling.drl";
+	public static final String DEPENDENT_SCALE_CHECK_DROOL_FILE = "dependent-scaling.drl";
+	public static final String MIN_CHECK_DROOL_FILE = "mincheck.drl";
+	public static final String MAX_CHECK_DROOL_FILE = "maxcheck.drl";
+	public static final String OBSOLETE_CHECK_DROOL_FILE = "obsoletecheck.drl";
+	public static final String MIN_COUNT = "MIN_COUNT";
+	public static final String SCALING_REASON = "SCALING_REASON";
+	public static final String SCALING_TIME = "SCALING_TIME";
+
+	// Policy and definition related constants
+	public static final int PUBLIC_DEFINITION = 0;
+
+	// member expiry timeout constants
+	public static final String PENDING_MEMBER_EXPIRY_TIMEOUT =
+			"autoscaler.member.pendingMemberExpiryTimeout";
+	public static final String OBSOLETED_MEMBER_EXPIRY_TIMEOUT =
+			"autoscaler.member.obsoletedMemberExpiryTimeout";
+	public static final String PENDING_TERMINATION_MEMBER_EXPIRY_TIMEOUT =
+			"autoscaler.member.pendingTerminationMemberExpiryTimeout";
+
+	public static final String FILTER_VALUE_SEPARATOR = ",";
+	public static final String TOPOLOGY_APPLICATION_FILTER = "stratos.topology.application.filter";
+	public static final String TOPOLOGY_SERVICE_FILTER = "stratos.topology.service.filter";
+	public static final String TOPOLOGY_CLUSTER_FILTER = "stratos.topology.cluster.filter";
+	public static final String TOPOLOGY_MEMBER_FILTER = "stratos.topology.member.filter";
+	public static final String TOPOLOGY_NETWORK_PARTITION_FILTER =
+			"stratos.topology.network.partition.filter";
+
+	// to identify a lb cluster
+	public static final String LOAD_BALANCER_REF = "load.balancer.ref";
+	public static final String SERVICE_AWARE_LOAD_BALANCER = "service.aware.load.balancer";
+	public static final String DEFAULT_LOAD_BALANCER = "default.load.balancer";
+	public static final String NO_LOAD_BALANCER = "no.load.balancer";
+	public static final String EXISTING_LOAD_BALANCERS = "existing.load.balancers";
+
+	public static final long HAZELCAST_INSTANCE_INIT_TIMEOUT = 300000; // 5 min
+
+	public static final String AUTOSCALER_SERVICE_URL = "autoscaler.service.url";
+	public static final String CLOUD_CONTROLLER_SERVICE_URL = "cloud.controller.service.url";
+	public static final String STRATOS_MANAGER_SERVICE_URL = "stratos.manager.service.url";
+
+	public static final String CLOUD_CONTROLLER_CLIENT_SOCKET_TIMEOUT = "cc.socket.timeout";
+	public static final String CLOUD_CONTROLLER_CLIENT_CONNECTION_TIMEOUT = "cc.connection.timeout";
+	public static final String AUTOSCALER_CLIENT_SOCKET_TIMEOUT = "autoscaler.socket.timeout";
+	public static final String AUTOSCALER_CLIENT_CONNECTION_TIMEOUT =
+			"autoscaler.connection.timeout";
+	public static final String STRATOS_MANAGER_CLIENT_SOCKET_TIMEOUT =
+			"stratos.manager.socket.timeout";
+	public static final String STRATOS_MANAGER_CLIENT_CONNECTION_TIMEOUT =
+			"stratos.manager.connection.timeout";
+
+	public static final String DEFAULT_CLIENT_SOCKET_TIMEOUT = "300000";
+	public static final String DEFAULT_CLIENT_CONNECTION_TIMEOUT = "300000";
+
+	// partition algorithm id constants
+	public static final String PARTITION_ROUND_ROBIN_ALGORITHM_ID = "round-robin";
+	public static final String PARTITION_WEIGHTED_ROUND_ROBIN_ALGORITHM_ID = "weighted-round-robin";
+	public static final String PARTITION_ONE_AFTER_ANOTHER_ALGORITHM_ID = "one-after-another";
+	// network partition algorithm id constants
+	public static final String NETWORK_PARTITION_ONE_AFTER_ANOTHER_ALGORITHM_ID =
+			"one-after-another";
+	public static final String NETWORK_PARTITION_ALL_AT_ONCE_ALGORITHM_ID = "all-at-once";
+	public static final String APPLICATION_POLICY_NETWORK_PARTITION_GROUPS =
+			"networkPartitionGroups";
+	public static final String APPLICATION_POLICY_NETWORK_PARTITIONS_SPLITTER = "\\|";
+	public static final String APPLICATION_POLICY_NETWORK_PARTITION_GROUPS_SPLITTER = ",";
+
+	public static final String NOT_DEFINED = "not-defined";
+	public static final String CLUSTER_INSTANCE_ID = "cluster.instance.id";
 }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/2fd289b8/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/healthstatspublisher/healthstats.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/healthstatspublisher/healthstats.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/healthstatspublisher/healthstats.py
index 9753c3e..711fe43 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/healthstatspublisher/healthstats.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/healthstatspublisher/healthstats.py
@@ -17,7 +17,7 @@
 
 from threading import Thread
 import multiprocessing
-
+import time
 import psutil
 
 from abstracthealthstatisticspublisher import *
@@ -124,6 +124,8 @@ class HealthStatisticsPublisher:
         stream_def.description = HealthStatisticsPublisherManager.STREAM_DESCRIPTION
 
         # stream_def.add_payloaddata_attribute()
+
+        #stream_def.add_payloaddata_attribute("time_stamp", StreamDefinition.LONG)
         stream_def.add_payloaddata_attribute("cluster_id", StreamDefinition.STRING)
         stream_def.add_payloaddata_attribute("cluster_instance_id", StreamDefinition.STRING)
         stream_def.add_payloaddata_attribute("network_partition_id", StreamDefinition.STRING)
@@ -141,6 +143,7 @@ class HealthStatisticsPublisher:
         """
 
         event = ThriftEvent()
+        #event.payloadData.append(int(round(time.time() * 1000)))
         event.payloadData.append(self.cartridge_agent_config.cluster_id)
         event.payloadData.append(self.cartridge_agent_config.cluster_instance_id)
         event.payloadData.append(self.cartridge_agent_config.network_partition_id)
@@ -159,6 +162,7 @@ class HealthStatisticsPublisher:
         """
 
         event = ThriftEvent()
+        #Sevent.payloadData.append(int(round(time.time() * 1000)))
         event.payloadData.append(self.cartridge_agent_config.cluster_id)
         event.payloadData.append(self.cartridge_agent_config.cluster_instance_id)
         event.payloadData.append(self.cartridge_agent_config.network_partition_id)

http://git-wip-us.apache.org/repos/asf/stratos/blob/2fd289b8/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 4c4c7e0..39fc4f3 100644
--- a/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml
+++ b/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml
@@ -23,287 +23,289 @@
 <streamManagerConfiguration xmlns="http://wso2.org/carbon/streammanager">
     <!-- in-flight requests stream definitions start -->
     <streamDefinition name="in_flight_requests" version="1.0.0">
-         <description>in-flight request count</description>
-         <nickName>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="in_flight_request_count" type="double"/>
-         </payloadData>
-     </streamDefinition> 
+        <description>in-flight request count</description>
+        <nickName>in-flight requests</nickName>
+        <metaData>
+        </metaData>
+        <correlationData>
+        </correlationData>
+        <payloadData>
+           <!-- <property name="time_stamp" type="long"/>-->
+            <property name="cluster_id" type="String"/>
+            <property name="cluster_instance_id" type="String"/>
+            <property name="network_partition_id" type="String"/>
+            <property name="in_flight_request_count" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="gradient_in_flight_requests" version="1.0.0">
-         <description>gradient of in flight request count</description>
-         <nickName>gradient 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="count" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>gradient of in flight request count</description>
+        <nickName>gradient 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="count" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="average_in_flight_requests" version="1.0.0">
-         <description>average of in-flight request count</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="count" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>average of in-flight request count</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="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>
-         <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="count" type="double"/>
-         </payloadData>
+        <description>second derivative of in-flight request count</description>
+        <nickName>second derivative 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="count" type="double"/>
+        </payloadData>
     </streamDefinition>
     <!-- in-flight requests stream definitions end -->
 
     <!-- cartridge agent health stats stream definitions start -->
     <streamDefinition name="cartridge_agent_health_stats" version="1.0.0">
-         <description>agent health stats</description>
-         <nickName>agent health stats</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="member_id" type="String" />
-             <property name="partition_id" type="String" />
-             <property name="health_description" type="String"/>
-             <property name="value" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>agent health stats</description>
+        <nickName>agent health stats</nickName>
+        <metaData>
+        </metaData>
+        <correlationData>
+        </correlationData>
+        <payloadData>
+            <!--<property name="time_stamp" type="long"/>-->
+            <property name="cluster_id" type="String" />
+            <property name="cluster_instance_id" type="String"/>
+            <property name="network_partition_id" type="String"/>
+            <property name="member_id" type="String" />
+            <property name="partition_id" type="String" />
+            <property name="health_description" type="String"/>
+            <property name="value" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="average_load_average_stats" version="1.0.0">
-         <description>average load average stats</description>
-         <nickName>average load average stats</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_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>average load average stats</description>
+        <nickName>average load average stats</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_load_average" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="average_memory_consumption_stats" version="1.0.0">
-         <description>average memory consumption stats</description>
-         <nickName>average memory consumption stats</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_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>average memory consumption stats</description>
+        <nickName>average memory consumption stats</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_memory_consumption" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="gradient_load_average_stats" version="1.0.0">
-         <description>gradient load average stats</description>
-         <nickName>gradient load average stats</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="gradient_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>gradient load average stats</description>
+        <nickName>gradient load average stats</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="gradient_load_average" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="gradient_memory_consumption_stats" version="1.0.0">
-         <description>gradient memoryconsumption stats</description>
-         <nickName>gradient memoryconsumption stats</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="gradient_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>gradient memoryconsumption stats</description>
+        <nickName>gradient memoryconsumption stats</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="gradient_memory_consumption" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="second_derivative_memory_consumption_stats" version="1.0.0">
-         <description>second derivative memory consumption stats</description>
-         <nickName>second derivative memory consumption stats</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="second_derivative_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>second derivative memory consumption stats</description>
+        <nickName>second derivative memory consumption stats</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="second_derivative_memory_consumption" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="second_derivative_load_average_stats" version="1.0.0">
-         <description>second derivative load average stats</description>
-         <nickName>second derivative load average stats</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="second_derivative_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>second derivative load average stats</description>
+        <nickName>second derivative load average stats</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="second_derivative_load_average" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="fault_message" version="1.0.0">
-         <description>fault message</description>
-         <nickName>fault message</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="member_id" type="String"/>
-             <property name="partition_id" type="String"/>
-         </payloadData>
+        <description>fault message</description>
+        <nickName>fault message</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="member_id" type="String"/>
+            <property name="partition_id" type="String"/>
+        </payloadData>
     </streamDefinition>
     <!-- cartridge agent health stats stream definitions end -->
 
     <!-- This is for member_id wise grouping-->
     <streamDefinition name="member_average_load_average_stats" version="1.0.0">
-         <description>average load average stats</description>
-         <nickName>average load average stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String" />
-             <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_average_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>average load average stats</description>
+        <nickName>average load average stats</nickName>
+        <metaData>
+        </metaData>
+        <correlationData>
+        </correlationData>
+        <payloadData>
+            <property name="member_id" type="String" />
+            <property name="cluster_id" type="String" />
+            <property name="cluster_instance_id" type="String"/>
+            <property name="network_partition_id" type="String"/>
+            <property name="member_average_load_average" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="member_average_memory_consumption_stats" version="1.0.0">
-         <description>average memory consumption stats</description>
-         <nickName>average memory consumption stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String"/>
-             <property name="cluster_id" type="String"/>
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_average_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>average memory consumption stats</description>
+        <nickName>average memory consumption stats</nickName>
+        <metaData>
+        </metaData>
+        <correlationData>
+        </correlationData>
+        <payloadData>
+            <property name="member_id" type="String"/>
+            <property name="cluster_id" type="String"/>
+            <property name="cluster_instance_id" type="String"/>
+            <property name="network_partition_id" type="String"/>
+            <property name="member_average_memory_consumption" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="member_gradient_load_average_stats" version="1.0.0">
-         <description>gradient load average stats</description>
-         <nickName>gradient load average stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String" />
-             <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_gradient_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>gradient load average stats</description>
+        <nickName>gradient load average stats</nickName>
+        <metaData>
+        </metaData>
+        <correlationData>
+        </correlationData>
+        <payloadData>
+            <property name="member_id" type="String" />
+            <property name="cluster_id" type="String" />
+            <property name="cluster_instance_id" type="String"/>
+            <property name="network_partition_id" type="String"/>
+            <property name="member_gradient_load_average" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="member_gradient_memory_consumption_stats" version="1.0.0">
-         <description>gradient memoryconsumption stats</description>
-         <nickName>gradient memoryconsumption stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String" />
-             <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_gradient_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>gradient memoryconsumption stats</description>
+        <nickName>gradient memoryconsumption stats</nickName>
+        <metaData>
+        </metaData>
+        <correlationData>
+        </correlationData>
+        <payloadData>
+            <property name="member_id" type="String" />
+            <property name="cluster_id" type="String" />
+            <property name="cluster_instance_id" type="String"/>
+            <property name="network_partition_id" type="String"/>
+            <property name="member_gradient_memory_consumption" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="member_second_derivative_memory_consumption_stats" version="1.0.0">
-         <description>second derivative memory consumption stats</description>
-         <nickName>second derivative memory consumption stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String" />
-             <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_second_derivative_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>second derivative memory consumption stats</description>
+        <nickName>second derivative memory consumption stats</nickName>
+        <metaData>
+        </metaData>
+        <correlationData>
+        </correlationData>
+        <payloadData>
+            <property name="member_id" type="String" />
+            <property name="cluster_id" type="String" />
+            <property name="cluster_instance_id" type="String"/>
+            <property name="network_partition_id" type="String"/>
+            <property name="member_second_derivative_memory_consumption" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
     <streamDefinition name="member_second_derivative_load_average_stats" version="1.0.0">
-         <description>second derivative load average stats</description>
-         <nickName>second derivative load average stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String" />
-             <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_second_derivative_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
+        <description>second derivative load average stats</description>
+        <nickName>second derivative load average stats</nickName>
+        <metaData>
+        </metaData>
+        <correlationData>
+        </correlationData>
+        <payloadData>
+            <property name="member_id" type="String" />
+            <property name="cluster_id" type="String" />
+            <property name="cluster_instance_id" type="String"/>
+            <property name="network_partition_id" type="String"/>
+            <property name="member_second_derivative_load_average" type="double"/>
+        </payloadData>
+    </streamDefinition>
 
 </streamManagerConfiguration>

http://git-wip-us.apache.org/repos/asf/stratos/blob/2fd289b8/products/stratos/modules/distribution/src/main/conf/drools/dependent-scaling.drl
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/drools/dependent-scaling.drl b/products/stratos/modules/distribution/src/main/conf/drools/dependent-scaling.drl
index 56e9164..3d373bb 100644
--- a/products/stratos/modules/distribution/src/main/conf/drools/dependent-scaling.drl
+++ b/products/stratos/modules/distribution/src/main/conf/drools/dependent-scaling.drl
@@ -84,7 +84,9 @@ dialect "mvel"
 
                         log.info("[dependency-scale] [scale-up] Partition available, hence trying to spawn an instance to scale up!" );
                         log.debug("[dependency-scale] [scale-up] " + " [partition] " + partitionContext.getPartitionId() + " [cluster] " + clusterId );
-                        delegator.delegateSpawn(partitionContext, clusterId, clusterInstanceContext.getId(), isPrimary);
+                        long time = System.currentTimeMillis();
+                        String scalingReason = "Dependency scaling";
+                        delegator.delegateSpawn(partitionContext, clusterId, clusterInstanceContext.getId(), isPrimary,scalingReason,time);
                         count++;
                     } else {
                         partitionsAvailable = false;

http://git-wip-us.apache.org/repos/asf/stratos/blob/2fd289b8/products/stratos/modules/distribution/src/main/conf/drools/mincheck.drl
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/drools/mincheck.drl b/products/stratos/modules/distribution/src/main/conf/drools/mincheck.drl
index 96b60da..00a1850 100755
--- a/products/stratos/modules/distribution/src/main/conf/drools/mincheck.drl
+++ b/products/stratos/modules/distribution/src/main/conf/drools/mincheck.drl
@@ -84,7 +84,9 @@ dialect "mvel"
 
                 log.info("[min-check] Partition available, hence trying to spawn an instance to fulfil minimum count!" + " [cluster] " + clusterId);
                 log.debug("[min-check] " + " [partition] " + partitionContext.getPartitionId() + " [cluster] " + clusterId);
-                delegator.delegateSpawn(partitionContext, clusterId, clusterInstanceContext.getId(), isPrimary);
+                long time = System.currentTimeMillis();
+                String scalingReason = "Scaling up to fulfil minimum count";
+                delegator.delegateSpawn(partitionContext, clusterId, clusterInstanceContext.getId(), isPrimary,scalingReason,time);
 
                 count++;
             } else {

http://git-wip-us.apache.org/repos/asf/stratos/blob/2fd289b8/products/stratos/modules/distribution/src/main/conf/drools/scaling.drl
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/drools/scaling.drl b/products/stratos/modules/distribution/src/main/conf/drools/scaling.drl
index e6f8f67..167711f 100644
--- a/products/stratos/modules/distribution/src/main/conf/drools/scaling.drl
+++ b/products/stratos/modules/distribution/src/main/conf/drools/scaling.drl
@@ -69,7 +69,7 @@ dialect "mvel"
         eval(log.debug("[scaling] [network-partition] " + clusterInstanceContext.getNetworkPartitionId() + " [cluster] "
             + clusterId + " Algorithm name: " + algorithmName))
 
-	
+
         rifThreshold : Float() from  loadThresholds.getRequestsInFlightThreshold()
 
         rifAverage : Float() from  clusterInstanceContext.getAverageRequestsInFlight()
@@ -163,6 +163,7 @@ dialect "mvel"
 
                     boolean partitionsAvailable = true;
                     int count = 0;
+                    String autoscalingReason = (numberOfRequiredInstances == numberOfInstancesReuquiredBasedOnRif)?"Scaling up due to RIF":(numberOfRequiredInstances== numberOfInstancesReuquiredBasedOnMemoryConsumption)?"Scaling up due to MC":"Scaling up due to LA";
 
                     while(count != additionalInstances && partitionsAvailable){
 
@@ -182,7 +183,8 @@ dialect "mvel"
                                 " [laPredictedValue] " + laPredictedValue + " [laThreshold] " + laThreshold);
 
                             log.debug("[scale-up] " + " [partition] " + partitionContext.getPartitionId() + " [cluster] " + clusterId );
-                            delegator.delegateSpawn(partitionContext, clusterId, clusterInstanceContext.getId(), isPrimary);
+                            long scalingTime = System.currentTimeMillis();
+                            delegator.delegateSpawn(partitionContext, clusterId, clusterInstanceContext.getId(), isPrimary,autoscalingReason,scalingTime);
                             count++;
                         } else {
 
@@ -195,12 +197,9 @@ dialect "mvel"
                     }
                 }
             } else {
-                log.info("[scale-up] Trying to scale up over max, hence not scaling up cluster itself and
-                        notifying to parent for possible group scaling or app bursting.
-                        [cluster] " + clusterId + " [instance id]" + clusterInstanceContext.getId() +
+                log.info("[scale-up] Trying to scale up over max, hence not scaling up cluster itself and notifying to parent for possible group scaling or app bursting. [cluster] " + clusterId + " [instance id]" + clusterInstanceContext.getId() +
                         " [max] " + clusterMaxMembers);
-                delegator.delegateScalingOverMaxNotification(clusterId, clusterInstanceContext.getNetworkPartitionId(),
-                    clusterInstanceContext.getId());
+                delegator.delegateScalingOverMaxNotification(clusterId, clusterInstanceContext.getNetworkPartitionId(),clusterInstanceContext.getId());
             }
         } else if(scaleDown){