Repository: stratos Updated Branches: refs/heads/master 868e94caf -> 570d1bc67
Adding instance id for thrift publisher in cartridge agent Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/4616888d Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/4616888d Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/4616888d Branch: refs/heads/master Commit: 4616888daa3bda8ae37f1c999321eec7e0bb82c7 Parents: e20df6f Author: gayan <[email protected]> Authored: Tue Dec 2 19:18:49 2014 +0530 Committer: gayan <[email protected]> Committed: Tue Dec 2 19:18:49 2014 +0530 ---------------------------------------------------------------------- .../cartridgeagent/modules/config/cartridgeagentconfiguration.py | 3 +++ .../cartridgeagent/modules/healthstatspublisher/healthstats.py | 3 +++ .../cartridgeagent/modules/util/cartridgeagentconstants.py | 1 + 3 files changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/4616888d/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/config/cartridgeagentconfiguration.py ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/config/cartridgeagentconfiguration.py b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/config/cartridgeagentconfiguration.py index 496695d..dbdf92a 100644 --- a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/config/cartridgeagentconfiguration.py +++ b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/config/cartridgeagentconfiguration.py @@ -93,6 +93,8 @@ class CartridgeAgentConfiguration: """ :type : str """ self.is_primary = False """ :type : bool """ + self.instance_id = None + """ :type : str """ self.payload_params = {} self.__read_conf_file() @@ -123,6 +125,7 @@ class CartridgeAgentConfiguration: self.app_path = self.read_property(cartridgeagentconstants.APP_PATH, False) self.repo_url = self.read_property(cartridgeagentconstants.REPO_URL, False) self.ports = str(self.read_property(cartridgeagentconstants.PORTS)).split("|") + self.instance_id= self.read_property(cartridgeagentconstants.INSTANCE_ID) try: self.log_file_paths = str( http://git-wip-us.apache.org/repos/asf/stratos/blob/4616888d/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/healthstatspublisher/healthstats.py ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/healthstatspublisher/healthstats.py b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/healthstatspublisher/healthstats.py index 3bbb89b..f06da8b 100644 --- a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/healthstatspublisher/healthstats.py +++ b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/healthstatspublisher/healthstats.py @@ -123,6 +123,8 @@ class HealthStatisticsPublisher: stream_def.nickname = HealthStatisticsPublisherManager.STREAM_NICKNAME stream_def.description = HealthStatisticsPublisherManager.STREAM_DESCRIPTION + + stream_def.add_payloaddata_attribute("instance_id", StreamDefinition.STRING) stream_def.add_payloaddata_attribute("cluster_id", StreamDefinition.STRING) stream_def.add_payloaddata_attribute("network_partition_id", StreamDefinition.STRING) stream_def.add_payloaddata_attribute("member_id", StreamDefinition.STRING) @@ -139,6 +141,7 @@ class HealthStatisticsPublisher: """ event = ThriftEvent() + event.payloadData.append(self.cartridge_agent_config.instance_id) event.payloadData.append(self.cartridge_agent_config.cluster_id) event.payloadData.append(self.cartridge_agent_config.network_partition_id) event.payloadData.append(self.cartridge_agent_config.member_id) http://git-wip-us.apache.org/repos/asf/stratos/blob/4616888d/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/util/cartridgeagentconstants.py ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/util/cartridgeagentconstants.py b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/util/cartridgeagentconstants.py index 70afb30..1e59b8b 100644 --- a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/util/cartridgeagentconstants.py +++ b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/util/cartridgeagentconstants.py @@ -26,6 +26,7 @@ APP_PATH = "APP_PATH" SERVICE_GROUP = "SERIVCE_GROUP" SERVICE_NAME = "SERVICE_NAME" CLUSTER_ID = "CLUSTER_ID" +INSTANCE_ID= "INSTANCE_ID" LB_CLUSTER_ID = "LB_CLUSTER_ID" NETWORK_PARTITION_ID = "NETWORK_PARTITION_ID" PARTITION_ID = "PARTITION_ID"
